On Sun, 2012-12-09 at 13:39 -0800, Miller Puckette wrote:
grasping at straws but... maybe try Alsa using "callbacks" - so that Pd maintains the FIFO instead of having ALSA do it. I think you can do this by opening ALSA through portaudio, requesting blocking in Pd but replace
#if defined(__APPLE__) #define FAKEBLOCKING #endif
with just
#define FAKEBLOCKING
in s_audio_pa.c
I haven't tried this - don't have time right now - but if you're willing I'd be eager to hear how it turns out :)
Hey, I can compile Pd now with portaudio support!
I applied your suggested change, re-compiled Pd and it seems now the default back-end is -pa.
It turns out, that I am only able to open ALSA through portaudio, when no pulseaudio daemon is running. Turning pulseaudio off is not as easy as 'pulseaudio --kill', as the daemon will automatically be relaunched in a standard Ubuntu environment. I had to write:
autospawn = no
to ~/.pulse/client.conf and then do 'pulseaudio --kill' in order to really stop it.
Now I was able to select the 'raw' soundcard through the portaudio dialog of Pd. It turns out that with your proposed change to s_audio_pa.c I can set an arbitrarily high buffer. With an audio buffer setting of 1000ms I was able to do stuff like:
[1000000( | [until] | [pow 123.456]
without getting any drop-outs! Mission accomplished. Many thanks for your help!
Regarding callbacks: This was without checking the 'use callbacks' checkbox in the portaudio dialog. I wasn't able to change the audio buffer when it was checked withouth Pd crashing. Also when I check it after using a high buffer setting, Pd crashes:
*** glibc detected *** pd: free(): corrupted unsorted chunks: 0x082797b8 *** ======= Backtrace: ========= /lib/i386-linux-gnu/libc.so.6(+0x75ee2)[0xb7506ee2] /usr/lib/i386-linux-gnu/libportaudio.so.2(+0x1a45f)[0xb767545f] /usr/lib/i386-linux-gnu/libportaudio.so.2(+0x8a73)[0xb7663a73] /usr/lib/i386-linux-gnu/libportaudio.so.2(+0xb365)[0xb7666365] /usr/lib/i386-linux-gnu/libportaudio.so.2(Pa_CloseStream+0x73)[0xb7661f83] pd(pa_close_audio+0x21)[0x8119fb1] pd(sys_close_audio+0xe5)[0x80ca4c5] pd(m_mainloop+0x917)[0x80bbad7] pd(main+0x1b)[0x8055deb] /lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0xb74aa4d3] pd[0x8055e11]
Anyway, I am very glad to see this work in Linux. Will have to test it on the machine with the 'real' soundcard as I only tested with a build-in "HDA Intel, CONEXANT Analog".
Many thanks for your help, Roman