ALSA: line6: Skip volume manipulation during silence copying
authorTakashi Iwai <tiwai@suse.de>
Fri, 23 Jan 2015 15:58:30 +0000 (16:58 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 28 Jan 2015 06:21:52 +0000 (07:21 +0100)
A minor optimization; while pausing, the driver just copies the zero
that doesn't need any volume changes.

Tested-by: Chris Rorvick <chris@rorvick.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/line6/playback.c

index cbcd97f5d629c99f46af45ffc3a11cb9fdeef62a..3762a98026aaa987f44817fd324079e953c2fb00 100644 (file)
@@ -234,13 +234,14 @@ static int submit_audio_out_urb(struct snd_line6_pcm *line6pcm)
                line6pcm->out.pos += urb_frames;
                if (line6pcm->out.pos >= runtime->buffer_size)
                        line6pcm->out.pos -= runtime->buffer_size;
+
+               change_volume(urb_out, line6pcm->volume_playback,
+                             bytes_per_frame);
        } else {
                memset(urb_out->transfer_buffer, 0,
                       urb_out->transfer_buffer_length);
        }
 
-       change_volume(urb_out, line6pcm->volume_playback, bytes_per_frame);
-
        if (line6pcm->prev_fbuf != NULL) {
                if (line6pcm->flags & LINE6_BITS_PCM_IMPULSE) {
                        create_impulse_test_signal(line6pcm, urb_out,