linux/drivers/usb/gadget/function
Daniel Mack 9bb87f1689 usb: gadget: f_uac2: send reasonably sized packets
The UAC2 function driver currently responds to all packets at all times
with wMaxPacketSize packets. That results in way too fast audio
playback as the function driver (which is in fact supposed to define
the audio stream pace) delivers as fast as it can.

Fix this by sizing each packet correctly with the following steps:

 a) Set the packet's size by dividing the nominal data rate by the
    playback endpoint's interval.

 b) If there is a residual value from the calculation in a), add
    it to a accumulator to keep track of it across packets.

 c) If the accumulator has gathered at least the number of bytes
    that are needed for one sample frame, increase the packet size.

This way, the packet size calculation will get rid of any kind of
imprecision that would otherwise occur with a simple division over
time.

Some of the variables that are needed while processing each packet
are pre-computed for performance reasons.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2014-09-02 09:28:00 -05:00
..
Makefile usb: gadget: use $(srctree) instead of $(PWD) for includes 2014-08-29 15:53:46 -05:00
f_acm.c usb: gadget: serial: replace {V,}DBG macro with dev_{v,}dbg 2014-08-27 14:13:17 -05:00
f_ecm.c
f_eem.c
f_fs.c
f_hid.c
f_loopback.c usb: gadget: zero: Add support for interrupt EP 2014-08-27 14:13:18 -05:00
f_mass_storage.c usb: gadget: f_mass_storage: simplify start_transfer slightly 2014-09-02 09:16:47 -05:00
f_mass_storage.h
f_midi.c
f_ncm.c
f_obex.c usb: gadget: serial: replace {V,}DBG macro with dev_{v,}dbg 2014-08-27 14:13:17 -05:00
f_phonet.c
f_rndis.c
f_serial.c usb: gadget: serial: replace {V,}DBG macro with dev_{v,}dbg 2014-08-27 14:13:17 -05:00
f_sourcesink.c usb: gadget: zero: Add support for interrupt EP 2014-08-27 14:13:18 -05:00
f_subset.c
f_uac1.c usb: gadget: f_uac1: add configfs support 2014-08-20 14:05:21 -05:00
f_uac2.c usb: gadget: f_uac2: send reasonably sized packets 2014-09-02 09:28:00 -05:00
f_uvc.c usb: gadget: f_uvc: fix potential memory leak 2014-08-21 10:03:41 -05:00
f_uvc.h
g_zero.h usb: gadget: zero: Add support for interrupt EP 2014-08-27 14:13:18 -05:00
ndis.h
rndis.c
rndis.h
storage_common.c
storage_common.h
u_ecm.h
u_eem.h
u_ether.c
u_ether.h
u_ether_configfs.h
u_fs.h
u_gether.h
u_ncm.h
u_phonet.h
u_rndis.h
u_serial.c usb: gadget: serial: remove PREFIX macro 2014-08-27 14:13:18 -05:00
u_serial.h
u_uac1.c usb: gadget: f_uac1: remove compatibility layer 2014-08-20 14:05:05 -05:00
u_uac1.h usb: gadget: f_uac1: add configfs support 2014-08-20 14:05:21 -05:00
u_uac2.h usb: gadget: f_uac2: add configfs support 2014-08-20 14:04:42 -05:00
uvc.h usb: gadget: uvc: remove DRIVER_VERSION{,_NUMBER} 2014-08-21 10:03:54 -05:00
uvc_queue.c usb: gadget: uvc: Add support for DMABUF importing 2014-08-21 10:03:32 -05:00
uvc_queue.h
uvc_v4l2.c usb: gadget: uvc: remove DRIVER_VERSION{,_NUMBER} 2014-08-21 10:03:54 -05:00
uvc_video.c usb: gadget: uvc: Change KERN_INFO to KERN_DEBUG on request shutdown 2014-08-21 10:03:20 -05:00