Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1651446 > unrolled thread

Re: [PATCH v4 3/3] usb: gadget: add f_uac1 variant based on a new u_audio api

Started byJulian Scheel <julian@jusst.de>
First post2017-05-26 18:00 +0200
Last post2017-05-30 02:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v4 3/3] usb: gadget: add f_uac1 variant based on a new  u_audio api Julian Scheel <julian@jusst.de> - 2017-05-26 18:00 +0200
    Re: [PATCH v4 3/3] usb: gadget: add f_uac1 variant based on a new  u_audio api Ruslan Bilovol <ruslan.bilovol@gmail.com> - 2017-05-30 02:10 +0200

#1651446 — Re: [PATCH v4 3/3] usb: gadget: add f_uac1 variant based on a new u_audio api

FromJulian Scheel <julian@jusst.de>
Date2017-05-26 18:00 +0200
SubjectRe: [PATCH v4 3/3] usb: gadget: add f_uac1 variant based on a new u_audio api
Message-ID<tLpOF-7Ks-7@gated-at.bofh.it>
On 18.05.2017 00:37, Ruslan Bilovol wrote:
> This patch adds a new function 'f_uac1_acard'
> (f_uac1 with virtual "ALSA card") that
> uses recently created u_audio API. Comparing
> to legacy f_uac1 function implementation it
> doesn't require any real Audio codec to be
> present on the device. In f_uac1_acard audio
> streams are simply sinked to and sourced
> from a virtual ALSA sound card created
> using u_audio API.
> 
> Legacy f_uac1 approach is to write audio
> samples directly to existing ALSA sound
> card
> 
> f_uac1_acard approach is more generic/flexible
> one - create an ALSA sound card that
> represents USB Audio function and allows to
> be used by userspace application that
> may choose to do whatever it wants with the
> data received from the USB Host and choose
> to provide whatever it wants as audio data
> to the USB Host.
> 
> f_uac1_acard also has capture support (gadget->host)
> thanks to easy implementation via u_audio.
> By default, capture interface has 48000kHz/2ch
> configuration, same as playback channel has.
> 
> f_uac1_acard descriptors naming convention
> uses f_uac2 driver naming convention that
> makes it more common and meaningful.
> 
> Comparing to f_uac1, the f_uac1_acard doesn't
> have volume/mute functionality. This is because
> the f_uac1 volume/mute feature unit was dummy
> implementation since that driver creation (2009)
> and never had any real volume control or mute
> functionality, so there is no any difference
> here.
> 
> Since f_uac1_acard functionality, exposed
> interface to userspace (virtual ALSA card),
> input parameters are so different comparing
> to legace f_uac1, that there is no any
> reason to keep them in the same file/module,
> and separate function was created.
> 
> g_audio can be built using one of existing
> UAC functions (f_uac1, f_uac1_acard or f_uac2)
> 
> Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
> ---
>   .../ABI/testing/configfs-usb-gadget-uac1_acard     |  14 +
>   Documentation/usb/gadget-testing.txt               |  45 ++
>   drivers/usb/gadget/Kconfig                         |  21 +
>   drivers/usb/gadget/function/Makefile               |   2 +
>   drivers/usb/gadget/function/f_uac1_acard.c         | 803 +++++++++++++++++++++
>   drivers/usb/gadget/function/u_uac1_acard.h         |  41 ++
>   drivers/usb/gadget/legacy/Kconfig                  |  15 +-
>   drivers/usb/gadget/legacy/audio.c                  |  53 ++
>   8 files changed, 992 insertions(+), 2 deletions(-)
>   create mode 100644 Documentation/ABI/testing/configfs-usb-gadget-uac1_acard
>   create mode 100644 drivers/usb/gadget/function/f_uac1_acard.c
>   create mode 100644 drivers/usb/gadget/function/u_uac1_acard.h
> 

Tested on iMX7D using chipidea usb gadget controller. Tested Windows 10 
and Linux 4.11 as host. Both work fine.

Tested-by: Julian Scheel <julian@jusst.de>

