Re: [PATCH 01/13] ALSA: pcm: add more sample rate definitions

From: Péter Ujfalusi
Date: Wed Sep 11 2024 - 06:33:08 EST


On 11/09/2024 12:21, Takashi Iwai wrote:
>> Wondering if this is backwards compatible with the alsa-lib definitions,
>> specifically the topology parts which did unfortunately have a list of
>> rates that will map to a different index now:
>>
>>
>> typedef enum _snd_pcm_rates {
>> SND_PCM_RATE_UNKNOWN = -1,
>> SND_PCM_RATE_5512 = 0,
>> SND_PCM_RATE_8000,
>> SND_PCM_RATE_11025,
>> SND_PCM_RATE_16000,
>> SND_PCM_RATE_22050,
>> SND_PCM_RATE_32000,
>> SND_PCM_RATE_44100,
>> SND_PCM_RATE_48000,
>> SND_PCM_RATE_64000,
>> SND_PCM_RATE_88200,
>> SND_PCM_RATE_96000,
>> SND_PCM_RATE_176400,
>> SND_PCM_RATE_192000,
>> SND_PCM_RATE_CONTINUOUS = 30,
>> SND_PCM_RATE_KNOT = 31,
>> SND_PCM_RATE_LAST = SND_PCM_RATE_KNOT,
>> } snd_pcm_rates_t;
>
> As far as I understand correctly, those rate bits used for topology
> are independent from the bits used for PCM core, although it used to
> be the same. Maybe better to rename (such as SND_TPLG_RATE_*) so that
> it's clearer only for topology stuff.

Even if we rename these in alsa-lib we will need translation from
SND_TPLG_RATE_ to SND_PCM_RATE_ in kernel likely?

The topology files are out there and this is an ABI...

> But it'd be better if anyone can double-check.

Since the kernel just copies the rates bitfield, any rate above 11025
will be misaligned and result broken setup.

>
>
> thanks,
>
> Takashi

--
Péter