[pulseaudio-discuss] [PATCH]: High-definition audio pass-through support

Colin Guthrie gmane at colin.guthr.ie
Mon Nov 21 14:23:31 PST 2011


'Twas brillig, and Kelly Anderson at 21/11/11 11:08 did gyre and gimble:
> On 11/21/2011 03:35 AM, David Henningsson wrote:
>> On 11/17/2011 10:14 PM, Kelly Anderson wrote:
>>> Hi,
>>>
>>> I finally got around to working out the kinks to pass-through
>>> high-definition audio
>>> in Xbmc. Funny how long it took me to get back to it. I was
>>> re-reading some
>>> emails on the list from way back in March and one of the emails turned
>>> me on to
>>> a proper solution. One thing that I wasn't able to do was to get
>>> PulseAudio
>>> to pass-through 8 channel audio when the device's sink was set as
>>> hdmi-stereo.
>>>
>>> So I patched PulseAudio 1.1 for hdmi-surround-71 and lo and behold it
>>> worked.
>>> Here's a patch, hopefully we can get this added in the next official
>>> release
>>> of PulseAudio. I know that there are quite a few Xbmc users that have
>>> been anxiously
>>> waiting for high-definition audio pass-through to work correctly. Of
>>> course if someone
>>> has a better solution, that would be fine too.
>>>
>>> --- ./src/modules/alsa/mixer/profile-sets/default.conf.orig 2011-10-20
>>> 06:54:16.000000000 -0600
>>> +++ ./src/modules/alsa/mixer/profile-sets/default.conf 2011-11-17
>>> 02:16:00.038900536 -0700
>>> @@ -173,6 +173,12 @@ channel-map = left,right
>>> priority = 4
>>> direction = output
>>>
>>> +[Mapping hdmi-surround-71]
>>> +device-strings = hdmi:%f
>>> +channel-map =
>>> front-left,front-right,rear-left,rear-right,front-center,lfe,side-left,side-right
>>>
>>
>> I've been experimenting with enabling such stuff in Ubuntu, but never
>> got any positive or negative feedback about it. FYI, I'm attaching
>> what we're shipping for Nvidia and Intel (as part of the jack
>> detection stuff) in Ubuntu 11.10.
>>
>> And Colin, you're right: this isn't passthrough, this is multichannel
>> PCM.
>>
> It's not specifically pass-through, but high-def (i.e, DTS-HD)
> pass-through requires an 8 channel mapping.  I've got Xbmc/PulseAudio
> pass-through working well.  It passes low bit rate data through as 2
> channel and high bit rate data as 8 channel.  Specifically what I have
> to do in the Xbmc/PulseAudio code is switch the sink to 8 channels when
> requiring high bit rates and switch back to 2 channels for standard bit
> rates.  The last couple of commits pertain to the 2/8 channel switching.
> 
> git://github.com/cbxbiker61/xbmc.git


I'm still confused at this terminology. 8 channel playback and
pass-through are very different things.

Is this 8 channel HDMI setup any different to an 8 channel analog one?
If so using the term passthrough is very wrong.

If my receiver supports DTS-HD natively, then enabling pass-through mode
is totally possible. A digital profile (even in 2ch mode) will happily
stitch to taking 8ch DTS encoded data. I'm not specifically sure about
DTS-HD encoding and whether it can be packaged up in packed format we
accept for passthrough data, but I'm sure Arun or Pierre can comment
more about the technical bits.


One thing I'll say for sure is that we really do not want applications
to call the likes of pa_context_set_card_profile_by_name(). It's a very
bad idea for the application to second guess the routing policy and poke
too hard at the underlying system. xbmc might be a bit of a special case
here, but IMO it's still not appropriate. You either have a 8ch setup
that you use all the time (which should still be able to jump into pass
through mode if needed) or you don't. It shouldn't switch on-demand.

We may want to write a system that can route things and change profiles
at the PA end when appropriate (i.e. switch to a 2ch profile when
playing 2ch streams and switch to 8ch profile when playing 8ch stream)
but this routing decision is something that should definitely happen at
the PA end, not in individual apps.

I'm happy to discuss the rationale with you on IRC, but it's partially
covered by my recent comments about routing and priority lists, but
really goes beyond that. I appreciate your commits will work with your
setup but it's really not a universally portable solution that could be
upstreamed IMO.

That said, I'm very keen for you to keep hacking on XBMC's PA support
seeing as I use it a lot myself and certainly want it to have a first
class implementation :D

Col







-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

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