• Daniel Mack's avatar
    ALSA: snd-usb: fix calls to next_packet_size · 245baf98
    Daniel Mack authored
    In order to support devices with implicit feedback streaming models,
    packet sizes are now stored with each individual urb, and the PCM
    handling code which fills the buffers purely relies on the size fields
    However, calling snd_usb_audio_next_packet_size() for all possible
    packets in an URB at once, prior to letting the PCM code do its job
    does in fact not lead to the same behaviour than what the old code did:
    The PCM code will break its loop once a period boundary is reached,
    consequently using up less packets that it really could.
    As snd_usb_audio_next_packet_size() implements a feedback mechanism to
    the endpoints phase accumulator, the number of calls to that function
    matters, and when called too often, the data rate runs out of bounds.
    Fix this by making the next_packet function public, and call it from the
    PCM code as before if the packet data sizes are not defined.
    Signed-off-by: default avatarDaniel Mack <zonque@gmail.com>
    Cc: stable@kernel.org [v3.5+]
    Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>