diff options
-rw-r--r-- | sound/usb/card.h | 1 | ||||
-rw-r--r-- | sound/usb/endpoint.c | 3 | ||||
-rw-r--r-- | sound/usb/quirks.c | 1 |
3 files changed, 4 insertions, 1 deletions
diff --git a/sound/usb/card.h b/sound/usb/card.h index 7932b2ac0de..0a7ca6c44fe 100644 --- a/sound/usb/card.h +++ b/sound/usb/card.h @@ -74,6 +74,7 @@ struct snd_usb_substream { unsigned int fill_max: 1; /* fill max packet size always */ unsigned int txfr_quirk:1; /* allow sub-frame alignment */ unsigned int fmt_type; /* USB audio format type (1-3) */ + unsigned int pkt_offset_adj; /* Bytes to drop from beginning of packets (for non-compliant devices) */ unsigned int running: 1; /* running status */ diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 9ab2b3e2222..5ebe8c4403e 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); diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index b7fa802f5ed..9c82f8b67a6 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -748,6 +748,7 @@ static void set_format_emu_quirk(struct snd_usb_substream *subs, break; } snd_emuusb_set_samplerate(subs->stream->chip, emu_samplerate_id); + subs->pkt_offset_adj = (emu_samplerate_id >= EMU_QUIRK_SR_176400HZ) ? 4 : 0; } void snd_usb_set_format_quirk(struct snd_usb_substream *subs, |