Re: [PATCH 6/9] ALSA: usb: caiaq: use usb_fill_int_urb()

2018-06-22 Thread Daniel Mack
On Thursday, June 21, 2018 11:16 PM, Sebastian Andrzej Siewior wrote: On 2018-06-21 22:19:32 [+0200], Daniel Mack wrote: On Tuesday, June 19, 2018 11:55 PM, Sebastian Andrzej Siewior wrote: Using usb_fill_int_urb() helps to find code which initializes an URB. A grep for members of the struct

Re: [PATCH 6/9] ALSA: usb: caiaq: use usb_fill_int_urb()

2018-06-21 Thread Daniel Mack
On Tuesday, June 19, 2018 11:55 PM, Sebastian Andrzej Siewior wrote: Using usb_fill_int_urb() helps to find code which initializes an URB. A grep for members of the struct (like ->complete) reveal lots of other things, too. Acked-by: Daniel Mack Cc: Jaroslav Kysela Cc: Takashi Iwai Sig

Re: [PATCH 5/9] ALSA: usb: caiaq: audio: use irqsave() in USB's complete callback

2018-06-21 Thread Daniel Mack
for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Acked-by: Daniel Mack Cc: Jaroslav Kysela Cc: Takashi Iwai Signed-off-by: John

Re: [PATCH v4 1/1] usb: gadget: f_uac2: finalize wMaxPacketSize according to bandwidth

