diff options
author | Andrej Krutak <dev@andree.sk> | 2016-09-18 20:59:24 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2016-09-19 23:00:16 +0200 |
commit | 97d78acfb870a67339957e9c4d36dc03242df315 (patch) | |
tree | e50c02a117e5a8e9f1ddf6272be6e53989f5f789 /sound/usb/line6/capture.c | |
parent | 7a0f55aeeb8f1fa32a119d34ddfefc6100936692 (diff) | |
download | linux-97d78acfb870a67339957e9c4d36dc03242df315.tar.bz2 |
ALSA: line6: Allow different channel numbers for in/out
Changes bytes_per_frame to bytes_per_channel.
Signed-off-by: Andrej Krutak <dev@andree.sk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/line6/capture.c')
-rw-r--r-- | sound/usb/line6/capture.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/usb/line6/capture.c b/sound/usb/line6/capture.c index 8f9647853acd..0228cb4bdfcf 100644 --- a/sound/usb/line6/capture.c +++ b/sound/usb/line6/capture.c @@ -90,7 +90,9 @@ void line6_capture_copy(struct snd_line6_pcm *line6pcm, char *fbuf, int fsize) struct snd_pcm_substream *substream = get_substream(line6pcm, SNDRV_PCM_STREAM_CAPTURE); struct snd_pcm_runtime *runtime = substream->runtime; - const int bytes_per_frame = line6pcm->properties->bytes_per_frame; + const int bytes_per_frame = + line6pcm->properties->bytes_per_channel * + line6pcm->properties->capture_hw.channels_max; int frames = fsize / bytes_per_frame; if (runtime == NULL) @@ -191,7 +193,9 @@ static void audio_in_callback(struct urb *urb) */ line6pcm->prev_fbuf = fbuf; - line6pcm->prev_fsize = fsize; + line6pcm->prev_fsize = fsize / + (line6pcm->properties->bytes_per_channel * + line6pcm->properties->capture_hw.channels_max); if (!test_bit(LINE6_STREAM_IMPULSE, &line6pcm->in.running) && test_bit(LINE6_STREAM_PCM, &line6pcm->in.running) && |