Skip to content

Commit

Permalink
staging: line6: fix playback urb transfer buffer calculation
Browse files Browse the repository at this point in the history
The playback urb transfer buffer calculation does not factor in
LINE6_ISO_PACKETS.  Buffer memory is organized like this in the driver:

  Buffer 0                 Buffer 1                 ...
  [Packet 0, Packet 1, ...][Packet 0, Packet 1, ...][Packet 0, ...]

However, we're lucky that LINE6_ISO_PACKETS is currently defined as 1 so
this patch does not change any behavior.  It's still worth including
this fix in case the LINE6_ISO_PACKETS value is changed in the future.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Markus Grabner <grabner@icg.tugraz.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Stefan Hajnoczi authored and Greg Kroah-Hartman committed Dec 10, 2011
1 parent 60c01a9 commit 2f637ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/line6/playback.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ static int submit_audio_out_urb(struct snd_line6_pcm *line6pcm)
urb_frames = urb_size / bytes_per_frame;
urb_out->transfer_buffer =
line6pcm->buffer_out +
line6pcm->max_packet_size * line6pcm->index_out;
LINE6_ISO_PACKETS * line6pcm->max_packet_size * line6pcm->index_out;
urb_out->transfer_buffer_length = urb_size;
urb_out->context = line6pcm;

Expand Down

0 comments on commit 2f637ee

Please sign in to comment.