<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><div>Thanks for this detailed reply.<br><br>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?<br><br>Or can profiles be made to work with the load-module module-alsa-sink ... lines?<br><br>Cheers,<br>Mike<br></div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 13px;"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Tanu Kaskinen <tanuk@iki.fi><br><b><span style="font-weight: bold;">To:</span></b> pulseaudio-discuss@mail.0pointer.de<br><b><span style="font-weight: bold;">Sent:</span></b> Sun, 11 July, 2010 12:23:25<br><b><span style="font-weight:
bold;">Subject:</span></b> Re: [pulseaudio-discuss] {PATCH][RFC] AC3 passthrough support<br></font><br>On Sun, 2010-07-11 at 09:26 +0000, Michael Rans wrote:<br>> That's the the problem - as you put it "both sinks (spdif/stereo and<br>> spdif/a52) can't exist at the same time".<br>> <br>> If A52 encoding occurred in Pulseaudio, there would only be one sink,<br>> hence the switch between stereo and A52 would be transparent and could<br>> occur even while the music is playing (with a small interruption).<br><br>No, doing the encoding in pulseaudio wouldn't change the situation.<br>There must be separate sinks for stereo and surround modes, because<br>sinks can't change their channel map on the fly. (Of course that could<br>be changed, but I don't think such change gets lots of support from the<br>developers.) What do you mean by "transparent"? You can change the<br>profile while music plays, that's not a problem.<br><br>> Is the A52
profile in Ubuntu Lucid 10.04LTS?<br><br>Most likely yes.<br><br>I now actually checked what's the situation with the a52 profile on my<br>own machine. I don't have the profile available, even though I have<br>other spdif profiles, so I looked at the initialization to see what's<br>wrong, and found this:<br><br>D: alsa-mixer.c: Looking at profile output:iec958-ac3-surround-40<br>D: alsa-mixer.c: Checking for playback on Digital Surround 4.0 (IEC958/AC3) (iec958-ac3-surround-40)<br>D: alsa-util.c: Trying a52:0 with SND_PCM_NO_AUTO_FORMAT ...<br>I: (alsa-lib)pcm.c: Unknown PCM a52:0<br>I: alsa-util.c: Error opening PCM device a52:0: No such file or directory<br><br>So alsa doesn't find the a52 device at all, even though I do seem to<br>have the plugin installed (this file<br>exists: /usr/lib/alsa-lib/libasound/libasound_module_pcm_a52.so). I<br>don't feel like experimenting, but I would guess that device string<br>"a52" instead of "a52:0" would work
better.<br><br>...nah, I did feel like experimenting after all, since all I had to do<br>was to edit one file<br>(/usr/local/share/pulseaudio/alsa-mixer/profile-sets/default.conf) and<br>do some pulseaudio restarting. It turned out that plain a52 didn't work<br>any better, so what's wrong? Well, at least on Debian there is no device<br>configured by default that would use the a52 plugin, so I had to add<br>this to ~/.asoundrc:<br><br>pcm.a52 {<br> type a52<br>}<br><br>Now I got further:<br><br>D: alsa-mixer.c: Looking at profile output:iec958-ac3-surround-40<br>D: alsa-mixer.c: Checking for playback on Digital Surround 4.0 (IEC958/AC3) (iec958-ac3-surround-40)<br>D: alsa-util.c: Trying a52:0 with SND_PCM_NO_AUTO_FORMAT ...<br>I: (alsa-lib)conf.c: Unknown parameters 0<br>I: (alsa-lib)pcm.c: Unknown PCM a52:0<br>I: alsa-util.c: Error opening PCM device a52:0: Invalid argument<br>D: alsa-util.c: Trying a52 with SND_PCM_NO_AUTO_FORMAT ...<br>D:
alsa-util.c: Managed to open a52<br>D: alsa-util.c: snd_pcm_hw_params_set_channels(4) failed: Invalid argument<br>D: alsa-util.c: Trying a52 without SND_PCM_NO_AUTO_FORMAT ...<br>D: alsa-util.c: Managed to open a52<br>D: alsa-util.c: snd_pcm_hw_params_set_channels(4) failed: Invalid argument<br>D: alsa-util.c: Trying plug:a52 with SND_PCM_NO_AUTO_FORMAT ...<br>D: alsa-util.c: Managed to open plug:a52<br>D: alsa-util.c: snd_pcm_hw_params_set_channels(4) failed: Invalid argument<br>D: alsa-util.c: Trying plug:a52 without SND_PCM_NO_AUTO_FORMAT ...<br>D: alsa-util.c: Managed to open plug:a52<br>D: alsa-util.c: snd_pcm_hw_params_set_channels(4) failed: Invalid argument<br>I: alsa-util.c: Failed to set hardware parameters on plug:a52: Invalid argument<br><br>That looks good (that's the 4.0 profile, and by default the a52 plugin<br>uses the 5.1 channel configuration, so the failure is expected). From<br>that log we can see that indeed, "a52:0" doesn't work,
but "a52" does.<br>That means that you don't have the profile available, because you don't<br>have the modification in your profile set configuration.<br><br>So, what about the 5.1 profile?<br><br>D: alsa-mixer.c: Looking at profile output:iec958-ac3-surround-51<br>D: alsa-mixer.c: Checking for playback on Digital Surround 5.1 (IEC958/AC3) (iec958-ac3-surround-51)<br>D: alsa-util.c: Trying a52:0 with SND_PCM_NO_AUTO_FORMAT ...<br>I: (alsa-lib)conf.c: Unknown parameters 0<br>I: (alsa-lib)pcm.c: Unknown PCM a52:0<br>I: alsa-util.c: Error opening PCM device a52:0: Invalid argument<br>D: alsa-util.c: Trying a52 with SND_PCM_NO_AUTO_FORMAT ...<br>D: alsa-util.c: Managed to open a52<br>D: alsa-util.c: Maximum hw buffer size is 320 ms<br>D: alsa-util.c: Set buffer size first (to 4797 samples), period size second (to 1199 samples).<br>I: alsa-util.c: Device a52 doesn't support 44100 Hz, changed to 48000 Hz.<br>D: alsa-mixer.c: Profile
output:iec958-ac3-surround-51 supported.<br><br>Whee, it works! I don't have anything to connect the digital output,<br>though, so I didn't test actual playback, but at least the profile is<br>now available.<br><br>So, the first problem when trying to make the a52 alsa plugin work out<br>of the box with pulseaudio is that (at least on all distros) the a52<br>device isn't configured by default. I think it's the job for the<br>distributions to automatically configure the device when the a52 plugin<br>is installed.<br><br>The second problem is that the a52 device doesn't support the card<br>argument. I would imagine that the a52 plugin can actually be configured<br>to use certain card, but passing that configuration just doesn't work<br>with the simple configuration that I used. It might be possible to come<br>up with a more complex definition for the a52 device that passes the<br>parameter correctly to the plugin, but my asoundrc skills are not
that<br>good. In case the a52 plugin really can't be configured to use certain<br>card, then that's a bug in the plugin.<br><br>After those two problems we get to the problems with assertion failures<br>and too fast playback speed etc...<br><br>-- <br>Tanu Kaskinen<br><br><br>_______________________________________________<br>pulseaudio-discuss mailing list<br><a ymailto="mailto:pulseaudio-discuss@mail.0pointer.de" href="mailto%3A%25e%25">pulseaudio-discuss@mail.0pointer.de</a><br><a href="https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss" target="_blank">https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss</a><br></div></div>
</div><br>
</body></html>