All of lore.kernel.org
 help / color / mirror / Atom feed
* Question about f_uac1 gadget
@ 2023-03-07  0:24 Noah Causin
  2023-03-07  2:41 ` Ruslan Bilovol
  0 siblings, 1 reply; 5+ messages in thread
From: Noah Causin @ 2023-03-07  0:24 UTC (permalink / raw)
  To: linux-usb

Hi,

I was wondering if the f_uac1 gadget supports more than two channels of 
audio.

Noah

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question about f_uac1 gadget
  2023-03-07  0:24 Question about f_uac1 gadget Noah Causin
@ 2023-03-07  2:41 ` Ruslan Bilovol
  2023-03-09  4:24   ` Noah Causin
  0 siblings, 1 reply; 5+ messages in thread
From: Ruslan Bilovol @ 2023-03-07  2:41 UTC (permalink / raw)
  To: Noah Causin; +Cc: linux-usb

On Mon, Mar 6, 2023 at 7:24 PM Noah Causin <n0manletter@gmail.com> wrote:
>
> Hi,
>
> I was wondering if the f_uac1 gadget supports more than two channels of
> audio.

Yes it does, see channel mask configfs configuration options for
capture/playback
in the documentation for UAC1 function:
https://www.kernel.org/doc/Documentation/ABI/testing/configfs-usb-gadget-uac1

Regards,
Ruslan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question about f_uac1 gadget
  2023-03-07  2:41 ` Ruslan Bilovol
@ 2023-03-09  4:24   ` Noah Causin
  2023-03-10  6:51     ` Ruslan Bilovol
  0 siblings, 1 reply; 5+ messages in thread
From: Noah Causin @ 2023-03-09  4:24 UTC (permalink / raw)
  To: Ruslan Bilovol; +Cc: linux-usb

Hi Ruslan,

I can't seem to get the f_uac1 to work with more than 2 channels. I'm 
able to setup f_uac2 with 8 channels.

I've tried a 5.1 and 7.1 setup (c_chmask=63 or 255, c_srate=44100, 
c_ssize=2) but I get a urb 0 error on the connected Linux laptop and the 
gnome sound-test freezes when testing a channel, no errors on the gadget 
device. My usb controller is a DWC3 on a RockPro64 board.

usb 3-2: USB disconnect, device number 9
usb 3-2: new high-speed USB device number 10 using xhci_hcd
usb 3-2: New USB device found, idVendor=1d6b, idProduct=0104, bcdDevice= 
1.00
usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 3-2: Product: audioproduct
usb 3-2: Manufacturer: audiomanufacturer
usb 3-2: SerialNumber: audioserial
usb 3-2: cannot submit urb 0, error -90: internal error

Noah

On 3/6/23 21:41, Ruslan Bilovol wrote:
> On Mon, Mar 6, 2023 at 7:24 PM Noah Causin <n0manletter@gmail.com> wrote:
>>
>> Hi,
>>
>> I was wondering if the f_uac1 gadget supports more than two channels of
>> audio.
> 
> Yes it does, see channel mask configfs configuration options for
> capture/playback
> in the documentation for UAC1 function:
> https://www.kernel.org/doc/Documentation/ABI/testing/configfs-usb-gadget-uac1
> 
> Regards,
> Ruslan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question about f_uac1 gadget
  2023-03-09  4:24   ` Noah Causin
@ 2023-03-10  6:51     ` Ruslan Bilovol
  2023-03-11  5:09       ` Noah Causin
  0 siblings, 1 reply; 5+ messages in thread
From: Ruslan Bilovol @ 2023-03-10  6:51 UTC (permalink / raw)
  To: Noah Causin; +Cc: linux-usb

On Wed, Mar 8, 2023 at 11:24 PM Noah Causin <n0manletter@gmail.com> wrote:
>
> Hi Ruslan,
>
> I can't seem to get the f_uac1 to work with more than 2 channels. I'm
> able to setup f_uac2 with 8 channels.
>
> I've tried a 5.1 and 7.1 setup (c_chmask=63 or 255, c_srate=44100,
> c_ssize=2) but I get a urb 0 error on the connected Linux laptop and the
> gnome sound-test freezes when testing a channel, no errors on the gadget
> device. My usb controller is a DWC3 on a RockPro64 board.
>
> usb 3-2: USB disconnect, device number 9
> usb 3-2: new high-speed USB device number 10 using xhci_hcd
> usb 3-2: New USB device found, idVendor=1d6b, idProduct=0104, bcdDevice=
> 1.00
> usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> usb 3-2: Product: audioproduct
> usb 3-2: Manufacturer: audiomanufacturer
> usb 3-2: SerialNumber: audioserial
> usb 3-2: cannot submit urb 0, error -90: internal error

Hmmm.. I also can reproduce this issue, it seems that's some bug in the
host USB audio driver. At least I see that it tries to send packets with size
bigger than the endpoint's max packet size.

I reproduced it on my Debian laptop with (kernel v6.1) and can't reproduce
on older Ubuntu with kernel v5.4.

BTW Noah what is the kernel version on your laptop where you see
this issue?

Thanks,
Ruslan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question about f_uac1 gadget
  2023-03-10  6:51     ` Ruslan Bilovol
