[pulseaudio-discuss] [PATCH] format: Fix rate for HBR passthrough formats

Alexander E. Patrakov patrakov at gmail.com
Sat May 26 09:47:03 UTC 2018


2018-05-25 22:15 GMT+08:00 Arun Raghavan <arun at arunraghavan.net>:
> On Tue, 22 May 2018, at 4:32 PM, Alexander E. Patrakov wrote:
>> There is some Microsoft documentation that contradicts this code.
>>
>> https://msdn.microsoft.com/en-us/library/windows/desktop/dd316761(v=vs.85).aspx
>>
>> """
>> Dolby TrueHD (MAT)
>>
>> Dolby TrueHD content is transmitted over IEC 60958 at 176.4 kHz / 8
>> channels (requiring an IEC 60958 frame rate of 705.6 kHz) for content
>> sample rates of 44.1, 88.2 and 176.4 kHz, and 192 kHz / 8 channels
>> (requiring an IEC 60958 frame rate of 768 kHz) for content sample
>> rates of 48, 96 and 192 kHz.
>> """
>
> Based on Peter's input in a private thread, seems this is not the case on Linux:
>
> https://github.com/xbmc/xbmc/blob/master/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp#L135
> https://github.com/xbmc/xbmc/blob/master/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp#L486

I have looked, and also obtained a copy of IEC 61937-5-2006 standard,
and I think I understand where this discrepancy comes from. The issue
is that the standard does not define at all what to do if the sample
rate of DTS audio is not a multiple of 48 kHz. I.e., it does not even
cover the DTS CD case (44.1 kHz) that de-facto exists!

Still, I think that diverging from what Windows does is not a good
thing. Has anyone tested that passthrough works with DTS-HD streams
that are not with a sample rate that is a multiple of 48 kHz? Does
anyone have such DTS-HD stream at all?

>
> Cheers,
> Arun
>
>> 2018-05-22 12:13 GMT+08:00 Arun Raghavan <arun at arunraghavan.net>:
>> > In high bitrate mode, we force 192kHz/8ch as the sample format, which is
>> > the expectation for HBR formats (as that is what allows for the largest
>> > possible packet size).
>> > ---
>> >  src/pulsecore/core-format.c | 3 +++
>> >  1 file changed, 3 insertions(+)
>> >
>> > diff --git a/src/pulsecore/core-format.c b/src/pulsecore/core-format.c
>> > index 862a74b5d..096acc3a2 100644
>> > --- a/src/pulsecore/core-format.c
>> > +++ b/src/pulsecore/core-format.c
>> > @@ -248,6 +248,9 @@ int pa_format_info_to_sample_spec_fake(const pa_format_info *f, pa_sample_spec *
>> >
>> >      if (f->encoding == PA_ENCODING_EAC3_IEC61937)
>> >          ss->rate *= 4;
>> > +    else if ((f->encoding == PA_ENCODING_TRUEHD_IEC61937) ||
>> > +             (f->encoding == PA_ENCODING_DTSHD_IEC61937))
>> > +        ss->rate = 192000;
>> >
>> >      return 0;
>> >  }
>> > --
>> > 2.17.0
>> >
>> > _______________________________________________
>> > pulseaudio-discuss mailing list
>> > pulseaudio-discuss at lists.freedesktop.org
>> > https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
>>
>>
>>
>> --
>> Alexander E. Patrakov



-- 
Alexander E. Patrakov


More information about the pulseaudio-discuss mailing list