aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/endpoint.c
diff options
context:
space:
mode:
authorCalvin Owens <jcalvinowens@gmail.com>2013-04-12 22:33:59 -0500
committerBen Hutchings <ben@decadent.org.uk>2013-05-13 15:02:17 +0100
commit40de8047654debace75db0f04aebbbaace5bdd26 (patch)
tree41fc40f3d4395812bfca5aca490ecc5e1228a991 /sound/usb/endpoint.c
parent1b136c71e8858b068b7813fed270eb4668a217ca (diff)
downloadkernel_samsung_smdk4412-40de8047654debace75db0f04aebbbaace5bdd26.zip
kernel_samsung_smdk4412-40de8047654debace75db0f04aebbbaace5bdd26.tar.gz
kernel_samsung_smdk4412-40de8047654debace75db0f04aebbbaace5bdd26.tar.bz2
ALSA: usb: Add quirk for 192KHz recording on E-Mu devices
commit 1539d4f82ad534431cc67935e8e442ccf107d17d upstream. When recording at 176.2KHz or 192Khz, the device adds a 32-bit length header to the capture packets, which obviously needs to be ignored for recording to work properly. Userspace expected: L0 L1 L2 R0 R1 R2 ...but actually got: R2 L0 L1 L2 R0 R1 Also, the last byte of the length header being interpreted as L0 of the first sample caused spikes every 0.5ms, resulting in a loud 16KHz tone (about the highest 'B' on a piano) being present throughout captures. Tested at all sample rates on an E-Mu 0404USB, and tested for regressions on a generic USB headset. Signed-off-by: Calvin Owens <jcalvinowens@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> [bwh: Backported to 3.2: adjust filenames, context] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'sound/usb/endpoint.c')
-rw-r--r--sound/usb/endpoint.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index 9ab2b3e..5ebe8c4 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -458,7 +458,7 @@ static int retire_capture_urb(struct snd_usb_substream *subs,
stride = runtime->frame_bits >> 3;
for (i = 0; i < urb->number_of_packets; i++) {
- cp = (unsigned char *)urb->transfer_buffer + urb->iso_frame_desc[i].offset;
+ cp = (unsigned char *)urb->transfer_buffer + urb->iso_frame_desc[i].offset + subs->pkt_offset_adj;
if (urb->iso_frame_desc[i].status && printk_ratelimit()) {
snd_printdd("frame %d active: %d\n", i, urb->iso_frame_desc[i].status);
// continue;
@@ -898,6 +898,7 @@ void snd_usb_init_substream(struct snd_usb_stream *as,
subs->speed = snd_usb_get_speed(subs->dev);
if (subs->speed >= USB_SPEED_HIGH)
subs->ops.prepare_sync = prepare_capture_sync_urb_hs;
+ subs->pkt_offset_adj = 0;
snd_usb_set_pcm_ops(as->pcm, stream);