2015-07-28 Thread Daniel Mack
On 07/28/2015 03:38 AM, Peter Chen wrote: +static void set_ep_max_packet_size (struct f_uac2_opts *uac2_opts, + struct usb_endpoint_descriptor *ep_desc, unsigned int factor) +{ + int chmask; + int srate; + int ssize; + u16 max_packet_size; + + if (ep_desc ==

Re: [PATCH v4 1/1] usb: gadget: f_uac2: finalize wMaxPacketSize according to bandwidth

2015-07-28 Thread Daniel Mack
On 07/28/2015 11:30 AM, Daniel Mack wrote: On 07/28/2015 03:38 AM, Peter Chen wrote: +static void set_ep_max_packet_size (struct f_uac2_opts *uac2_opts, +struct usb_endpoint_descriptor *ep_desc, unsigned int factor) +{ +int chmask; +int srate; +int ssize; +u16

Re: [PATCH v5 1/1] usb: gadget: f_uac2: finalize wMaxPacketSize according to bandwidth

2015-07-28 Thread Daniel Mack
gadgets work together [1] at FS connection. [1]http://www.spinics.net/lists/linux-usb/msg123478.html Cc: andrze...@samsung.com Cc: Daniel Mack zon...@gmail.com Cc: ti...@suse.de Cc: sta...@vger.kernel.org #v3.18+ Cc: Alan Stern st...@rowland.harvard.edu Signed-off-by: Peter Chen peter.c

Re: [PATCH v4 1/1] usb: gadget: f_uac2: finalize wMaxPacketSize according to bandwidth

2015-07-28 Thread Daniel Mack
On 07/28/2015 03:38 AM, Peter Chen wrote: diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c index 5318615..6a8e0d2 100644 --- a/drivers/usb/gadget/function/f_uac2.c +++ b/drivers/usb/gadget/function/f_uac2.c @@ -975,6 +975,31 @@ free_ep(struct

Re: [PATCH v3 1/2] usb: gadget: f_uac2: finalize wMaxPacketSize according to bandwidth

2015-07-27 Thread Daniel Mack
gadgets work together [1] at FS connection. [1]http://www.spinics.net/lists/linux-usb/msg123478.html Cc: andrze...@samsung.com Cc: Daniel Mack zon...@gmail.com Cc: ti...@suse.de Cc: sta...@vger.kernel.org #v3.18+ Cc: Alan Stern st...@rowland.harvard.edu Signed-off-by: Peter Chen peter.c

Re: [PATCH 2/2] usb: gadget: f_uac2: fix calculation of uac2-p_interval

2015-07-27 Thread Daniel Mack
-by: Daniel Mack zon...@gmail.com Thanks for spotting this! Daniel Cc: Daniel Mack zon...@gmail.com Cc: sta...@vger.kernel.org #v3.18+ Signed-off-by: Peter Chen peter.c...@freescale.com --- drivers/usb/gadget/function/f_uac2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

Re: [PATCH v2 1/1] usb: gadget: f_uac2: finalize wMaxPacketSize according to bandwidth

2015-07-23 Thread Daniel Mack
On 07/23/2015 03:00 AM, Peter Chen wrote: Thanks, it is correct. But looking the code at afunc_set_alt: the method of calculating uac2-p_pktsize seems incorrect, it may need to change like below: Ok, sorry. I just read the code again an figured you're right here, this needs fixing. It doesn't

Re: [PATCH v2 1/1] usb: gadget: f_uac2: finalize wMaxPacketSize according to bandwidth

2015-07-23 Thread Daniel Mack
On 07/23/2015 03:00 AM, Peter Chen wrote: That detail is merely about completeness. The code that calculates the value of wMaxPacketSize should take into account what is configured in bInterval of the endpoint, so if users change one thing, they don't have to tweak the other as well.

Re: [PATCH v2 1/1] usb: gadget: f_uac2: finalize wMaxPacketSize according to bandwidth

2015-07-23 Thread Daniel Mack
On 07/23/2015 10:35 AM, Peter Chen wrote: Assume the interval for each packet is 2ms, the rate is 192 kbytes for both FS HS: uac2-p_interval = 2000; uac2-p_pktsize = 192 kbytes / 2000 = 96 bytes And the uac2-p_pktsize is real usb packet length, it means hardware would expect there are 96

Re: [PATCH v2 1/1] usb: gadget: f_uac2: finalize wMaxPacketSize according to bandwidth

2015-07-22 Thread Daniel Mack
On 07/22/2015 08:45 AM, Peter Chen wrote: According to USB Audio Device 2.0 Spec, Ch4.10.1.1: wMaxPacketSize is defined as follows: Maximum packet size this endpoint is capable of sending or receiving when this configuration is selected. This is determined by the audio bandwidth constraints

Re: [PATCH v2 1/1] usb: gadget: f_uac2: finalize wMaxPacketSize according to bandwidth

2015-07-22 Thread Daniel Mack
On 07/22/2015 10:23 AM, Peter Chen wrote: On Wed, Jul 22, 2015 at 10:04:30AM +0200, Daniel Mack wrote: On 07/22/2015 08:45 AM, Peter Chen wrote: According to USB Audio Device 2.0 Spec, Ch4.10.1.1: wMaxPacketSize is defined as follows: Maximum packet size this endpoint is capable of sending

Re: [PATCH 1/1] usb: gadget: f_uac2: finalize wMaxPacketSize according to bandwidth

2015-07-14 Thread Daniel Mack
Hi, On 07/14/2015 04:29 AM, Peter Chen wrote: According to USB Audio Device 2.0 Spec, Ch4.10.1.1: wMaxPacketSize is defined as follows: Maximum packet size this endpoint is capable of sending or receiving when this configuration is selected. This is determined by the audio bandwidth

Re: [PATCH] usb: gagdet: f_midi: fix parameter assignment

2014-11-20 Thread Daniel Mack
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/20/2014 08:49 PM, Felipe Balbi wrote: On Tue, Nov 18, 2014 at 11:21:17PM +0100, Daniel Mack wrote: f_midi_register_card() uses midi-id and midi-index, so they need to be assigned before the function is called from f_midi_bind_config(). Move

[PATCH] usb: gagdet: f_midi: fix parameter assignment

2014-11-18 Thread Daniel Mack
f_midi_register_card() uses midi-id and midi-index, so they need to be assigned before the function is called from f_midi_bind_config(). Move the assigment of midi-buflen and midi-qlen as well so they are all grouped. Compile tested only. Signed-off-by: Daniel Mack dan...@zonque.org --- drivers

Re: [PATCH 2/2] usb: musb: musb_cppi41: revert to old timer poll intervals

2014-11-05 Thread Daniel Mack
On 11/05/2014 08:21 PM, Sebastian Andrzej Siewior wrote: On 11/05/2014 08:20 PM, Felipe Balbi wrote: could you just resend these two aptches ? I think about waiting for Daniel for some feedback. What about I resend them next week if I don't hear from him until then? Sorry for the delay -

Re: [PATCH] usb: gadget: udc: pxa27x: fix build warning when !OF

2014-11-05 Thread Daniel Mack
On 11/06/2014 05:55 AM, Felipe Balbi wrote: in case kernel is built without CONFIG_OF there will be a build warning (see below) due to of_match_ptr() being defined to NULL. Because of_match_ptr() is pretty pointless anyway, let's just remove it and fix the warning. The alternative, of

Re: [PATCH 2/2] usb: musb: musb_cppi41: revert to old timer poll intervals

2014-11-05 Thread Daniel Mack
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/06/2014 08:38 AM, Sebastian Reimers wrote: Sebastian (Reimers), given that you have a good test setup too, any chance you can as well do some testing here? Of course. I can try to reproduce your bug and then retry it with Sebastian's

[PATCH] usb: musb: cppi41: tweak hrtimer values

2014-09-03 Thread Daniel Mack
us. Also, when the callback is ran without taking action, it should be rescheduled 20 us later instead of 50 us. Reported-and-tested-by: Sven Neumann neum...@teufel.de Signed-off-by: Daniel Mack dan...@zonque.org --- drivers/usb/musb/musb_cppi41.c | 4 ++-- 1 file changed, 2 insertions(+), 2

Re: [PATCH v6 1/5] usb: gadget: f_uac2: restructure some code in afunc_set_alt()

2014-09-02 Thread Daniel Mack
Hi, On 09/02/2014 02:41 PM, Jassi Brar wrote: On Sat, Aug 30, 2014 at 2:16 AM, Felipe Balbi ba...@ti.com wrote: Hi, On Wed, Aug 27, 2014 at 07:09:03PM +0200, Daniel Mack wrote: Restructure some code to make it easier to read. While at it, return -ENOMEM instead of -EINVAL

Re: [PATCH v6 1/5] usb: gadget: f_uac2: restructure some code in afunc_set_alt()

2014-09-02 Thread Daniel Mack
Hi Felipe, On 08/29/2014 10:46 PM, Felipe Balbi wrote: On Wed, Aug 27, 2014 at 07:09:03PM +0200, Daniel Mack wrote: Restructure some code to make it easier to read. While at it, return -ENOMEM instead of -EINVAL if usb_ep_alloc_request() fails, and omit the logging in such cases (the mm

Re: [PATCH] usb: gadget: f_uac2: modulate playback data rate

2014-08-29 Thread Daniel Mack
Hi, On 08/29/2014 08:13 AM, Jassi Brar wrote: +/* + * 5512.5Hz is going to need the maximum number of elements (80), + * in the length-pattern loop, among standard ALSA supported rates. + */ +#define MAX_LOOP_LEN 80 + struct uac2_rtd_params { struct snd_uac2_chip *uac2; /* parent

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

2014-08-28 Thread Daniel Mack
On 08/28/2014 11:33 AM, Jassi Brar wrote: On Wed, Aug 27, 2014 at 10:39 PM, Daniel Mack zon...@gmail.com wrote: diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c index 246a778..a5a27a5 100644 --- a/drivers/usb/gadget/function/f_uac2.c +++ b/drivers

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

2014-08-28 Thread Daniel Mack
On 08/28/2014 12:10 PM, Jassi Brar wrote: On Thu, Aug 28, 2014 at 3:33 PM, Daniel Mack dan...@zonque.org wrote: It's still superior to a number of unnecessary calculations done every millisecond which will come up with the same result every time. So I clearly favor that approach. Three more

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

2014-08-28 Thread Daniel Mack
On 08/28/2014 12:17 PM, Daniel Mack wrote: Felipe, could you already merge patch 1-5 of the last series (v6)? 1-4, of course. Jassi's changes will only affect patch 5/5. Daniel -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord

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 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

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 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 v5 0/5] usb: gadget: f_uac2: cleanups and capture timing

2014-08-27 Thread Daniel Mack
buffer wrap problems in the ALSA buffer logic, which wasn't needed before The first two patches are just cleanups. Thanks to Alan Stern and Jassi Brar for the feedback! Daniel Daniel Mack (5): usb: gadget: f_uac2: restructure some code in afunc_set_alt() usb: gadget: f_uac2: add

[PATCH v5 1/5] usb: gadget: f_uac2: restructure some code in afunc_set_alt()

2014-08-27 Thread Daniel Mack
Restructure some code to make it easier to read. While at it, return -ENOMEM instead of -EINVAL if usb_ep_alloc_request() fails, and omit the logging in such cases (the mm core will complain loud enough). Signed-off-by: Daniel Mack zon...@gmail.com --- drivers/usb/gadget/function/f_uac2.c | 39

[PATCH v5 2/5] usb: gadget: f_uac2: add short-hand for 'dev'

2014-08-27 Thread Daniel Mack
In afunc_bind() and afunc_set_alt(), uac2-pdev.dev are used multiple times. Adding a short-hand for them makes lines shorter so we can remove some line wraps. No functional change. Signed-off-by: Daniel Mack zon...@gmail.com --- drivers/usb/gadget/function/f_uac2.c | 29

[PATCH v5 3/5] usb: gadget: f_uac2: introduce agdev_to_uac2_opts

2014-08-27 Thread Daniel Mack
Add a simple container_of() wrapper to get a struct f_uac2_opts from a struct struct audio_dev. Use it in two places where it is currently open-coded. Signed-off-by: Daniel Mack zon...@gmail.com --- drivers/usb/gadget/function/f_uac2.c | 10 -- 1 file changed, 8 insertions(+), 2

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

2014-08-27 Thread Daniel Mack
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. Signed-off-by: Daniel Mack zon...@gmail.com --- drivers/usb/gadget

[PATCH v5 4/5] usb: gadget: f_uac2: handle partial dma area wrap

2014-08-27 Thread Daniel Mack
-by: Daniel Mack zon...@gmail.com --- drivers/usb/gadget/function/f_uac2.c | 32 +++- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c index 9c8831d..246a778 100644 --- a/drivers/usb

Re: [PATCH v5 0/5] usb: gadget: f_uac2: cleanups and capture timing

2014-08-27 Thread Daniel Mack
On 08/27/2014 10:38 AM, Jassi Brar wrote: On Wed, Aug 27, 2014 at 1:15 PM, Daniel Mack zon...@gmail.com wrote: Daniel Mack (5): usb: gadget: f_uac2: restructure some code in afunc_set_alt() usb: gadget: f_uac2: add short-hand for 'dev' usb: gadget: f_uac2: introduce agdev_to_uac2_opts

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

2014-08-27 Thread Daniel Mack
On 08/27/2014 04:18 PM, Alan Stern wrote: On Wed, 27 Aug 2014, Daniel Mack wrote: +/* + * Whenever there are more bytes in the accumulator than we + * need to add one more sample frame, increase this packet's + * size and decrease

[PATCH v6 0/5] usb: gadget: f_uac2: cleanups and capture timing

2014-08-27 Thread Daniel Mack
for the feedback! Daniel Subject: [PATCH v6 0/5] *** SUBJECT HERE *** *** BLURB HERE *** Daniel Mack (5): usb: gadget: f_uac2: restructure some code in afunc_set_alt() usb: gadget: f_uac2: add short-hand for 'dev' usb: gadget: f_uac2: introduce agdev_to_uac2_opts usb: gadget: f_uac2: handle

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

2014-08-27 Thread Daniel Mack
are pre-computed for performance reasons. Signed-off-by: Daniel Mack zon...@gmail.com --- drivers/usb/gadget/function/f_uac2.c | 69 +--- 1 file changed, 65 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function

[PATCH v6 2/5] usb: gadget: f_uac2: add short-hand for 'dev'

2014-08-27 Thread Daniel Mack
In afunc_bind() and afunc_set_alt(), uac2-pdev.dev are used multiple times. Adding a short-hand for them makes lines shorter so we can remove some line wraps. No functional change. Signed-off-by: Daniel Mack zon...@gmail.com --- drivers/usb/gadget/function/f_uac2.c | 29

[PATCH v6 4/5] usb: gadget: f_uac2: handle partial dma area wrap

2014-08-27 Thread Daniel Mack
-by: Daniel Mack zon...@gmail.com --- drivers/usb/gadget/function/f_uac2.c | 32 +++- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c index 9c8831d..246a778 100644 --- a/drivers/usb

[PATCH v6 3/5] usb: gadget: f_uac2: introduce agdev_to_uac2_opts

2014-08-27 Thread Daniel Mack
Add a simple container_of() wrapper to get a struct f_uac2_opts from a struct struct audio_dev. Use it in two places where it is currently open-coded. Signed-off-by: Daniel Mack zon...@gmail.com --- drivers/usb/gadget/function/f_uac2.c | 10 -- 1 file changed, 8 insertions(+), 2

[PATCH v6 1/5] usb: gadget: f_uac2: restructure some code in afunc_set_alt()

2014-08-27 Thread Daniel Mack
Restructure some code to make it easier to read. While at it, return -ENOMEM instead of -EINVAL if usb_ep_alloc_request() fails, and omit the logging in such cases (the mm core will complain loud enough). Signed-off-by: Daniel Mack zon...@gmail.com --- drivers/usb/gadget/function/f_uac2.c | 39

Re: [PATCH v2 3/4] usb: gadget: f_uac2: send reasonably sized packets

2014-08-26 Thread Daniel Mack
On 08/25/2014 07:22 PM, Jassi Brar wrote: On Mon, Aug 25, 2014 at 9:30 PM, Daniel Mack zon...@gmail.com wrote: @@ -187,7 +189,7 @@ agdev_iso_complete(struct usb_ep *ep, struct usb_request *req) if (substream-stream == SNDRV_PCM_STREAM_PLAYBACK) { src = prm-dma_area

[PATCH v3 3/4] usb: gadget: f_uac2: handle partial dma area wrap

2014-08-26 Thread Daniel Mack
-by: Daniel Mack zon...@gmail.com --- drivers/usb/gadget/function/f_uac2.c | 32 +++- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c index efe8add..a18f147 100644 --- a/drivers/usb

[PATCH v3 0/4] usb: gadget: f_uac2: cleanups and capture timing

2014-08-26 Thread Daniel Mack
to work well on a BBB setup here. Thanks, Daniel Daniel Mack (4): usb: gadget: f_uac2: restructure some code in afunc_set_alt() usb: gadget: f_uac2: add short-hand for 'dev' usb: gadget: f_uac2: handle partial dma area wrap usb: gadget: f_uac2: send reasonably sized packets drivers/usb

[PATCH v3 4/4] usb: gadget: f_uac2: send reasonably sized packets

2014-08-26 Thread Daniel Mack
. With a simple division by the number of available frames (1000), we would be off by 400 bytes, or 100 samples per second. By preparing a sequence of lengths, we can make each 10th packet accomodate one more frame, which results in 400 more bytes/s. Signed-off-by: Daniel Mack zon...@gmail.com

[PATCH v3 2/4] usb: gadget: f_uac2: add short-hand for 'dev'

2014-08-26 Thread Daniel Mack
In afunc_bind() and afunc_set_alt(), uac2-pdev.dev are used multiple times. Adding a short-hand for them makes lines shorter so we can remove some line wraps. No functional change. Signed-off-by: Daniel Mack zon...@gmail.com --- drivers/usb/gadget/function/f_uac2.c | 29

[PATCH v3 1/4] usb: gadget: f_uac2: restructure some code in afunc_set_alt()

2014-08-26 Thread Daniel Mack
Restructure some code to make it easier to read. While at it, return -ENOMEM instead of -EINVAL if usb_ep_alloc_request() fails, and omit the logging in such cases (the mm core will complain loud enough). Signed-off-by: Daniel Mack zon...@gmail.com --- drivers/usb/gadget/function/f_uac2.c | 39

Re: [PATCH v2 3/4] usb: gadget: f_uac2: send reasonably sized packets

2014-08-26 Thread Daniel Mack
On 08/26/2014 05:08 PM, Alan Stern wrote: The normal approach is to perform a simple runtime calculation (no pre-allocated pattern). It's not complex. Let S be the number of samples per second at the nominal transfer rate (for example, S = 44100). Let R be the number of packets per

[PATCH v4 0/5] usb: gadget: f_uac2: cleanups and capture timing

2014-08-26 Thread Daniel Mack
wasn't needed before The first two patches are just cleanups. Thanks to Alan Stern and Jassi Brar for the feedback! Daniel Daniel Mack (5): usb: gadget: f_uac2: restructure some code in afunc_set_alt() usb: gadget: f_uac2: add short-hand for 'dev' usb: gadget: f_uac2: introduce

[PATCH v4 1/5] usb: gadget: f_uac2: restructure some code in afunc_set_alt()

2014-08-26 Thread Daniel Mack
Restructure some code to make it easier to read. While at it, return -ENOMEM instead of -EINVAL if usb_ep_alloc_request() fails, and omit the logging in such cases (the mm core will complain loud enough). Signed-off-by: Daniel Mack zon...@gmail.com --- drivers/usb/gadget/function/f_uac2.c | 39

[PATCH v4 2/5] usb: gadget: f_uac2: add short-hand for 'dev'

2014-08-26 Thread Daniel Mack
In afunc_bind() and afunc_set_alt(), uac2-pdev.dev are used multiple times. Adding a short-hand for them makes lines shorter so we can remove some line wraps. No functional change. Signed-off-by: Daniel Mack zon...@gmail.com --- drivers/usb/gadget/function/f_uac2.c | 29

[PATCH v4 3/5] usb: gadget: f_uac2: introduce agdev_to_uac2_opts

2014-08-26 Thread Daniel Mack
Add a simple container_of() wrapper to get a struct f_uac2_opts from a struct struct audio_dev. Use it in two places where it is currently open-coded. Signed-off-by: Daniel Mack zon...@gmail.com --- drivers/usb/gadget/function/f_uac2.c | 10 -- 1 file changed, 8 insertions(+), 2

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

2014-08-26 Thread Daniel Mack
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. Signed-off-by: Daniel Mack zon...@gmail.com --- drivers/usb/gadget

[PATCH v4 4/5] usb: gadget: f_uac2: handle partial dma area wrap

2014-08-26 Thread Daniel Mack
-by: Daniel Mack zon...@gmail.com --- drivers/usb/gadget/function/f_uac2.c | 32 +++- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c index 9c8831d..246a778 100644 --- a/drivers/usb

Re: [PATCH 0/4] usb: gadget: f_uac2: cleanups and capture timing

2014-08-25 Thread Daniel Mack
Hi Clemens, On 08/25/2014 09:15 AM, Clemens Ladisch wrote: Daniel Mack wrote: a) Linux snd-usb-audio currently pre-calculates the estimated packet sizes to expect from a USB device, and will only receive packets that have the expected size or are smaller. snd-usb-audio allows packets

Re: [PATCH 0/4] usb: gadget: f_uac2: cleanups and capture timing

2014-08-25 Thread Daniel Mack
On 08/25/2014 11:23 AM, Jassi Brar wrote: On Mon, Aug 25, 2014 at 2:14 PM, Daniel Mack dan...@zonque.org wrote: The easiest is probably really to just calculate correct packet sizes and stick to them. After all, the actual clock is really arbitrary, we just have to pick something

Re: [PATCH 0/4] usb: gadget: f_uac2: cleanups and capture timing

2014-08-25 Thread Daniel Mack
On 08/25/2014 11:30 AM, Jassi Brar wrote: On Mon, Aug 25, 2014 at 2:57 PM, Daniel Mack dan...@zonque.org wrote: On 08/25/2014 11:23 AM, Jassi Brar wrote: On Mon, Aug 25, 2014 at 2:14 PM, Daniel Mack dan...@zonque.org wrote: The easiest is probably really to just calculate correct packet sizes

[PATCH v2 3/4] usb: gadget: f_uac2: send reasonably sized packets

2014-08-25 Thread Daniel Mack
-off-by: Daniel Mack zon...@gmail.com --- drivers/usb/gadget/function/f_uac2.c | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c index efe8add..610a2f1 100644 --- a/drivers/usb

[PATCH v2 2/4] usb: gadget: f_uac2: add short-hand for 'dev'

2014-08-25 Thread Daniel Mack
In afunc_bind() and afunc_set_alt(), uac2-pdev.dev are used multiple times. Adding a short-hand for them makes lines shorter so we can remove some line wraps. No functional change. Signed-off-by: Daniel Mack zon...@gmail.com --- drivers/usb/gadget/function/f_uac2.c | 29

[PATCH v2 1/4] usb: gadget: f_uac2: restructure some code in afunc_set_alt()

2014-08-25 Thread Daniel Mack
Restructure some code to make it easier to read. While at it, return -ENOMEM instead of -EINVAL if usb_ep_alloc_request() fails, and omit the logging in such cases (the mm core will complain loud enough). Signed-off-by: Daniel Mack zon...@gmail.com --- drivers/usb/gadget/function/f_uac2.c | 39

[PATCH v2 4/4] usb: gadget: f_uac2: handle partial dma area wrap

2014-08-25 Thread Daniel Mack
sized packets, we have to address such cases, and copy the payload in two steps conditionally. The 'src' and 'dst' approach doesn't work here anymore, as different behavior is necessary in playback and capture cases. Thus, this patch open-codes the routine now. Signed-off-by: Daniel Mack zon

[PATCH v2 0/4] usb: gadget: f_uac2: cleanups and capture timing

2014-08-25 Thread Daniel Mack
patches are just cleanups. Sebastian, could you give these patches a try? They seem to work well on a BBB setup here. Thanks, Daniel Daniel Mack (4): usb: gadget: f_uac2: restructure some code in afunc_set_alt() usb: gadget: f_uac2: add short-hand for 'dev' usb: gadget: f_uac2: send reasonably

Re: [PATCH v2 3/4] usb: gadget: f_uac2: send reasonably sized packets

2014-08-25 Thread Daniel Mack
Hi, On 08/25/2014 07:22 PM, Jassi Brar wrote: On Mon, Aug 25, 2014 at 9:30 PM, 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

Re: [PATCH v2 3/4] usb: gadget: f_uac2: send reasonably sized packets

2014-08-25 Thread Daniel Mack
Hi, On 08/25/2014 07:43 PM, Jassi Brar wrote: On Mon, Aug 25, 2014 at 10:52 PM, Jassi Brar jassisinghb...@gmail.com wrote: I believe you want to do the following in afunc_set_alt(). - req-length = prm-max_psize; + req-length = uac2-c_pktsize; Sorry I intended... - prm-max_psize

Re: [PATCH v2 3/4] usb: gadget: f_uac2: send reasonably sized packets

2014-08-25 Thread Daniel Mack
On 08/25/2014 09:00 PM, Jassi Brar wrote: On Mon, Aug 25, 2014 at 11:40 PM, Daniel Mack dan...@zonque.org wrote: Sure, but rates across devices will never match, so it doesn't matter really. Two clocks on two devices will always drift, even if they're totally accurate by their own means. You

Re: What is the command line commands to use UAC2 at USB client side?

2014-08-24 Thread Daniel Mack
Hi Jassi, On 08/19/2014 11:52 AM, Jassi Brar wrote: Its been quite some time now, but I think we designed the uac2 to rely on USB's ISO packets' rate control to send and receive audio data at announced sampling rate. I'm still thinking how that setup should have ever been possible with

Re: [linux-usb] USB Gadget drivers Windows 7/8 support and .bAlternateSetting in interface descriptor

2014-08-24 Thread Daniel Mack
On 08/22/2014 04:43 AM, Xuebing Wang wrote: static inline bool gadget_supports_altsettings(struct usb_gadget *gadget) { /* PXA 21x/25x/26x has no altsettings at all */ if (gadget_is_pxa(gadget)) return false; /* PXA 27x and 3xx have *broken*

Re: What is the command line commands to use UAC2 at USB client side?

2014-08-19 Thread Daniel Mack
On 08/19/2014 02:01 AM, Xuebing Wang wrote: On 08/19/2014 01:11 AM, Daniel Mack wrote: On 08/15/2014 05:49 AM, Xuebing Wang wrote: root@imx6slevk:~# root@imx6slevk:~# arecord -f dat -t wav -D hw:2,0 | aplay -D hw:0,0 Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo

Re: What is the command line commands to use UAC2 at USB client side?

2014-08-19 Thread Daniel Mack
On 08/19/2014 10:54 AM, Xuebing Wang wrote: Thanks. You were trying UAC2, right? Yes. Thanks Daniel. Did you hear noise (hear with ear phone, not speaker) especially when playing music from Ubuntu host? I am hearing slight noise here. Not that I noticed. I'd suggest recording audio

Re: What is the command line commands to use UAC2 at USB client side?

2014-08-19 Thread Daniel Mack
On 08/19/2014 11:01 AM, Jassi Brar wrote: On Tue, Aug 19, 2014 at 2:15 PM, Daniel Mack dan...@zonque.org wrote: On 08/19/2014 02:01 AM, Xuebing Wang wrote: root@imx6slevk:~# root@imx6slevk:~# arecord -f dat -t wav -D hw:2,0 | aplay -D hw:0,0 Recording WAVE 'stdin' : Signed 16 bit Little

Re: [PATCH v4 2/2] usb: gadget: Add xilinx usb2 device support

2014-08-19 Thread Daniel Mack
Hi, On 07/22/2014 11:08 AM, Subbaraya Sundeep Bhatta wrote: This patch adds xilinx usb2 device driver support Add some more information here, please. Copying the text from the Kconfig option is already a good start. drivers/usb/gadget/Kconfig | 14 + drivers/usb/gadget/Makefile |

Re: [PATCH v4 2/2] usb: gadget: Add xilinx usb2 device support

2014-08-19 Thread Daniel Mack
On 08/19/2014 11:56 AM, Daniel Mack wrote: On 07/22/2014 11:08 AM, Subbaraya Sundeep Bhatta wrote: drivers/usb/gadget/Kconfig | 14 + drivers/usb/gadget/Makefile |1 + drivers/usb/gadget/udc-xilinx.c | 2261 +++ 3 files changed, 2276

Re: What is the command line commands to use UAC2 at USB client side?

2014-08-18 Thread Daniel Mack
On 08/15/2014 05:49 AM, Xuebing Wang wrote: Jassi, thanks for your help. Without knowing what is the best way to implement UAC2 at the device side, I managed to simply pipe is as below: Note: When I am playing music from Ubuntu host, I can hear light noise from the device (via UAC2)

Re: [Alsa-user] linux does not recognize my midi controller samson carbon 61

2014-08-15 Thread Daniel Mack
On 08/15/2014 12:21 AM, Lion Bino wrote: I have a problem a midi controller, a Samson Carbon 61. When I connect via usb, dmesg tells me the following. [ 1480.097123] usb 2-1.1: new full-speed USB device number 9 using ehci_hcd [ 1480.118082] usb 2-1.1: no configurations

Re: [Alsa-user] linux does not recognize my midi controller samson carbon 61

2014-08-15 Thread Daniel Mack
Hi, On 08/15/2014 04:00 PM, Lionel wrote: Hi Daniel. This is trace when i connect the midi controller. Thanks. This one here is the setup packet followed by the answer, which is the device descriptor: 8801cbae2a80 1534946150 S Ci:2:000:0 s 80 06 0100 0040 64 8801cbae2a80

Re: [Alsa-user] linux does not recognize my midi controller samson carbon 61

2014-08-15 Thread Daniel Mack
On 08/15/2014 05:25 PM, Lionel wrote: Thanks Daniel! You're welcome! I decided to ask the vendor to fix the bug in the firmware. Do I have any expectation of success? Probably not. Most audio hardware vendors don't care about Linux. What should be the best way to request support for

Re: [PATCH] usb: musb: cppi41: fix not transmitting zero length packet issue

2014-08-12 Thread Daniel Mack
Hi Bin, On 08/12/2014 06:46 PM, Bin Liu wrote: drivers/usb/musb/musb_cppi41.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c index 5989def..e9a0e54 100644 ---

Re: [PATCH] usb: musb: cppi41: fix not transmitting zero length packet issue

2014-08-12 Thread Daniel Mack
On 08/12/2014 07:05 PM, Bin Liu wrote: Don't you need to check for (urb-transfer_flags URB_ZERO_PACKET) somewhere here? I'd not expect an extra 0-byte packet at the end of a transfer unless this flag is set. mode is set to 1 when (urb-transfer_flags URB_ZERO_PACKET), in

Re: [PATCH] usb: musb: cppi41: fix not transmitting zero length packet issue

2014-08-12 Thread Daniel Mack
On 08/12/2014 07:32 PM, Bin Liu wrote: 633 #if defined(CONFIG_USB_INVENTRA_DMA) || defined(CONFIG_USB_UX500_DMA) ... 658 #else 659 if (!is_cppi_enabled() !tusb_dma_omap()) 660 return false; ... 668 mode = (urb-transfer_flags URB_ZERO_PACKET) ? 1 : 0;

Re: [alsa-devel] [PATCH 1/1] usb: gadget: f_uac2: Fix pcm sample size selection

2014-07-22 Thread Daniel Mack
On 07/04/2014 07:43 AM, Takashi Iwai wrote: At Thu, 3 Jul 2014 20:15:28 +0200, Sebastian Reimers wrote: The pcm playback and capture sample size format was fixed SNDRV_PCM_FMTBIT_S16_LE. This patch respects also 16, 24 and 32 bit p_ssize and c_ssize values. Signed-off-by: Sebastian

Re: [alsa-devel] [PATCH 1/1] usb: gadget: f_uac2: Fix pcm sample size selection

2014-07-22 Thread Daniel Mack
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/22/2014 07:44 PM, Felipe Balbi wrote: On Tue, Jul 22, 2014 at 07:09:51PM +0200, Daniel Mack wrote: On 07/04/2014 07:43 AM, Takashi Iwai wrote: At Thu, 3 Jul 2014 20:15:28 +0200, Sebastian Reimers wrote: The pcm playback and capture sample

Re: [PATCH v4 1/7] dma: cppi41: handle 0-length packets

2014-07-01 Thread Daniel Mack
On 06/30/2014 09:40 PM, Daniel Mack wrote: #3 fixes a reproducible kernel crash when unplugging streaming audio devices, and #5 causes data stream starvation which makes using many s/causes/fixes/, of course. -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body

Re: [PATCH v2 0/2] usb musb/cppi41: Address issues with isochronous audio endpoints

2014-06-30 Thread Daniel Mack
On 06/30/2014 07:54 PM, Felipe Balbi wrote: Hi, On Fri, Jun 20, 2014 at 09:14:34AM +0530, George Cherian wrote: On 6/20/2014 3:50 AM, Daniel Mack wrote: Hi, I've been debugging issues with musb in host mode and both full-speed and high-speed USB audio devices with cppi41 DMA mode enabled

Re: [PATCH v4 1/7] dma: cppi41: handle 0-length packets

2014-06-30 Thread Daniel Mack
Hi Felipe, Glad to see you find some time for this patch set :) On 06/30/2014 07:19 PM, Felipe Balbi wrote: On Mon, May 26, 2014 at 02:52:34PM +0200, Daniel Mack wrote: When a 0-length packet is received on the bus, desc-pd0 yields 1, which confuses the driver's users. This information

Re: [PATCH v4 1/7] dma: cppi41: handle 0-length packets

2014-06-30 Thread Daniel Mack
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/30/2014 09:26 PM, Felipe Balbi wrote: On Mon, Jun 30, 2014 at 09:19:08PM +0200, Daniel Mack wrote: I also asked Vinod to pick this single patch for his tree, but there was no answer yet. cool. hopefully we can get a better v3.17

Re: [PATCH v4 1/7] dma: cppi41: handle 0-length packets

2014-06-30 Thread Daniel Mack
On 06/30/2014 09:31 PM, Felipe Balbi wrote: On Mon, Jun 30, 2014 at 09:29:10PM +0200, Daniel Mack wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/30/2014 09:26 PM, Felipe Balbi wrote: On Mon, Jun 30, 2014 at 09:19:08PM +0200, Daniel Mack wrote: I also asked Vinod to pick

Re: Gadget regression with enabling of MUSB babble interrupt handling

2014-06-19 Thread Daniel Mack
(+ George) On 06/19/2014 11:56 AM, Tony Lindgren wrote: Looks like commit ca88fc2ef0d7 (usb: musb: add a work_struct to recover from babble errors) causes MUSB gadgets to stop enumerating at least on omap3. Reverting the the commit fixes the issue. Hmm, so do you see babble errors occuring?

Re: Gadget regression with enabling of MUSB babble interrupt handling

2014-06-19 Thread Daniel Mack
Hi Tony, On 06/19/2014 12:31 PM, Tony Lindgren wrote: * Daniel Mack dan...@zonque.org [140619 03:10]: On 06/19/2014 11:56 AM, Tony Lindgren wrote: Looks like commit ca88fc2ef0d7 (usb: musb: add a work_struct to recover from babble errors) causes MUSB gadgets to stop enumerating at least

Re: Gadget regression with enabling of MUSB babble interrupt handling

2014-06-19 Thread Daniel Mack
On 06/19/2014 12:43 PM, Tony Lindgren wrote: * Daniel Mack dan...@zonque.org [140619 03:38]: On 06/19/2014 12:31 PM, Tony Lindgren wrote: * Daniel Mack dan...@zonque.org [140619 03:10]: On 06/19/2014 11:56 AM, Tony Lindgren wrote: But that also raises a question: Were these patches merged

Re: [PATCH 2/2] usb: musb: cppi41: fire hrtimer according to programmed channel length

2014-06-19 Thread Daniel Mack
On 06/19/2014 05:07 PM, Felipe Balbi wrote: On Wed, Jun 18, 2014 at 11:36:43AM +0200, Daniel Mack wrote: On 06/18/2014 11:32 AM, David Laight wrote: From: Of Daniel Mack Sent: 18 June 2014 10:28 To: ba...@ti.com; george.cher...@ti.com; bige...@linutronix.de Cc: sebastian.reim

Re: [PATCH 2/2] usb: musb: cppi41: fire hrtimer according to programmed channel length

2014-06-19 Thread Daniel Mack
On 06/19/2014 05:53 PM, David Laight wrote: From: Daniel Mack [mailto:dan...@zonque.org] On 06/19/2014 05:07 PM, Felipe Balbi wrote: On Wed, Jun 18, 2014 at 11:36:43AM +0200, Daniel Mack wrote: On 06/18/2014 11:32 AM, David Laight wrote: You can't really mean nanoseconds? Microseconds

[PATCH v2 0/2] usb musb/cppi41: Address issues with isochronous audio endpoints

2014-06-19 Thread Daniel Mack
that I sent ~3 weeks ago. Thanks, Daniel v1 - v2: * clean up nanosecond/microsecond confusion in patch #2 Daniel Mack (2): Revert usb: musb: musb_cppi41: Handle ISOCH differently and not use the hrtimer. usb: musb: cppi41: fire hrtimer according to programmed channel length

[PATCH v2 1/2] Revert usb: musb: musb_cppi41: Handle ISOCH differently and not use the hrtimer.

2014-06-19 Thread Daniel Mack
tried to address can be handled differently, which is what the next patch does. Signed-off-by: Daniel Mack zon...@gmail.com Reported-by: Sebastian Reimers sebastian.reim...@googlemail.com --- drivers/usb/musb/musb_cppi41.c | 53 -- 1 file changed, 53 deletions

[PATCH v2 2/2] usb: musb: cppi41: fire hrtimer according to programmed channel length

2014-06-19 Thread Daniel Mack
and HS audio devices appear to work well on AM335x hardware. Signed-off-by: Daniel Mack zon...@gmail.com Reported-by: Sebastian Reimers sebastian.reim...@googlemail.com --- drivers/usb/musb/musb_cppi41.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/musb

[PATCH 1/2] Revert usb: musb: musb_cppi41: Handle ISOCH differently and not use the hrtimer.

2014-06-18 Thread Daniel Mack
tried to address can be handled differently, which is what the next patch does. Signed-off-by: Daniel Mack zon...@gmail.com Reported-by: Sebastian Reimers sebastian.reim...@googlemail.com --- drivers/usb/musb/musb_cppi41.c | 53 -- 1 file changed, 53 deletions

  1   2   3   4   5   >