Re: [PATCH v4 5/5] usb: gadget: f_uac2: send reasonably sized packets

2014-08-27 Thread Daniel Mack
On 08/27/2014 06:08 AM, Jassi Brar wrote: On Wed, Aug 27, 2014 at 3:23 AM, Daniel Mack zon...@gmail.com wrote: + uac2-p_interval = (1 (ep_desc-bInterval - 1)) * factor; + req_len = rate / uac2-p_interval; + if (opts-p_srate % uac2-p_interval) +

Re: [PATCH v4 5/5] usb: gadget: f_uac2: send reasonably sized packets

2014-08-27 Thread Jassi Brar
On Wed, Aug 27, 2014 at 12:20 PM, Daniel Mack dan...@zonque.org wrote: On 08/27/2014 06:08 AM, Jassi Brar wrote: On Wed, Aug 27, 2014 at 3:23 AM, Daniel Mack zon...@gmail.com wrote: + uac2-p_interval = (1 (ep_desc-bInterval - 1)) * factor; + req_len = rate /

Re: [PATCH v4 5/5] usb: gadget: f_uac2: send reasonably sized packets

2014-08-27 Thread Daniel Mack
On 08/27/2014 09:07 AM, Jassi Brar wrote: On Wed, Aug 27, 2014 at 12:20 PM, Daniel Mack dan...@zonque.org wrote: Hmm? The first USB_XFERS packets will only contain zeros, and we're only preparing those here. For every successive packet, the length is recalculated and the audio material is

Re: [PATCH v4 5/5] usb: gadget: f_uac2: send reasonably sized packets

2014-08-27 Thread Daniel Mack
On 08/27/2014 09:15 AM, Daniel Mack wrote: On 08/27/2014 09:07 AM, Jassi Brar wrote: On Wed, Aug 27, 2014 at 12:20 PM, Daniel Mack dan...@zonque.org wrote: Hmm? The first USB_XFERS packets will only contain zeros, and we're only preparing those here. For every successive packet, the length

Re: [PATCH v4 5/5] usb: gadget: f_uac2: send reasonably sized packets

2014-08-27 Thread Jassi Brar
On Wed, Aug 27, 2014 at 12:45 PM, Daniel Mack dan...@zonque.org wrote: On 08/27/2014 09:07 AM, Jassi Brar wrote: On Wed, Aug 27, 2014 at 12:20 PM, Daniel Mack dan...@zonque.org wrote: Hmm? The first USB_XFERS packets will only contain zeros, and we're only preparing those here. For every

Re: [PATCH v4 5/5] usb: gadget: f_uac2: send reasonably sized packets

2014-08-27 Thread Jassi Brar
On Wed, Aug 27, 2014 at 3:23 AM, Daniel Mack zon...@gmail.com wrote: @@ -1099,11 +1139,31 @@ afunc_set_alt(struct usb_function *fn, unsigned intf, unsigned alt) prm = uac2-c_prm; config_ep_by_speed(gadget, fn, ep); agdev-as_out_alt = alt; +

Re: [PATCH v4 5/5] usb: gadget: f_uac2: send reasonably sized packets

2014-08-27 Thread Daniel Mack
On 08/27/2014 09:28 AM, Jassi Brar wrote: On Wed, Aug 27, 2014 at 12:45 PM, Daniel Mack dan...@zonque.org wrote: On 08/27/2014 09:07 AM, Jassi Brar wrote: On Wed, Aug 27, 2014 at 12:20 PM, Daniel Mack dan...@zonque.org wrote: Hmm? The first USB_XFERS packets will only contain zeros, and we're

Re: [PATCH v4 5/5] usb: gadget: f_uac2: send reasonably sized packets

2014-08-27 Thread Daniel Mack
On 08/27/2014 09:35 AM, Jassi Brar wrote: On Wed, Aug 27, 2014 at 3:23 AM, Daniel Mack zon...@gmail.com wrote: + uac2-p_residue = 0; } else { dev_err(dev, %s:%d Error!\n, __func__, __LINE__); return -EINVAL; @@ -1128,7 +1188,7 @@

[PATCH v4 5/5] usb: gadget: f_uac2: send reasonably sized packets

2014-08-26 Thread Daniel Mack
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

Re: [PATCH v4 5/5] usb: gadget: f_uac2: send reasonably sized packets

2014-08-26 Thread Jassi Brar
On Wed, Aug 27, 2014 at 3:23 AM, Daniel Mack zon...@gmail.com wrote: 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