Skip to content

Commit

Permalink
ALSA: line6: Skip volume manipulation during silence copying
Browse files Browse the repository at this point in the history
A minor optimization; while pausing, the driver just copies the zero
that doesn't need any volume changes.

Tested-by: Chris Rorvick <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Jan 28, 2015
1 parent c849153 commit 62a109d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sound/usb/line6/playback.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 62a109d

Please sign in to comment.