Skip to contentSkip to conversation

High-bandwidth/multiple transactions per microframe in usb audio?

DISCUSSION Pavel Hofman 3 participants 6 messages Apr 24, 2020 – Apr 27, 2020

lore
Share & tools
lore
#0 lore raw

Hi,

Please does the current USB audio driver support multiple transactions per microframe (high-bandwidth mode)? I could not find it in endpoint.c but it may be there or somewhere else :-)

Thanks a lot,

Pavel.

#1 lore raw

В Пт, 24/04/2020 в 11:42 +0200, Pavel Hofman пишет:

Quoted 7 lines

Hi,

Please does the current USB audio driver support multiple transactions
per microframe (high-bandwidth mode)? I could not find it in endpoint.c
but it may be there or somewhere else :-)

This should be transparent for the driver. See usb_submit_urb() function from drivers/usb/core/urb.c. It allows packets larger than 1024 for isochronous transfers over High Speed and Super Speed buses.

#2 lore raw

Dne 25. 04. 20 v 14:06 Alexander Tsoy napsal(a):

Quoted 9 lines

В Пт, 24/04/2020 в 11:42 +0200, Pavel Hofman пишет:

Quoted 7 lines

Hi,

Please does the current USB audio driver support multiple transactions
per microframe (high-bandwidth mode)? I could not find it in endpoint.c
but it may be there or somewhere else :-)

Quoted 3 lines

This should be transparent for the driver. See usb_submit_urb() function from drivers/usb/core/urb.c. It allows packets larger than 1024 for isochronous transfers over High Speed and Super Speed buses.

Alexander, thanks a lot for the info and hint, indeed at
https://github.com/torvalds/linux/blob/master/drivers/usb/core/urb.c#L444

Best regards,

Pavel.

#3 lore raw

В Сб, 25/04/2020 в 20:06 +0200, Pavel Hofman пишет:

Quoted 10 lines

Dne 25. 04. 20 v 14:06 Alexander Tsoy napsal(a):

Quoted 9 lines

В Пт, 24/04/2020 в 11:42 +0200, Pavel Hofman пишет:

Quoted 7 lines

Hi,

Please does the current USB audio driver support multiple transactions
per microframe (high-bandwidth mode)? I could not find it in endpoint.c
but it may be there or somewhere else :-)

Quoted 8 lines
Quoted 4 lines

This should be transparent for the driver. See usb_submit_urb() function from drivers/usb/core/urb.c. It allows packets larger than 1024 for isochronous transfers over High Speed and Super Speed buses.

Alexander, thanks a lot for the info and hint, indeed at
https://github.com/torvalds/linux/blob/master/drivers/usb/core/urb.c#L444

And I just noticed that USB-audio driver can't properly parse max packet size for SuperSpeed and SuperSpeed+ devices yet. See audio_format_alloc_init().

#4 lore raw

Dne 25. 04. 20 v 21:50 Alexander Tsoy napsal(a):

Quoted 5 lines

В Сб, 25/04/2020 в 20:06 +0200, Pavel Hofman пишет:

And I just noticed that USB-audio driver can't properly parse max packet size for SuperSpeed and SuperSpeed+ devices yet. See audio_format_alloc_init().

Very good catch. IIUC there are two basically equivalent calculations for HighSpeed -

https://elixir.bootlin.com/linux/v5.6.7/source/drivers/usb/core/urb.c#L445

https://elixir.bootlin.com/linux/v5.6.7/source/sound/usb/stream.c#L691

And audio_format_alloc_init missing the sections for SS, SS+ in usb_submit_urb . Perhpas a common method to make the calculation for all cases would make it more robust?

Thanks,

Pavel.

#5 lore raw
Quoted 14 lines · Pavel Hofman

Dne 25. 04. 20 v 21:50 Alexander Tsoy napsal(a):

Quoted 5 lines

В Сб, 25/04/2020 в 20:06 +0200, Pavel Hofman пишет:

And I just noticed that USB-audio driver can't properly parse max packet size for SuperSpeed and SuperSpeed+ devices yet. See audio_format_alloc_init().

Very good catch. IIUC there are two basically equivalent calculations for HighSpeed -

https://elixir.bootlin.com/linux/v5.6.7/source/drivers/usb/core/urb.c#L445

Quoted 6 lines

https://elixir.bootlin.com/linux/v5.6.7/source/sound/usb/stream.c#L691

And audio_format_alloc_init missing the sections for SS, SS+ in usb_submit_urb . Perhpas a common method to make the calculation for all cases would make it more robust?

Yes, a common USB helper function sounds like a good idea.

thanks,

Takashi