[toc] | [next] | [standalone]


#1652746

FromRuslan Bilovol <ruslan.bilovol@gmail.com>
Date2017-05-30 02:10 +0200
Message-ID<tMCTw-7FU-3@gated-at.bofh.it>
In reply to#1651446
On Fri, May 26, 2017 at 6:52 PM, Julian Scheel <julian@jusst.de> wrote:
> On 18.05.2017 00:37, Ruslan Bilovol wrote:
>>
>> This patch adds a new function 'f_uac1_acard'
>> (f_uac1 with virtual "ALSA card") that
>> uses recently created u_audio API. Comparing
>> to legacy f_uac1 function implementation it
>> doesn't require any real Audio codec to be
>> present on the device. In f_uac1_acard audio
>> streams are simply sinked to and sourced
>> from a virtual ALSA sound card created
>> using u_audio API.
>>
>> Legacy f_uac1 approach is to write audio
>> samples directly to existing ALSA sound
>> card
>>
>> f_uac1_acard approach is more generic/flexible
>> one - create an ALSA sound card that
>> represents USB Audio function and allows to
>> be used by userspace application that
>> may choose to do whatever it wants with the
>> data received from the USB Host and choose
>> to provide whatever it wants as audio data
>> to the USB Host.
>>
>> f_uac1_acard also has capture support (gadget->host)
>> thanks to easy implementation via u_audio.
>> By default, capture interface has 48000kHz/2ch
>> configuration, same as playback channel has.
>>
>> f_uac1_acard descriptors naming convention
>> uses f_uac2 driver naming convention that
>> makes it more common and meaningful.
>>
>> Comparing to f_uac1, the f_uac1_acard doesn't
>> have volume/mute functionality. This is because
>> the f_uac1 volume/mute feature unit was dummy
>> implementation since that driver creation (2009)
>> and never had any real volume control or mute
>> functionality, so there is no any difference
>> here.
>>
>> Since f_uac1_acard functionality, exposed
>> interface to userspace (virtual ALSA card),
>> input parameters are so different comparing
>> to legace f_uac1, that there is no any
>> reason to keep them in the same file/module,
>> and separate function was created.
>>
>> g_audio can be built using one of existing
>> UAC functions (f_uac1, f_uac1_acard or f_uac2)
>>
>> Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
>> ---
>>   .../ABI/testing/configfs-usb-gadget-uac1_acard     |  14 +
>>   Documentation/usb/gadget-testing.txt               |  45 ++
>>   drivers/usb/gadget/Kconfig                         |  21 +
>>   drivers/usb/gadget/function/Makefile               |   2 +
>>   drivers/usb/gadget/function/f_uac1_acard.c         | 803
>> +++++++++++++++++++++
>>   drivers/usb/gadget/function/u_uac1_acard.h         |  41 ++
>>   drivers/usb/gadget/legacy/Kconfig                  |  15 +-
>>   drivers/usb/gadget/legacy/audio.c                  |  53 ++
>>   8 files changed, 992 insertions(+), 2 deletions(-)
>>   create mode 100644
>> Documentation/ABI/testing/configfs-usb-gadget-uac1_acard
>>   create mode 100644 drivers/usb/gadget/function/f_uac1_acard.c
>>   create mode 100644 drivers/usb/gadget/function/u_uac1_acard.h
>>
>
> Tested on iMX7D using chipidea usb gadget controller. Tested Windows 10 and
> Linux 4.11 as host. Both work fine.
>
> Tested-by: Julian Scheel <julian@jusst.de>

Thanks for testing it.

I'll wait for additional reviews/comments next few days and than will
send new patchset with addressed comments.

Also current patchset have minor conflict when applied on top of
Felipe's testing/next branch which is moved to 4.12-rc1. I've
resolved conflict but did only build test so far.
Anyway I uploaded rebased patches to github [1] if anybody
wants to try them.

[1] https://github.com/rbilovol/kernel/commits/usbaudio-v4.12-balbi-testing-next

Best regards,
Ruslan

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web