Commit 41285a98 authored by Adrian Knoth's avatar Adrian Knoth Committed by Takashi Iwai

ALSA: hdspm - Allow DDS/Varispeed to be set from userspace

The DDS value is the actual physical sample rate. We set it indirectly
when selecting 44100, 48000 and so on via snd_hdspm_hw_params or
hdspm_set_clock_source.

This commit now allows the DDS value to be altered at runtime, thus
speeding up or slowing down the physical sample rate. This is required
for MADI's varispeed that allows for ±12.5% speed adjustment from the
"selected" rate (32kHz, 44100kHz, 48kHz and so on).
Signed-off-by: default avatarAdrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 84f98fdf
...@@ -2003,8 +2003,10 @@ static int hdspm_get_system_sample_rate(struct hdspm *hdspm) ...@@ -2003,8 +2003,10 @@ static int hdspm_get_system_sample_rate(struct hdspm *hdspm)
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
.name = xname, \ .name = xname, \
.index = xindex, \ .index = xindex, \
.access = SNDRV_CTL_ELEM_ACCESS_READ, \ .access = SNDRV_CTL_ELEM_ACCESS_READWRITE |\
SNDRV_CTL_ELEM_ACCESS_VOLATILE, \
.info = snd_hdspm_info_system_sample_rate, \ .info = snd_hdspm_info_system_sample_rate, \
.put = snd_hdspm_put_system_sample_rate, \
.get = snd_hdspm_get_system_sample_rate \ .get = snd_hdspm_get_system_sample_rate \
} }
...@@ -2030,6 +2032,16 @@ static int snd_hdspm_get_system_sample_rate(struct snd_kcontrol *kcontrol, ...@@ -2030,6 +2032,16 @@ static int snd_hdspm_get_system_sample_rate(struct snd_kcontrol *kcontrol,
return 0; return 0;
} }
static int snd_hdspm_put_system_sample_rate(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *
ucontrol)
{
struct hdspm *hdspm = snd_kcontrol_chip(kcontrol);
hdspm_set_dds_value(hdspm, ucontrol->value.enumerated.item[0]);
return 0;
}
/** /**
* Returns the WordClock sample rate class for the given card. * Returns the WordClock sample rate class for the given card.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment