All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: compress: Add AC3, EAC3, TrueHD, DTS, MPEG-H 3D Audio Stream (MHAS)
@ 2022-12-06 14:53 Carlos Rafael Giani
  2022-12-06 15:07 ` Pierre-Louis Bossart
  0 siblings, 1 reply; 4+ messages in thread
From: Carlos Rafael Giani @ 2022-12-06 14:53 UTC (permalink / raw)
  To: Vinod Koul, Jaroslav Kysela, Takashi Iwai; +Cc: alsa-devel, linux-kernel

These audio codecs are used in sound bars and digital TVs, and benefit
from off-loading to a DSP. In particular, Dolby Atmos and MPEG-H 3D audio
spatialization is done in dedicated DSPs. Thus, adding these codecs  to
the Compress-Offload API makes sense.

Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
---
 include/uapi/sound/compress_params.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/uapi/sound/compress_params.h b/include/uapi/sound/compress_params.h
index ddc77322d571..7a58e2026be3 100644
--- a/include/uapi/sound/compress_params.h
+++ b/include/uapi/sound/compress_params.h
@@ -43,7 +43,13 @@
 #define SND_AUDIOCODEC_BESPOKE               ((__u32) 0x0000000E)
 #define SND_AUDIOCODEC_ALAC                  ((__u32) 0x0000000F)
 #define SND_AUDIOCODEC_APE                   ((__u32) 0x00000010)
-#define SND_AUDIOCODEC_MAX                   SND_AUDIOCODEC_APE
+#define SND_AUDIOCODEC_AC3                   ((__u32) 0x00000011)
+#define SND_AUDIOCODEC_EAC3                  ((__u32) 0x00000012)
+#define SND_AUDIOCODEC_TRUEHD                ((__u32) 0x00000013)
+#define SND_AUDIOCODEC_DTS                   ((__u32) 0x00000014)
+/* MPEG-H 3D Audio Stream (MHAS) as defined in ISO/IEC 23008-3 */
+#define SND_AUDIOCODEC_MHAS                  ((__u32) 0x00000015)
+#define SND_AUDIOCODEC_MAX                   SND_AUDIOCODEC_MHAS
 
 /*
  * Profile and modes are listed with bit masks. This allows for a
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ALSA: compress: Add AC3, EAC3, TrueHD, DTS, MPEG-H 3D Audio Stream (MHAS)
  2022-12-06 14:53 [PATCH] ALSA: compress: Add AC3, EAC3, TrueHD, DTS, MPEG-H 3D Audio Stream (MHAS) Carlos Rafael Giani
@ 2022-12-06 15:07 ` Pierre-Louis Bossart
  2022-12-06 15:16   ` Carlos Rafael Giani
  0 siblings, 1 reply; 4+ messages in thread
From: Pierre-Louis Bossart @ 2022-12-06 15:07 UTC (permalink / raw)
  To: Carlos Rafael Giani, Vinod Koul, Jaroslav Kysela, Takashi Iwai
  Cc: alsa-devel, linux-kernel



On 12/6/22 08:53, Carlos Rafael Giani wrote:
> These audio codecs are used in sound bars and digital TVs, and benefit
> from off-loading to a DSP. In particular, Dolby Atmos and MPEG-H 3D audio
> spatialization is done in dedicated DSPs. Thus, adding these codecs  to
> the Compress-Offload API makes sense.

The question is "how is the stream transported". In most implementations
for these formats, the DSP is on the receiver side and the transport
happens with an IEC61937 format - which does not require the use of the
compressed API.

> Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
> ---
>  include/uapi/sound/compress_params.h | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/include/uapi/sound/compress_params.h b/include/uapi/sound/compress_params.h
> index ddc77322d571..7a58e2026be3 100644
> --- a/include/uapi/sound/compress_params.h
> +++ b/include/uapi/sound/compress_params.h
> @@ -43,7 +43,13 @@
>  #define SND_AUDIOCODEC_BESPOKE               ((__u32) 0x0000000E)
>  #define SND_AUDIOCODEC_ALAC                  ((__u32) 0x0000000F)
>  #define SND_AUDIOCODEC_APE                   ((__u32) 0x00000010)
> -#define SND_AUDIOCODEC_MAX                   SND_AUDIOCODEC_APE
> +#define SND_AUDIOCODEC_AC3                   ((__u32) 0x00000011)
> +#define SND_AUDIOCODEC_EAC3                  ((__u32) 0x00000012)
> +#define SND_AUDIOCODEC_TRUEHD                ((__u32) 0x00000013)
> +#define SND_AUDIOCODEC_DTS                   ((__u32) 0x00000014)

IIRC there are multiple flavors of DTS, off the top of my head DTS-ES,
96, HD, Master Audio. "DTS" only doesn't even begin to describe the
possible variants.

> +/* MPEG-H 3D Audio Stream (MHAS) as defined in ISO/IEC 23008-3 */
> +#define SND_AUDIOCODEC_MHAS                  ((__u32) 0x00000015)

Doesn't this need the definition of profiles and various types of
formats - classic problem with designed-by-committee MPEG codecs.

> +#define SND_AUDIOCODEC_MAX                   SND_AUDIOCODEC_MHAS


>  /*
>   * Profile and modes are listed with bit masks. This allows for a

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ALSA: compress: Add AC3, EAC3, TrueHD, DTS, MPEG-H 3D Audio Stream (MHAS)
  2022-12-06 15:07 ` Pierre-Louis Bossart
