aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorCalvin Owens2013-04-12 22:33:59 -0500
committerGreg Kroah-Hartman2013-05-07 22:08:21 -0500
commita0dd5139a83d53d239eb896e159058ff859c1c8c (patch)
treef2965824b4e61a845bbd49f8049b88b46164e97d /sound
parent269f78b5ebfce19ff5f084061fe4883dea40d200 (diff)
downloadkernel-omap-a0dd5139a83d53d239eb896e159058ff859c1c8c.tar.gz
kernel-omap-a0dd5139a83d53d239eb896e159058ff859c1c8c.tar.xz
kernel-omap-a0dd5139a83d53d239eb896e159058ff859c1c8c.zip
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/usb/card.h1
-rw-r--r--sound/usb/pcm.c2
-rw-r--r--sound/usb/quirks.c1
-rw-r--r--sound/usb/stream.c1
4 files changed, 4 insertions, 1 deletions
diff --git a/sound/usb/card.h b/sound/usb/card.h
index 8a751b4887ea..d32ea411545a 100644
--- a/sound/usb/card.h
+++ b/sound/usb/card.h
@@ -116,6 +116,7 @@ struct snd_usb_substream {
116 unsigned int altset_idx; /* USB data format: index of alternate setting */ 116 unsigned int altset_idx; /* USB data format: index of alternate setting */
117 unsigned int txfr_quirk:1; /* allow sub-frame alignment */ 117 unsigned int txfr_quirk:1; /* allow sub-frame alignment */
118 unsigned int fmt_type; /* USB audio format type (1-3) */ 118 unsigned int fmt_type; /* USB audio format type (1-3) */
119 unsigned int pkt_offset_adj; /* Bytes to drop from beginning of packets (for non-compliant devices) */
119 120
120 unsigned int running: 1; /* running status */ 121 unsigned int running: 1; /* running status */
121 122
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index d82e378d37cb..bcc50ed275a4 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -1161,7 +1161,7 @@ static void retire_capture_urb(struct snd_usb_substream *subs,
1161 stride = runtime->frame_bits >> 3; 1161 stride = runtime->frame_bits >> 3;
1162 1162
1163 for (i = 0; i < urb->number_of_packets; i++) { 1163 for (i = 0; i < urb->number_of_packets; i++) {
1164 cp = (unsigned char *)urb->transfer_buffer + urb->iso_frame_desc[i].offset; 1164 cp = (unsigned char *)urb->transfer_buffer + urb->iso_frame_desc[i].offset + subs->pkt_offset_adj;
1165 if (urb->iso_frame_desc[i].status && printk_ratelimit()) { 1165 if (urb->iso_frame_desc[i].status && printk_ratelimit()) {
1166 snd_printdd(KERN_ERR "frame %d active: %d\n", i, urb->iso_frame_desc[i].status); 1166 snd_printdd(KERN_ERR "frame %d active: %d\n", i, urb->iso_frame_desc[i].status);
1167 // continue; 1167 // continue;
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index b9ca776705af..f581c3e226fb 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -837,6 +837,7 @@ static void set_format_emu_quirk(struct snd_usb_substream *subs,
837 break; 837 break;
838 } 838 }
839 snd_emuusb_set_samplerate(subs->stream->chip, emu_samplerate_id); 839 snd_emuusb_set_samplerate(subs->stream->chip, emu_samplerate_id);
840 subs->pkt_offset_adj = (emu_samplerate_id >= EMU_QUIRK_SR_176400HZ) ? 4 : 0;
840} 841}
841 842
842void snd_usb_set_format_quirk(struct snd_usb_substream *subs, 843void snd_usb_set_format_quirk(struct snd_usb_substream *subs,
diff --git a/sound/usb/stream.c b/sound/usb/stream.c
index bab6dbc12278..cfc4d4eaf42b 100644
--- a/sound/usb/stream.c
+++ b/sound/usb/stream.c
@@ -94,6 +94,7 @@ static void snd_usb_init_substream(struct snd_usb_stream *as,
94 subs->dev = as->chip->dev; 94 subs->dev = as->chip->dev;
95 subs->txfr_quirk = as->chip->txfr_quirk; 95 subs->txfr_quirk = as->chip->txfr_quirk;
96 subs->speed = snd_usb_get_speed(subs->dev); 96 subs->speed = snd_usb_get_speed(subs->dev);
97 subs->pkt_offset_adj = 0;
97 98
98 snd_usb_set_pcm_ops(as->pcm, stream); 99 snd_usb_set_pcm_ops(as->pcm, stream);
99 100