[Csnd] Problems with the Csound App on Android
Date | 2018-11-21 09:01 |
From | Karin Daum |
Subject | [Csnd] Problems with the Csound App on Android |
Hi, since more than a year I'm programming Apps on Android for my multimedia installations. For a possible future project I had the idea to include Csound for realtime sound generation in an app. To start with I downloaded yesterday the Csound App from Google Play, just to check if the processors on the device are powerful enough for the application I have in mind. 1.) The first problem I encountered with a simple example is that the performance does not stop normally (see 1st attached file). The instrument stopped as given by the score section after 5 seconds. Then the normal printout for ending the performance appears. But then it is looping (without restarting the instrument) producing output to the screen until the stop button is pressed. 2.) The second problem I realised, when trying to play the csd file, I'm currently working on. The parser stopped reported an error with the readfi opcode and stopped. The printout can be seen on the second attached file. A simple csd-file the problem (3rd file) and some simple input file (4th file) for verifying and debugging the problem are attached. In addition: if I interpret the printout correctly: The Csound app is 32 bit. If so is the also a 64 bit version? Cheers, Karin Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2018-11-21 09:29 |
From | Victor Lazzarini |
Subject | Re: [Csnd] Problems with the Csound App on Android |
Csound App is a frontend developed by Michael Gogins, maybe he will be able to answer your questions in relation to it (you can think of it as the CsoundQT or Cabbage equivalent for Android). The Csound for Android we release as part of the Csound project is an SDK for developing Android apps, https://github.com/csound/csound/releases/download/6.12.2/Csound6.12.0-Android.zip which may be what you’d ultimately might want to to use. Currently, we release a floats version (32bit), but we may consider releasing a doubles (64bit) if there is a need. Note this is not to do with the processor/OS platform being 32 or 64bit. ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 21 Nov 2018, at 09:01, Karin Daum |
Date | 2018-11-21 11:38 |
From | Karin Daum |
Subject | Re: [Csnd] Problems with the Csound App on Android |
Hi Victor, thanks for your explanation. Indeed, finally I will have to use Csound6.12.0-Android.zip you mentioned. For the moment I wanted to get a feeling on how it behaves, especially concerning CPU time, and to see if my csd works at all. cheers, Karin > On 21 Nov 2018, at 10:29, Victor Lazzarini |
Date | 2018-11-21 15:53 |
From | Michael Gogins |
Subject | Re: [Csnd] Problems with the Csound App on Android |
The problem is that Opcodes/date.c, which contains the readfi opcode, is not included in the Android build of Csound. That is true of the Csound for Android app, and it also appears to be true for the Android SDK build of Csound mentioned by Victor. I am trying to correct this omission now. If I do, I will post a new release of the Csound for Android app immediately. ----------------------------------------------------- Michael Gogins Irreducible Productions http://michaelgogins.tumblr.com Michael dot Gogins at gmail dot com On Wed, Nov 21, 2018 at 6:39 AM Karin Daum |
Date | 2018-11-21 15:56 |
From | Victor Lazzarini |
Subject | Re: [Csnd] Problems with the Csound App on Android |
Thanks for reporting this. We will check. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland > On 21 Nov 2018, at 15:54, Michael Gogins |
Date | 2018-11-21 16:14 |
From | Karin Daum |
Subject | Re: [Csnd] Problems with the Csound App on Android |
thanks, for caring about it. cheers, Karin > On 21 Nov 2018, at 16:53, Michael Gogins |
Date | 2018-11-21 21:41 |
From | Michael Gogins |
Subject | Re: [Csnd] Problems with the Csound App on Android |
I have fixed both of these issues in the Csound for Android app, and a new version is available on the Google Play Store. I added filein and a number of other plugin opcodes to the Android NDK build. I did not include serial, system call, the Chua opcodes, or the linear algebra opcodes, but most of the others are now in. I changed the Google Oboe audio callback to explicitly close the audio stream when Csound has finished performing. Your example now works on my phone. Thanks for the bug reports! ----------------------------------------------------- Michael Gogins Irreducible Productions http://michaelgogins.tumblr.com Michael dot Gogins at gmail dot com On Wed, Nov 21, 2018 at 11:15 AM Karin Daum |
Date | 2018-11-22 09:29 |
From | Karin Daum |
Subject | Re: [Csnd] Problems with the Csound App on Android |
Hi Michael, thank you for fixing the problems. My main csd I’m currently working on works. Unfortunately CPU power seems to be a limitation, although the smartphone used for testing is quite fast (HTC U11). I hear a lot of interruptions and using top shows me that Csound runs at about 100% of a core. Obviously, there are too many instruments running simultaneously. I have to see, if I find a solution for it. cheers, Karin > On 21 Nov 2018, at 22:41, Michael Gogins |
Date | 2018-11-22 11:59 |
From | Michael Gogins |
Subject | Re: [Csnd] Problems with the Csound App on Android |
You could try running with multiple threads e.g. "-j4". But if your piece is full of rapid changes this probably won't help. Also try different values of ksmps. I usually use 100 or 128. Best, Mike On Thu, Nov 22, 2018, 04:29 Karin Daum <karin.daum@desy.de wrote: Hi Michael, |
Date | 2018-11-22 13:58 |
From | Karin Daum |
Subject | Re: [Csnd] Problems with the Csound App on Android |
hi Mike, meanwhile I did some Benchmark test (Geekbench 4) This gives a factor of about 2 between my five years old Mac Book Pro and the HTC U11. This agrees with what I have hoped for. However when running my csd (with suppressing some instruments, such that I don’t get interruptions on the smartphone) I see a factor of 8 in speed. This large factor I did not expect. Changing ksmps to 128 (from 8) speeds up the code by a factor of ~2 on the Mac but only ~1.15 on the smartphone. Multicore is not a solution, because I’m using global variables, also for summing up the output signals from the different instruments. In addition there is a problem handling this (producing a lot of clicks) up to Csound 6.12 (see my previous problem report end of last month). This problem was then solved by John for 6.13 which is not released yet. cheers, Karin
|
Date | 2018-11-22 14:56 |
From | Michael Gogins |
Subject | Re: [Csnd] Problems with the Csound App on Android |
Thanks for your report. I build the app from the develop branch of Csound. If I see the fix you mention I will do a new release of the app. I was under the impression that global variables would work in multithreaded orchestras. Have you verified the problems? Best, Mike On Thu, Nov 22, 2018, 08:58 Karin Daum <karin.daum@desy.de wrote:
|
Date | 2018-11-22 17:59 |
From | Karin Daum |
Subject | Re: [Csnd] Problems with the Csound App on Android |
global variables work also in multithreaded orchestras, but the gain in performance is expected to be not as large as possible (see John’s paper in St Petersberg ICSC) It would be great, if you would fix the multithread problem on the App. There is a simple csd attached to my problem report as of Oct. 28th which can be used for verifying and debugging. The smaller ksmps the more frequent are the distortions. Thanks, Karin
|
Date | 2018-11-22 20:29 |
From | Michael Gogins |
Subject | Re: [Csnd] Problems with the Csound App on Android |
I see the problem with noise in -j4 with the latest app. I will try a fix to your code. Can you send your piece or a test piece eith a similar load? Best, Mike On Thu, Nov 22, 2018, 12:59 Karin Daum <karin.daum@desy.de wrote:
|