Hi Dan,
Thanks for your help. I know they're holding off the rewrite in OF 7 due to time and budgetary constraints, but we think there was another reason why it kept hanging.
A, external I wrote in C gives out sample accurate events (rather that block-aligned ones) as well as a signal. The outlet_float statements were embedded within the DSP loop. You can get away with this in Pd running on a computer, but it doesn't work on an iPhone.
This may be bad programming (I'm not sure - I taught myself) but it does cause Pd to crash when DSP is turned off in ofxPd on iOS. The DSP never got turned off and a chunk of audio was left looping, regardless of what the DSP chain was supposed to be doing, both in the simulator and on the device.
Anyhow, I re-coded the external using a Pd clock to block-align the events and the problem went away. And I have finally learned to use clocks in Pd external coding! Ah, what fun I'm going to have ,-)
Does anyone know what the standard blocksize for writing RT audio from memory to the SD card in an iPhone is? That's another problem we're facing. Drop-outs happen when recording, and we think it might be because we need to deal with the audio in certain size chunks, but we're not sure what that size might be. And do they have to synchronize with Pd's block size (i.e. 64 samples) in order for this to work?
Cheers, Ed Ninja Jamm - a revolutionary new music remix app from Ninja Tune and Seeper, for iPhone and iPad http://www.ninjajamm.com/
Gemnotes-0.2: Live music notation for Pure Data, now with dynamics! http://sharktracks.co.uk/
From: Dan Wilcox danomatika@gmail.com To: Ed Kelly morph_2016@yahoo.co.uk Cc: Peter Brinkmann peter.brinkmann@googlemail.com; PD List pd-list@iem.at; Andrew Wallen andy.wallen@seeper.com Sent: Thursday, 11 July 2013, 17:17 Subject: Re: libPd hanging audio
You could try the 007 tag: https://github.com/danomatika/ofxPd/releases, everything after that will not work without some src modifications. (It may not be that much).
Personally, I would consider updating your version of OF. You'd need to remake the xcode project, but the sound stuff is in a much better shape.
On Jul 11, 2013, at 12:11 PM, Ed Kelly morph_2016@yahoo.co.uk wrote:
Hi Dan,
Thanks for quick response. Even with these compiler flags, we get the same result. On the same page there is this:
"RtAudio Hang on Exit in 0062 "RtAudio will hang on app exit in OF 0062. The only way to fix this is to make a small edit to the OF 0062 core by "editing lib/openFrameworks/sound/ofSoundStream.cpp and commenting line 143 so close() is not called."
I'm not entirely sure which version we're using, but the ofSoundStream.cpp file is only 140 lines long. If we upgrade to the latest
ofxPd, will it still work with OF 6.2?
Cheers, Ed
Ninja Jamm - a revolutionary new music remix app from Ninja Tune and Seeper, for iPhone and iPad http://www.ninjajamm.com/
Gemnotes-0.2: Live music notation for Pure Data, now with dynamics! http://sharktracks.co.uk/
From: Dan Wilcox danomatika@gmail.com To: Ed Kelly morph_2016@yahoo.co.uk Cc: Peter Brinkmann peter.brinkmann@googlemail.com; PD List pd-list@iem.at; Andrew Wallen andy.wallen@seeper.com Sent: Thursday, 11 July 2013, 16:52 Subject: Re: libPd hanging audio
Howdy guys,
See https://github.com/danomatika/ofxPd#for-xcode-1
From my notes, I have: -DHAVE_UNISTD_H -DUSEAPI_DUMMY -DPD -dynamiclib -ldl -lm
I also added this to the libpd Github wiki: https://github.com/libpd/libpd/wiki/libpd#build-settings
On Jul 11, 2013, at 11:45 AM, Ed Kelly morph_2016@yahoo.co.uk wrote:
Hi Dan, Peter,
I'm here with our ofxPd-based iPhone app, and we are getting a repeat of a particular problem listed here: http://createdigitalnoise.com/discussion/150/pdbase-closepatch/p1
Namely:
when closing a patch I would receive
this message: sys_close_audio: unknown API 9
and then we get a buzz, like a block of audio is being looped. We can't closePatch from the app code, nor can we turn DSP off from the app code.
In the forum post mentioned above, Peter Brinkmann said this was due to incorrect compiler flags. Can you tell us what the compiler flags were and what they were changed to?
Caveat - we are still using openFrameworks 6.2.
Cheers, Ed Kelly
Ninja Jamm - a revolutionary new music remix app from Ninja Tune and Seeper, for iPhone and iPad http://www.ninjajamm.com/
Gemnotes-0.2: Live music notation for
Pure Data, now with dynamics!
Dan Wilcox @danomatika danomatika.com robotcowboy.com
Dan Wilcox @danomatika danomatika.com robotcowboy.com