public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Felipe Balbi <balbi@kernel.org>
Cc: Ruslan Bilovol <ruslan.bilovol@gmail.com>,
	Alan Stern <stern@rowland.harvard.edu>,
	Daniel Mack <zonque@gmail.com>,
	Jassi Brar <jassisinghbrar@gmail.com>,
	Clemens Ladisch <clemens@ladisch.de>,
	Jonathan Corbet <corbet@lwn.net>,
	Peter Chen <hzpeterchen@gmail.com>,
	Julian Scheel <julian@jusst.de>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	linux-doc@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 0/3] USB Audio Gadget refactoring
Date: Tue, 6 Jun 2017 09:44:32 +0200	[thread overview]
Message-ID: <20170606074432.GA10232@kroah.com> (raw)
In-Reply-To: <87h8zuu6uy.fsf@linux.intel.com>

On Mon, Jun 05, 2017 at 12:22:13PM +0300, Felipe Balbi wrote:
> 
> Hi,
> 
> Ruslan Bilovol <ruslan.bilovol@gmail.com> writes:
> >> Ruslan Bilovol <ruslan.bilovol@gmail.com> writes:
> >>> I came to this patch series when wanted to do two things:
> >>>  - use UAC1 as virtual ALSA sound card on gadget side,
> >>>    just like UAC2 is used so it's possible to do rate
> >>>    resampling
> >>>  - have both playback/capture support in UAC1
> >>>
> >>> Since I wanted to have same behavior for both UAC1/UAC2,
> >>> obviously I've got an utility part (u_audio.c) for
> >>> virtual ALSA sound card handling like we have
> >>> for ethernet(u_ether) or serial(u_serial) functions.
> >>> Function-specific parts (f_uac1/f_uac2) became almost
> >>> as storage for class-specific USB descriptors, some
> >>> boilerplate for configfs, binding and few USB
> >>> config request handling.
> >>>
> >>> Originally in RFC [1] I've posted before, there was
> >>> major change to f_uac1 after that it couldn't do
> >>> direct play to existing ALSA sound card anymore,
> >>> representing audio on gadget side as virtual
> >>> ALSA sound card where audio streams are simply
> >>> sinked to and sourced from it, so it may break
> >>> current usecase for some people (and that's why
> >>> it was RFC).
> >>>
> >>> During RFC discussion, it was agreed to not touch
> >>> existing f_uac1 implementation and create new one
> >>> instead. This patchset (v4) introduced new function
> >>> named f_uac1_acard and doesn't touch current f_uac1
> >>> implementation, so people still can use old behavior
> >>
> >> Do you have a pointer to the original RFC discussion where this was
> >> discussed? If we really *must* keep the old implementation, I would
> >> rather rename that to f_uac1_legacy. Still, I find it unlikely that
> >> anybody will care about the old implementation.
> >
> > It is on LKML (which is down for me) [1] or alternative archive [2]
> >
> >>
> >>> Now, it's possible to use existing user-space
> >>> applications for audio routing between Audio Gadget
> >>> and real sound card. I personally use alsaloop tool
> >>> from alsautils and have ability to create PCM
> >>> loopback between two different ALSA cards using
> >>> rate resampling, which was not possible with previous
> >>> "direct play to ALSA card" approach in f_uac1.
> >>
> >> this is really good result and will actually make it a lot easier for
> >> testing things out.
> >>
> >>> While here, also dropped redundant platform
> >>> driver/device creation in f_uac2 driver (as well as
> >>> didn't add "never implemented" volume/mute functionality
> >>> in f_uac1 to f_uac1_acard) that made this work even
> >>> easier to do.
> >>>
> >>> This series is tested with both legacy g_audio.ko and
> >>> modern configfs approaches under Ubuntu 14.04 (UAC1 and
> >>> UAC2) and under Windows7 x64 (UAC1 only) having
> >>> perfect results in all cases.
> >>>
> >>> Comments, testing are welcome.
> >>>
> >>> v4 changes:
> >>>  - renamed f_uac1_newapi to f_uac1_acard that is
> >>>    more meaningful
> >>
> >> I really don't get why you wanna keep both f_uac1 and f_uac1_acard. Why
> >> do we need to maintain the old uac1 implementation? Why two separate
> >> files?
> >
> > In first RFC ([1],[2]) I did exactly what you wrote here (removed
> > old uac1 implementation and replaced it by new one) but got feedback
> > that it will break things for existing f_uac1 legacy users and it's better to
> > have separate implementation.
> >
> > I'm OK with dropping legacy f_uac1 implementation.
> >
> > Another idea I was thinking about is to implement simple in-kernel
> > driver which will do the same as existing alsaloop tool userspace
> > tool does (so legacy users will need to load two kernel modules
> > and get same functionality). But this seems to be a wrong way,
> > since It known that Linux kernel community doesn't like to take drivers
> > with same functionality as existing userspace tools already have.
> >
> > So bottom line: since I'm not a legacy f_uac1 user, there is no
> > difference for me how to handle it - remove legacy f_uac1 completely,
> > rename it to f_uac1_legacy or add separate f_uac1_acard function.
> >
> > So if dropping of legacy f_uac1 implementation is OK for you,
> > I can do it quickly in next patchset.
> 
> Personally, I don't want duplicated functionality and I think the
> virtual sound card approach is much better. Then again, removing
> functionality we already support is kind of odd.
> 
> Greg, Alan, what do you guys think? Do we keep a duplicated function
> around or do we just tell people to rely on alsaloop? Personally, I
> think we're better off with the flexibility of the virtual sound card,
> what's your take?

If the in-kernel driver will do more things, and we don't break the
existing setups using alsaloop, then I don't see the problem, except
that we now have to maintain two things :)

If you don't mind the maintenance, fine with me...

thanks,

greg k-h

  reply	other threads:[~2017-06-06  7:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-17 22:37 [PATCH v4 0/3] USB Audio Gadget refactoring Ruslan Bilovol
2017-05-17 22:37 ` [PATCH v4 1/3] usb: gadget: f_uac2: remove platform driver/device creation Ruslan Bilovol
2017-05-17 22:37 ` [PATCH v4 2/3] usb: gadget: f_uac2: split out audio core Ruslan Bilovol
2017-05-22 15:58   ` Jassi Brar
2017-05-29 23:43     ` Ruslan Bilovol
2017-06-02 11:47       ` Jassi Brar
2017-06-02  9:34   ` Felipe Balbi
2017-06-02 21:11     ` Ruslan Bilovol
2017-05-17 22:37 ` [PATCH v4 3/3] usb: gadget: add f_uac1 variant based on a new u_audio api Ruslan Bilovol
2017-05-26 15:52   ` Julian Scheel
2017-05-30  0:07     ` Ruslan Bilovol
2017-06-02  9:42 ` [PATCH v4 0/3] USB Audio Gadget refactoring Felipe Balbi
2017-06-02 21:36   ` Ruslan Bilovol
2017-06-05  9:22     ` Felipe Balbi
2017-06-06  7:44       ` Greg KH [this message]
2017-06-06  9:41         ` Felipe Balbi
2017-06-06 19:43           ` Ruslan Bilovol

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=20170606074432.GA10232@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=balbi@kernel.org \
    --cc=clemens@ladisch.de \
    --cc=corbet@lwn.net \
    --cc=hzpeterchen@gmail.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=julian@jusst.de \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=ruslan.bilovol@gmail.com \
    --cc=stern@rowland.harvard.edu \
    --cc=zonque@gmail.com \
    /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