aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/proc.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2010-10-26 11:14:41 -0400
committerTakashi Iwai <tiwai@suse.de>2010-10-27 03:17:41 -0400
commit89e1e66d6be8a520cdcd26043cda2cc870a34015 (patch)
treec9056471d3edf7eea0c665f0aaea10fbdda4e228 /sound/usb/proc.c
parent0d040df9984c8fcb6a777a8f6d5dc513eaefd2de (diff)
ALSA: usb-audio: automatically detect feedback format
There are two USB Audio Class specifications (v1 and v2), but neither of them clearly defines the feedback format for high-speed UAC v1 devices. Add to this whatever the Creative and M-Audio firmware writers have been smoking, and it becomes impossible to predict the exact feedback format used by a particular device. Therefore, automatically detect the feedback format by looking at the magnitude of the first received feedback value. Also, this allows us to get rid of some special cases for E-Mu devices. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/proc.c')
-rw-r--r--sound/usb/proc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/usb/proc.c b/sound/usb/proc.c
index 3c650ab3c91d..961c9a250686 100644
--- a/sound/usb/proc.c
+++ b/sound/usb/proc.c
@@ -132,6 +132,11 @@ static void proc_dump_substream_status(struct snd_usb_substream *subs, struct sn
132 ? get_full_speed_hz(subs->freqm) 132 ? get_full_speed_hz(subs->freqm)
133 : get_high_speed_hz(subs->freqm), 133 : get_high_speed_hz(subs->freqm),
134 subs->freqm >> 16, subs->freqm & 0xffff); 134 subs->freqm >> 16, subs->freqm & 0xffff);
135 if (subs->freqshift != INT_MIN)
136 snd_iprintf(buffer, " Feedback Format = %d.%d\n",
137 (subs->syncmaxsize > 3 ? 32 : 24)
138 - (16 - subs->freqshift),
139 16 - subs->freqshift);
135 } else { 140 } else {
136 snd_iprintf(buffer, " Status: Stop\n"); 141 snd_iprintf(buffer, " Status: Stop\n");
137 } 142 }