Re: [pulseaudio-discuss] {PATCH][RFC] AC3 passthrough support

2010-07-11 Thread Tanu Kaskinen
On Sat, 2010-07-10 at 13:24 +, Michael Rans wrote: I can't find any definition of snd_pcm_rewind() in the alsa-plugins source code. Does this function call through to a function in the plugins? snd_pcm_rewind() is in alsa-lib, not alsa-plugins. I don't know how the plugins do rewinding - I

Re: [pulseaudio-discuss] {PATCH][RFC] AC3 passthrough support

2010-07-11 Thread Tanu Kaskinen
On Sun, 2010-07-11 at 09:10 +0300, Tanu Kaskinen wrote: On Sat, 2010-07-10 at 13:24 +, Michael Rans wrote: I can't find any definition of snd_pcm_rewind() in the alsa-plugins source code. Does this function call through to a function in the plugins? snd_pcm_rewind() is in alsa-lib,

Re: [pulseaudio-discuss] {PATCH][RFC] AC3 passthrough support

2010-07-11 Thread Michael Rans
At the moment I can switch between A52 and stereo SPDIF but it requires file editing and restarting Pulseaudio. 1. I haven't tried the new profiles yet - does this mean with the profiles in a GUI, I would be able to switch from A52 to stereo SPDIF output without editing any files or

Re: [pulseaudio-discuss] {PATCH][RFC] AC3 passthrough support

2010-07-11 Thread Tanu Kaskinen
On Sun, 2010-07-11 at 08:43 +, Michael Rans wrote: At the moment I can switch between A52 and stereo SPDIF but it requires file editing and restarting Pulseaudio. 1. I haven't tried the new profiles yet - does this mean with the profiles in a GUI, I would be able to switch from A52 to

Re: [pulseaudio-discuss] {PATCH][RFC] AC3 passthrough support

2010-07-11 Thread Michael Rans
That's the the problem - as you put it both sinks (spdif/stereo and spdif/a52) can't exist at the same time. If A52 encoding occurred in Pulseaudio, there would only be one sink, hence the switch between stereo and A52 would be transparent and could occur even while the music is playing (with

Re: [pulseaudio-discuss] {PATCH][RFC] AC3 passthrough support

2010-07-11 Thread Michael Rans
Regarding your patch, I tried it but I got a seg fault. I also tried: size_t max_rewind = PA_MIN(u-hwbuf_size, snd_pcm_rewindable(u-pcm_handle)); pa_sink_set_max_rewind(u-sink, max_rewind); But u-pcm_handle is not populated at that stage as far as I can tell.

Re: [pulseaudio-discuss] {PATCH][RFC] AC3 passthrough support

2010-07-11 Thread Tanu Kaskinen
On Sun, 2010-07-11 at 09:26 +, Michael Rans wrote: That's the the problem - as you put it both sinks (spdif/stereo and spdif/a52) can't exist at the same time. If A52 encoding occurred in Pulseaudio, there would only be one sink, hence the switch between stereo and A52 would be

Re: [pulseaudio-discuss] {PATCH][RFC] AC3 passthrough support

2010-07-11 Thread Michael Rans
Thanks for this detailed reply. Would I be right in saying that for this to happen, you cannot define your own sinks in default.pa using load-module module-alsa-sink ... but must use the moduel detection? Or can profiles be made to work with the load-module module-alsa-sink ... lines? Cheers,

Re: [pulseaudio-discuss] {PATCH][RFC] AC3 passthrough support

2010-07-11 Thread Michael Rans
Further to my email below, I find that using udev detection and the change you suggested to default.conf, I get resource busy - I don't think my card likes it that it's SPDIF is opened twice, once as a stereo digital device and again through A52: E: alsa-util.c: snd_pcm_avail() returned a

Re: [pulseaudio-discuss] {PATCH][RFC] AC3 passthrough support

2010-07-11 Thread Michael Rans
Ah ok ignore that - I finally found what Colin's patch fixes :-) It is specifically when using udev (not alsa module loading as I have been previously) that it has an effect ie. if you have: load-module module-alsa-sink device=a52 rate=48000 sink_properties=device.description=a52 sink_name=a52

Re: [pulseaudio-discuss] {PATCH][RFC] AC3 passthrough support

2010-07-11 Thread Michael Rans
Finally I got it all working! These are the steps on Ubuntu Lucid 10.04 LTS: 1. Open from Pulse source code: src/modules/alsa/alsa-sink.c 2. Replace: pa_sink_set_max_rewind(u-sink, u-hwbuf_size); with: if(strcmp(u-device_name, a52) == 0) { pa_sink_set_max_rewind(u-sink, 0);