[alsa-devel] [PATCH v3 1/1] ALSA: usb-audio: Add custom mixer status quirks for RME CC devices

Takashi Iwai tiwai at suse.de
Fri Oct 5 09:21:11 CEST 2018


On Fri, 05 Oct 2018 09:01:30 +0200,
Jussi Laako wrote:
> 
> Adds several vendor specific mixer quirks for RME's Class Compliant
> USB devices. These provide extra status information from the device
> otherwise not available.
> 
> These include AES/SPDIF rate and status information, current system
> sampling rate and measured frequency. This information is especially
> useful in cases where device's clock is slaved to external clock
> source.
> 
> Signed-off-by: Jussi Laako <jussi at sonarnerd.net>

Thanks, this one looks better now.
> +static const u32 snd_rme_rate_table[] = {
> +	32000, 44100, 48000, 50000,
> +	64000, 88200, 96000, 100000,
> +	128000, 176400, 192000, 200000,
> +	256000,	352800, 384000, 400000,
> +	512000, 705600, 768000, 800000
> +};
> +#define SND_RME_RATE_IDX_AES_SPDIF_NUM		12

Maybe better to explain this 12 corresponds up to 20000Hz in the table
above.

> +static int snd_rme_rate_get(struct snd_kcontrol *kcontrol,
> +			    struct snd_ctl_elem_value *ucontrol)
> +{
> +	u32 status1;
> +	u32 rate = 0;
> +	int idx;
> +	int err;
> +
> +	err = snd_rme_get_status1(kcontrol, &status1);
> +	if (err < 0)
> +		return err;
> +	switch (kcontrol->private_value)
> +	{

This brace should be in switch() line.  Always better to run
checkpatch.pl before submission :)


thanks,

Takashi


More information about the Alsa-devel mailing list