Hi, I am adding (trying to add) pulse support to an application I author. But no matter what I do, I can't get it to play correct sound. Here is the sordid history.
I first added pa_simple support as this seemed tailor made for what I want to do - send buffers of data at regular intervals to a sound device. I used the sample from the web page and looked at implementations from several other applications - Csound, sox, helix-player. It compiled cleanly, gave every indication it was working, but the sound that came out sounded like a dying whale. I traced it in gdb to the point of writing the buffer as a chunk someplace, and everything looked fine. So I upgraded to using the standard model - I copied the xmms-pulse plugin.c as a template and modified it until it compiled on my system without issues. Same problem, sound is horrible. To actually use callbacks would require a complete change in architecture for the application, and I'm not going there. I then put in modifications to tweak the buffer sizes on the server from the defaults with the same result. I check writable, and sleep until there is enough space for a buffer of sound, write it and generate the next buffer. >From this list I discovered the pacmd interface. I turned on logging to level 4 and set source line flagging. I now see messages about being unable to push to the queue, and the line is 1355 in protocol-native.c. I'm using standard 44100, 2 ch, S16LE in interleaved format. This is the default from the /etc/pulse/daemon.conf file. The buffer in pulse is receiving it fine from looking at it in gdb. I've added my user to the pulse, pulse-rt, and pulse-access groups. gnash works, and I'm pretty sure it is using pulse. I hear system sounds. If I use the default sound device, it plays correctly. Because of the alsa_pulse.conf in /etc/alsa this is pulse I think. So, I'm baffled. What's wrong? Some bugs/issues I've found along the way. The xmms-pulse plugin.c call to pa_stream_write has PA_SEEK_STREAM_RELATIVE and offset reversed from the template in the stream.h header file. Configure complains about the /usr/include/pulse/stream.h file unless the following two includes are added: #include <pulse/context.h> #include <pulse/proplist.h> Configure complains about the /usr/include/pulse/ext-stream-restore.h file unless the following two includes are added: #include <pulse/volume.h> #include <pulse/channelmap.h> This is taking waaaayyy too long. It is peripheral to the purpose of my app, and I'd rather be adding new features. So I would be grateful for any insight. pulseaudio-0.9.19-1.fc12.x86_64 pulseaudio-module-jack-0.9.19-1.fc12.x86_64 wine-pulseaudio-1.1.29-3.fc12.i686 pulseaudio-module-zeroconf-0.9.19-1.fc12.x86_64 pulseaudio-libs-0.9.19-1.fc12.x86_64 pulseaudio-esound-compat-0.9.19-1.fc12.x86_64 pulseaudio-libs-glib2-0.9.19-1.fc12.x86_64 pulseaudio-gdm-hooks-0.9.19-1.fc12.x86_64 pulseaudio-module-lirc-0.9.19-1.fc12.x86_64 pulseaudio-debuginfo-0.9.19-1.fc12.x86_64 pulseaudio-module-x11-0.9.19-1.fc12.x86_64 alsa-plugins-pulseaudio-1.0.21-2.fc12.x86_64 fluxbox-pulseaudio-1.1.1-5.fc12.noarch pulseaudio-utils-0.9.19-1.fc12.x86_64 pulseaudio-libs-0.9.19-1.fc12.i686 pulseaudio-libs-zeroconf-0.9.19-1.fc12.x86_64 kde-settings-pulseaudio-4.3-10.1.noarch xine-lib-pulseaudio-1.1.16.3-4.fc12.x86_64 pulseaudio-libs-devel-0.9.19-1.fc12.x86_64 pulseaudio-module-bluetooth-0.9.19-1.fc12.x86_64 xmms-pulse-0.9.4-8.fc12.x86_64 pulseaudio-module-gconf-0.9.19-1.fc12.x86_64 pavucontrol-0.9.9-1.fc12.x86_64 padevchooser-0.9.4-0.10.svn20070925.fc12.x86_64 pavumeter-0.9.3-4.fc12.x86_64 paman-0.9.4-4.fc12.x86_64 _______________________________________________ pulseaudio-discuss mailing list [email protected] https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
