alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
To: Jassi Brar <jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: balbi-l0cyMroinI0@public.gmane.org,
	Jassi Brar
	<jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	gregkh-l3A5Bk7waGM@public.gmane.org,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
	zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	yadi.brar01-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH 2/2] USB: Gadget: Add Audio Class 2.0 Driver
Date: Mon, 22 Aug 2011 16:46:28 +0300	[thread overview]
Message-ID: <20110822134627.GP30398@legolas.emea.dhcp.ti.com> (raw)
In-Reply-To: <CABb+yY3QxvHf38-qfD5ig77nJK=0eVLiSPVpbTh_DCfHNGRyGQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2336 bytes --]

Hi,

On Mon, Aug 22, 2011 at 06:30:36PM +0530, Jassi Brar wrote:
> > I understand your point, but then we will have two gadget drivers (and
> > two function drivers) for the same thing (USB Audio), it's the same
> > thing with the storage gadgets and we have decided on dropping one of
> > them recently, so I'm not keen on accepting another gadget driver which
> > will essentially do the same thing.
> No dear, not the same thing.
> As I said, they differ by features as well as USB-Spec... only the
> 'audio' thing is common.

and that's what I meant by same thing. How different is UAC_1 from
UAC_2.

> > If audio2.c can achieve audio.c's functionality, then you can start by
> > re-factoring audio.c so that it come closer to what audio2.c is today.
> audio.c and audio2.c have almost nothing in common. Please have a look
> at the code.
> Making audio.c closer to audio2.c would mean :-
>   * Changing all of the descriptors of audio.c {uac_1 -> uac_2}
>   * Removing all alsa related code and adding virtual alsa sound card.
>  At the end, audio.c would have been changed completely and Linux-usb-gadget
> lost the UAC_1 compliance.

it shouldn't loose compliance. If it does it was probably not done
right.

> > WRT UAC_1/UAC_2 compliance, you can use a Kconfig entry, or two separate
> > USB configurations (one with UAC_1 and another UAC_2). So there are ways
> > to make this all work while still keeping backwards compatibility.
> IIUC, you mean adding UAC_2 compliance and virtual sound-card i/f to
> audio.c, while
> preserving the it's original functionality ?

yes.

> But that would mean having two drivers in one file, because they are
> so different.

then make only a differnt function driver, f_uac2.c, which gets added as
another interface (or configuration) to audio.c.

> Otherwise, please have a look at audio.c and audio2.c and suggest what
> exactly you mean.

audio.c doesn't do anything audio related. It's just adding the
configuration to composite layer. The real specification is implemented
in f_audio.c (should probably be called f_uac1.c, though).

Then only thing different between audio.c and audio2.c is bDeviceClass,
bDeviceSubClass and bDeviceProtocol, but that can be easily handled with
Kconfig choice and/or module parameter.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

  parent reply	other threads:[~2011-08-22 13:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-19 11:22 [PATCH 2/2] USB: Gadget: Add Audio Class 2.0 Driver Jassi Brar
     [not found] ` <1313752934-20081-1-git-send-email-jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-08-22 11:30   ` Felipe Balbi
     [not found]     ` <20110822113002.GD30398-UiBtZHVXSwEVvW8u9ZQWYwjfymiNCTlR@public.gmane.org>
2011-08-22 12:37       ` Jassi Brar
     [not found]         ` <CAJe_Zhdb7d23_x=1GWV2EnEjdn69XBKEz+hCeCuBx4v9XAmykg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-08-22 12:44           ` Felipe Balbi
2011-08-22 13:00             ` Jassi Brar
     [not found]               ` <CABb+yY3QxvHf38-qfD5ig77nJK=0eVLiSPVpbTh_DCfHNGRyGQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-08-22 13:46                 ` Felipe Balbi [this message]
     [not found]                   ` <20110822134627.GP30398-UiBtZHVXSwEVvW8u9ZQWYwjfymiNCTlR@public.gmane.org>
2011-08-22 14:00                     ` Jassi Brar
     [not found]                       ` <CABb+yY2m2MfkFwf+XTdKzsCCeSFz_J2LoGxJricamhNtTcSAcg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-08-22 14:28                         ` Felipe Balbi
     [not found]                           ` <20110822142805.GT30398-UiBtZHVXSwEVvW8u9ZQWYwjfymiNCTlR@public.gmane.org>
2011-08-22 14:29                             ` Felipe Balbi
2012-02-02 16:19                             ` Jassi Brar
     [not found]                               ` <CABb+yY3X0XDk0zByZZcJOO0h2Kxu14UD4w-GS7p1HPAAWU3SVA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-02 16:29                                 ` [PATCH 1/4] USB: Gadget: Rename audio function to uac1 Jassi Brar
2012-02-15  8:12                                   ` Felipe Balbi
2012-02-02 16:30                                 ` [PATCH 2/4] USB: UAC2: Add ACHeader and FormatType descriptor Jassi Brar
2012-02-02 16:31                                 ` [PATCH 3/4] USB: Gadget: Audio: Move string IDs to audio.c Jassi Brar
2012-02-02 16:31                                 ` [PATCH 4/4] USB: Gadget: Add Audio Class 2.0 Driver Jassi Brar
2011-08-24  2:00   ` [PATCH 2/2] " Chen Peter-B29397
     [not found]     ` <35AB98346D25394A9354ED89C4D7658717FD0C-TcFNo7jSaXOLgTCmFNXF2K4g8xLGJsHaLnY5E4hWTkheoWH0uzbU5w@public.gmane.org>
2011-08-24  4:22       ` Jassi Brar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110822134627.GP30398@legolas.emea.dhcp.ti.com \
    --to=balbi-l0cymroini0@public.gmane.org \
    --cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
    --cc=gregkh-l3A5Bk7waGM@public.gmane.org \
    --cc=jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=yadi.brar01-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).