• Ruslan Bilovol's avatar
    usb: gadget: add f_uac1 variant based on a new u_audio api · 0591bc23
    Ruslan Bilovol authored
    This patch adds a new function 'f_uac1'
    (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 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 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 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 descriptors naming convent...
    0591bc23
configfs-usb-gadget-uac1 425 Bytes