@ 2022-12-06 15:16   ` Carlos Rafael Giani
  2022-12-06 15:34     ` Pierre-Louis Bossart
  0 siblings, 1 reply; 4+ messages in thread
From: Carlos Rafael Giani @ 2022-12-06 15:16 UTC (permalink / raw)
  To: Pierre-Louis Bossart, Vinod Koul, Jaroslav Kysela, Takashi Iwai
  Cc: alsa-devel, linux-kernel

IEC61937 is quite commonly used, yes. However, I have been working with 
a commercial system that is getting support for these formats 
implemented via compress-offload. Since these formats aren't exactly 
uncommon, I figured that adding these could be useful, especially since 
only the #defines need to be added, nothing else.

On 06.12.22 16:07, Pierre-Louis Bossart wrote:
>
> On 12/6/22 08:53, Carlos Rafael Giani wrote:
>> These audio codecs are used in sound bars and digital TVs, and benefit
>> from off-loading to a DSP. In particular, Dolby Atmos and MPEG-H 3D audio
>> spatialization is done in dedicated DSPs. Thus, adding these codecs  to
>> the Compress-Offload API makes sense.
> The question is "how is the stream transported". In most implementations
> for these formats, the DSP is on the receiver side and the transport
> happens with an IEC61937 format - which does not require the use of the
> compressed API.
>
>> Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
>> ---
>>   include/uapi/sound/compress_params.h | 8 +++++++-
>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/uapi/sound/compress_params.h b/include/uapi/sound/compress_params.h
>> index ddc77322d571..7a58e2026be3 100644
>> --- a/include/uapi/sound/compress_params.h
>> +++ b/include/uapi/sound/compress_params.h
>> @@ -43,7 +43,13 @@
>>   #define SND_AUDIOCODEC_BESPOKE               ((__u32) 0x0000000E)
>>   #define SND_AUDIOCODEC_ALAC                  ((__u32) 0x0000000F)
>>   #define SND_AUDIOCODEC_APE                   ((__u32) 0x00000010)
>> -#define SND_AUDIOCODEC_MAX                   SND_AUDIOCODEC_APE
>> +#define SND_AUDIOCODEC_AC3                   ((__u32) 0x00000011)
>> +#define SND_AUDIOCODEC_EAC3                  ((__u32) 0x00000012)
>> +#define SND_AUDIOCODEC_TRUEHD                ((__u32) 0x00000013)
>> +#define SND_AUDIOCODEC_DTS                   ((__u32) 0x00000014)
> IIRC there are multiple flavors of DTS, off the top of my head DTS-ES,
> 96, HD, Master Audio. "DTS" only doesn't even begin to describe the
> possible variants.
>
>> +/* MPEG-H 3D Audio Stream (MHAS) as defined in ISO/IEC 23008-3 */
>> +#define SND_AUDIOCODEC_MHAS                  ((__u32) 0x00000015)
> Doesn't this need the definition of profiles and various types of
> formats - classic problem with designed-by-committee MPEG codecs.
>
>> +#define SND_AUDIOCODEC_MAX                   SND_AUDIOCODEC_MHAS
>
>>   /*
>>    * Profile and modes are listed with bit masks. This allows for a

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ALSA: compress: Add AC3, EAC3, TrueHD, DTS, MPEG-H 3D Audio Stream (MHAS)
  2022-12-06 15:16   ` Carlos Rafael Giani
@ 2022-12-06 15:34     ` Pierre-Louis Bossart
  0 siblings, 0 replies; 4+ messages in thread
From: Pierre-Louis Bossart @ 2022-12-06 15:34 UTC (permalink / raw)
  To: Carlos Rafael Giani, Vinod Koul, Jaroslav Kysela, Takashi Iwai
  Cc: alsa-devel, linux-kernel



On 12/6/22 09:16, Carlos Rafael Giani wrote:
> IEC61937 is quite commonly used, yes. However, I have been working with
> a commercial system that is getting support for these formats
> implemented via compress-offload. Since these formats aren't exactly
> uncommon, I figured that adding these could be useful, especially since
> only the #defines need to be added, nothing else.

please don't top-post on mailing lists.

Nothing else? That sounds to good to be true. Specifically for
spatialization, there's got to be some sort of interface to control
where the objects are located, either in reference to the listener
position or the listening room setup.

The compressed API was developed back in the early 2010s for elementary
streams, it's not been extended since and IMHO it's far too limited to
support Atmos and newer systems optimally.

> On 06.12.22 16:07, Pierre-Louis Bossart wrote:
>>
>> On 12/6/22 08:53, Carlos Rafael Giani wrote:
>>> These audio codecs are used in sound bars and digital TVs, and benefit
>>> from off-loading to a DSP. In particular, Dolby Atmos and MPEG-H 3D
>>> audio
>>> spatialization is done in dedicated DSPs. Thus, adding these codecs  to
>>> the Compress-Offload API makes sense.
>> The question is "how is the stream transported". In most implementations
>> for these formats, the DSP is on the receiver side and the transport
>> happens with an IEC61937 format - which does not require the use of the
>> compressed API.
>>
>>> Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
>>> ---
>>>   include/uapi/sound/compress_params.h | 8 +++++++-
>>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/include/uapi/sound/compress_params.h
>>> b/include/uapi/sound/compress_params.h
>>> index ddc77322d571..7a58e2026be3 100644
>>> --- a/include/uapi/sound/compress_params.h
>>> +++ b/include/uapi/sound/compress_params.h
>>> @@ -43,7 +43,13 @@
>>>   #define SND_AUDIOCODEC_BESPOKE               ((__u32) 0x0000000E)
>>>   #define SND_AUDIOCODEC_ALAC                  ((__u32) 0x0000000F)
>>>   #define SND_AUDIOCODEC_APE                   ((__u32) 0x00000010)
>>> -#define SND_AUDIOCODEC_MAX                   SND_AUDIOCODEC_APE
>>> +#define SND_AUDIOCODEC_AC3                   ((__u32) 0x00000011)
>>> +#define SND_AUDIOCODEC_EAC3                  ((__u32) 0x00000012)
>>> +#define SND_AUDIOCODEC_TRUEHD                ((__u32) 0x00000013)
>>> +#define SND_AUDIOCODEC_DTS                   ((__u32) 0x00000014)
>> IIRC there are multiple flavors of DTS, off the top of my head DTS-ES,
>> 96, HD, Master Audio. "DTS" only doesn't even begin to describe the
>> possible variants.

And IIRC2 there is some level of backwards compatibility between
flavors, but the decoder may or may not be able to generate the number
of channels and formats supported in the initial stream. That's a
problem if you need to configure audio codecs or interfaces and the DSP
doesn't tell you what it decoded or upmixed.

>>> +/* MPEG-H 3D Audio Stream (MHAS) as defined in ISO/IEC 23008-3 */
>>> +#define SND_AUDIOCODEC_MHAS                  ((__u32) 0x00000015)
>> Doesn't this need the definition of profiles and various types of
>> formats - classic problem with designed-by-committee MPEG codecs.
>>
>>> +#define SND_AUDIOCODEC_MAX                   SND_AUDIOCODEC_MHAS
>>
>>>   /*
>>>    * Profile and modes are listed with bit masks. This allows for a

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-06 15:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-06 14:53 [PATCH] ALSA: compress: Add AC3, EAC3, TrueHD, DTS, MPEG-H 3D Audio Stream (MHAS) Carlos Rafael Giani
2022-12-06 15:07 ` Pierre-Louis Bossart
2022-12-06 15:16   ` Carlos Rafael Giani
2022-12-06 15:34     ` Pierre-Louis Bossart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.