@ 2023-03-11  5:09       ` Noah Causin
  0 siblings, 0 replies; 5+ messages in thread
From: Noah Causin @ 2023-03-11  5:09 UTC (permalink / raw)
  To: Ruslan Bilovol; +Cc: linux-usb

The laptop has kernel 6.1.14 (Fedora 37)

I looked into the error message and found a patch description saying 
that the error: (cannot submit urb 0, error -90: internal error) can 
happen when a audio device's channel number does not match its data 
endpoint, leading to failure at the host driver.

https://github.com/DerRomtester/android_kernel_oneplus_msm8974/commit/2ef9cf0c9181e9472fa0be7885541e91189ecd5d

It seems like the f_uac1 gadget might not be syncing the channel number 
value with the data endpoint.

Noah

On 3/10/23 01:51, Ruslan Bilovol wrote:
> On Wed, Mar 8, 2023 at 11:24 PM Noah Causin <n0manletter@gmail.com> wrote:
>>
>> Hi Ruslan,
>>
>> I can't seem to get the f_uac1 to work with more than 2 channels. I'm
>> able to setup f_uac2 with 8 channels.
>>
>> I've tried a 5.1 and 7.1 setup (c_chmask=63 or 255, c_srate=44100,
>> c_ssize=2) but I get a urb 0 error on the connected Linux laptop and the
>> gnome sound-test freezes when testing a channel, no errors on the gadget
>> device. My usb controller is a DWC3 on a RockPro64 board.
>>
>> usb 3-2: USB disconnect, device number 9
>> usb 3-2: new high-speed USB device number 10 using xhci_hcd
>> usb 3-2: New USB device found, idVendor=1d6b, idProduct=0104, bcdDevice=
>> 1.00
>> usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
>> usb 3-2: Product: audioproduct
>> usb 3-2: Manufacturer: audiomanufacturer
>> usb 3-2: SerialNumber: audioserial
>> usb 3-2: cannot submit urb 0, error -90: internal error
> 
> Hmmm.. I also can reproduce this issue, it seems that's some bug in the
> host USB audio driver. At least I see that it tries to send packets with size
> bigger than the endpoint's max packet size.
> 
> I reproduced it on my Debian laptop with (kernel v6.1) and can't reproduce
> on older Ubuntu with kernel v5.4.
> 
> BTW Noah what is the kernel version on your laptop where you see
> this issue?
> 
> Thanks,
> Ruslan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-11  5:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-07  0:24 Question about f_uac1 gadget Noah Causin
2023-03-07  2:41 ` Ruslan Bilovol
2023-03-09  4:24   ` Noah Causin
2023-03-10  6:51     ` Ruslan Bilovol
2023-03-11  5:09       ` Noah Causin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.