aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/pcm.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/pcm.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/pcm.c')
-rw-r--r--sound/usb/pcm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index f49756c1b837..cff3a3c465d7 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -237,6 +237,7 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt)
237 subs->datainterval = fmt->datainterval; 237 subs->datainterval = fmt->datainterval;
238 subs->syncpipe = subs->syncinterval = 0; 238 subs->syncpipe = subs->syncinterval = 0;
239 subs->maxpacksize = fmt->maxpacksize; 239 subs->maxpacksize = fmt->maxpacksize;
240 subs->syncmaxsize = 0;
240 subs->fill_max = 0; 241 subs->fill_max = 0;
241 242
242 /* we need a sync pipe in async OUT or adaptive IN mode */ 243 /* we need a sync pipe in async OUT or adaptive IN mode */
@@ -283,6 +284,7 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt)
283 subs->syncinterval = get_endpoint(alts, 1)->bInterval - 1; 284 subs->syncinterval = get_endpoint(alts, 1)->bInterval - 1;
284 else 285 else
285 subs->syncinterval = 3; 286 subs->syncinterval = 3;
287 subs->syncmaxsize = le16_to_cpu(get_endpoint(alts, 1)->wMaxPacketSize);
286 } 288 }
287 289
288 /* always fill max packet size */ 290 /* always fill max packet size */