Csound Csound-dev Csound-tekno Search About

[Cs-dev] Android message logging hints, anyone?

Date2013-05-31 03:40
FromMichael Gogins
Subject[Cs-dev] Android message logging hints, anyone?
AttachmentsNone  None  

Be warned, there is an issue with message logging. The logging of Csound messages to the user interface of the CSDPlayer app is still not reliable.

The behavior is precisely as follows:

Sometimes, on the first run, the logging occurs perfectly. If so, it does not happen on the next performance.

This cycle can be repeated by killing the app.

If the logging doesn't happen, sometimes it can be made to happen by repeatedly clicking on the start button.

Setting a breakpoint in the CsoundCallbackWrapper's message callback shows that in cases when logging does not occur, it is because the callback is, in fact, not being called.

This implies that the problem is in the interaction between the CsoundObj and the CsoundCallbackWrapper. Probably, the wrapper is being initialized at the wrong time and in effect clearing the actual, low-level callback.

Any ideas? I'm about to throw the CsoundCallbackWrapper out (metaphorically, not actually) and use the message buffer in a timer thread instead.

In spite of this, I have placed the .apk on SourceForge. I'd be interested in your experiences.

Also, still no Lua, the message logging thing is killing me here.

By the way, I tried a menu and reverted to the buttons, which are (at least for me) much easier to use.

Regards,
Mike

--
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

Date2013-05-31 12:29
FromMichael Gogins
SubjectRe: [Cs-dev] Android message logging hints, anyone?
AttachmentsNone  None  
OK, this message logging problem is solved, and a new .apk is up on SourceForge. 

The solution is to push the instance of CsoundCallbackWrapper that is used to log Csound's runtime messages to the app GUI down into CsoundObj by creating a CsoundObj.MessagePoster interface that CsoundObj declares but CsoundAppActivity actually defines.

Works every time. I think this problem was caused by the timing of setting/unsetting the actual low level callback being indeterminate between CsoundObj and CsoundAppActivity, which are running in different threads.

Next up is adding LuaCsound (which uses and includes LuaJIT) and some of the other loadable opcodes.

Regards,
Mike


On Thu, May 30, 2013 at 10:40 PM, Michael Gogins <michael.gogins@gmail.com> wrote:

Be warned, there is an issue with message logging. The logging of Csound messages to the user interface of the CSDPlayer app is still not reliable.

The behavior is precisely as follows:

Sometimes, on the first run, the logging occurs perfectly. If so, it does not happen on the next performance.

This cycle can be repeated by killing the app.

If the logging doesn't happen, sometimes it can be made to happen by repeatedly clicking on the start button.

Setting a breakpoint in the CsoundCallbackWrapper's message callback shows that in cases when logging does not occur, it is because the callback is, in fact, not being called.

This implies that the problem is in the interaction between the CsoundObj and the CsoundCallbackWrapper. Probably, the wrapper is being initialized at the wrong time and in effect clearing the actual, low-level callback.

Any ideas? I'm about to throw the CsoundCallbackWrapper out (metaphorically, not actually) and use the message buffer in a timer thread instead.

In spite of this, I have placed the .apk on SourceForge. I'd be interested in your experiences.

Also, still no Lua, the message logging thing is killing me here.

By the way, I tried a menu and reverted to the buttons, which are (at least for me) much easier to use.

Regards,
Mike

--
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com



--
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

Date2013-05-31 12:44
FromVictor Lazzarini
SubjectRe: [Cs-dev] Android message logging hints, anyone?
AttachmentsNone  None  
Well I see two things:

1) AndroidCsound::SetOpenSLCallbacks() sets the message callback (in the C++ code)
2) The callback is set again in CsoubdObj.java (runOpenSL())

So maybe that is the root of the problem.

Victor


On 31 May 2013, at 03:40, Michael Gogins wrote:


Be warned, there is an issue with message logging. The logging of Csound messages to the user interface of the CSDPlayer app is still not reliable.

The behavior is precisely as follows:

Sometimes, on the first run, the logging occurs perfectly. If so, it does not happen on the next performance.

This cycle can be repeated by killing the app.

If the logging doesn't happen, sometimes it can be made to happen by repeatedly clicking on the start button.

Setting a breakpoint in the CsoundCallbackWrapper's message callback shows that in cases when logging does not occur, it is because the callback is, in fact, not being called.

This implies that the problem is in the interaction between the CsoundObj and the CsoundCallbackWrapper. Probably, the wrapper is being initialized at the wrong time and in effect clearing the actual, low-level callback.

Any ideas? I'm about to throw the CsoundCallbackWrapper out (metaphorically, not actually) and use the message buffer in a timer thread instead.

In spite of this, I have placed the .apk on SourceForge. I'd be interested in your experiences.

Also, still no Lua, the message logging thing is killing me here.

By the way, I tried a menu and reverted to the buttons, which are (at least for me) much easier to use.

Regards,
Mike

--
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




Date2013-05-31 12:47
FromMichael Gogins
SubjectRe: [Cs-dev] Android message logging hints, anyone?
AttachmentsNone  None  
Yes, but it looks like my solution solves that problem too.

Thanks,
Mike


On Fri, May 31, 2013 at 7:44 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
Well I see two things:

1) AndroidCsound::SetOpenSLCallbacks() sets the message callback (in the C++ code)
2) The callback is set again in CsoubdObj.java (runOpenSL())

So maybe that is the root of the problem.

Victor


On 31 May 2013, at 03:40, Michael Gogins wrote:


Be warned, there is an issue with message logging. The logging of Csound messages to the user interface of the CSDPlayer app is still not reliable.

The behavior is precisely as follows:

Sometimes, on the first run, the logging occurs perfectly. If so, it does not happen on the next performance.

This cycle can be repeated by killing the app.

If the logging doesn't happen, sometimes it can be made to happen by repeatedly clicking on the start button.

Setting a breakpoint in the CsoundCallbackWrapper's message callback shows that in cases when logging does not occur, it is because the callback is, in fact, not being called.

This implies that the problem is in the interaction between the CsoundObj and the CsoundCallbackWrapper. Probably, the wrapper is being initialized at the wrong time and in effect clearing the actual, low-level callback.

Any ideas? I'm about to throw the CsoundCallbackWrapper out (metaphorically, not actually) and use the message buffer in a timer thread instead.

In spite of this, I have placed the .apk on SourceForge. I'd be interested in your experiences.

Also, still no Lua, the message logging thing is killing me here.

By the way, I tried a menu and reverted to the buttons, which are (at least for me) much easier to use.

Regards,
Mike

--
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel




--
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com