[pulseaudio-discuss] [PATCH] AC3 passthrough support

Colin Guthrie gmane at colin.guthr.ie
Sat Oct 16 03:29:58 PDT 2010

'Twas brillig, and Colin Guthrie at 16/10/10 11:10 did gyre and gimble:
> 'Twas brillig, and Colin Guthrie at 15/10/10 16:51 did gyre and gimble:
>> Hiya,
>> 'Twas brillig, and elupus at ecce.se at 15/10/10 13:54 did gyre and gimble:
>>> I must admit I've not looked much at our PulseAudio implementation
>>> but i really thought it supported multichannel directly. I tried to
>>> test it last night, but I was unable to configure pulse for a profile
>>> of more than 2 channels in pulse settings (stock lucid version). I
>>> figured that had to be done first. When that didn't work I didn't
>>> even try anything in xbmc.
>> Damn, this was on my todo list for last night but I forgot :s
>> I meant to look and see if my statements were (still) true or not :)
>> Will try and do it when I get home if I'm not too drunk (it is Friday
>> afterall!)
> Well last night didn't happen for testing, but upon looking this
> morning, I have to take back my previous statement.
> All is working very well with 5.1 direct pulseaudio output. Perhaps it
> was an older version that I had to go via alsa or maybe I just made that up.
> Either way I can get really nice 5.1 output via spdif using the a52 alsa
> plugin on top of PA. Works really well.

I should perhaps clarify a little (sent that email a bit too quick - it
is the morning and I do have a hangover :D)

Anyway, although I am using pulseaudio with the digital 5.1 output, the
audio configuration in XBMC is as follows:

Audio Output: Analog <-- yes, I have to pick analog even though I'm
ultimately using digital...
Speaker Conf: 5.1

(everything else is greyed out except Audio output device)

Here I can pick "Defaults" or the named PA sink ("Digital Surround 5.1
(IEC958/AC3)" in my case) and both work fine.

Movies with 5.1 sound play in 5.1, those with 2 channels (and most of my
music) only play with 2 channels. So it all looks correct.

Ultimately, in my case, the GUI isn't perfect (due to the "Analog"
selection when I know I'm ultimately using digital) but until all the
passthrough stuff can be dealt with in a transparent way inside PA
itself then I've not really got much in the way of suggestions on how to
improve it.

Ultimately I guess even the question of speaker configuration could be
left out and just push the audio to PA regardless and let it deal with
it (obviously only if PA is running - I'm guessing support for non-PA
modes will still need this). PA will downmix the 5.1 if needed (tho'
maybe you prefer your own downmixer?) and the only cleverness at the
client side would be to check whether or not "passthrough" was supported
in any way so to determine if local DTS decode is needed (although this
could still be a setting I guess - or it could just be a "try with
passthrough... is it working? No? OK, local decode" approach - not too
sure how it would work, but this is still looking ahead a little :)

For clarity the "click" sounds in the GUI from SDL are still 2 channel,
but I think having a 5.1 click would be overkill anyway :D What is
interesting is that if the movie is still playing the background, then
the SDL output stays away and in actual fact with my setup it could
stick around if it wanted. What I would be tempted to do however is tag
the SDL stream as media.role=event as it really is an event sound and
thus should (IMO) have it's volume controlled via the "System Sounds"
slider in pavucontrol and friends. In a totally ideal world the SDL
stream would not be permanent as it is now (e.g. the device is open but
not actively being used until a "click" happens) but rather open
as-needed. In an even better than ideal world, the click sounds would
utilise PA's sample cache for really quick and responsive playing of the
clicks. libcanberra could be used here to do all this for you, but
perhaps it's a extra dep too many!?

Anyway, just thought I'd send this extra info in case it's any use at
all. KUTGW on XBMC :)



Colin Guthrie

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]

More information about the pulseaudio-discuss mailing list