All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Daniel Mack <zonque@gmail.com>
Cc: alsa-devel@alsa-project.org,
	=?UTF-8?B?QXVyw6lsaWVuIExlYmxv?=@alsa-project.org,
	"Takashi Iwai" <tiwai@suse.de>,
	"Grant Diffey" <gdiffey@gmail.com>,
	"Felix Homann" <linuxaudio@showlabor.de>, nd <blablack@gmail.com>
Subject: Re: M-Audio FTU issues
Date: Mon, 25 Jul 2011 15:07:56 +0200	[thread overview]
Message-ID: <4E2D6AAC.7010707@ladisch.de> (raw)
In-Reply-To: <BANLkTinurcpMuPe-99GsaxWk+pF-K4Z_7Q@mail.gmail.com>

(Sorry for the delay, I don't have much free time.)

Daniel Mack wrote:
> On Fri, Jun 24, 2011 at 5:58 PM, Clemens Ladisch <clemens@ladisch.de> wrote:
> > I think the best solution would be to move the USB streaming into
> > a module, add implicit feedback support there, and create a separate
> > driver for the FTU and similar devices.
> 
> However, I'm not sure whether making a special driver for the FTU is
> really the way to go. Even though I haven't seen any device around yet
> that implements this in a class-compliant way, this type of streaming
> model is in fact part of the USB Audio specification, at least in
> version 2. It's more than likely that there will be more devices
> around in the future, and so it would be good to have support for it
> in the standard driver.

Only the parts that are different would go into the separate drivers.
This would be device detection, parsing of the descriptors, stream
management and configuration (i.e., choosing and setting alternate
settings, and class-specific interface/endpoint requests), and most of
the interfacing with the ALSA framework.  (USB Audio 1.0 and 2.0 are not
really compatible, so the latter might become a separate driver, too.)

Common parts (snd-usb-lib) would be the actual streaming (sending/
receiving packets, buffer handling), and whatever random stuff turns
out to be needed by multiple drivers.

> Can you outline how the API will look like?

Something like this:

	struct usb_pcm_stream;

	usb_pcm_stream_init(stream, snd_pcm_stream, usb_device, flags);
	usb_pcm_stream_destroy(stream);

	usb_pcm_stream_configure(stream, endpoint, rate, format);
	usb_pcm_stream_set_clock_source(stream, master_stream);

	usb_pcm_stream_start(stream);
	usb_pcm_stream_stop(stream);

	// helpers to implement ALSA PCM callbacks
	usb_pcm_stream_pcm_prepare(stream);
	usb_pcm_stream_pcm_trigger(stream, start);
	usb_pcm_stream_pcm_pointer(stream);

(There are obvious similarities with firewire/amdtp.c.)

As far as I can tell, this affects mostly urb.c.


Regards,
Clemens

  parent reply	other threads:[~2011-07-25 13:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-24  1:14 M-Audio FTU issues Daniel Mack
2011-06-24  3:27 ` Grant Diffey
2011-06-24  7:35 ` Felix Homann
2011-06-24  8:52 ` Felix Homann
2011-06-24 15:23   ` Daniel Mack
2011-06-24 15:58     ` Clemens Ladisch
2011-06-24 16:10       ` Daniel Mack
2011-06-28 20:37         ` Aurélien Leblond
2011-06-29  8:08           ` Daniel Mack
2011-07-03 11:52             ` Grant Diffey
2011-07-04 17:14               ` Aurélien Leblond
2011-07-04 17:23               ` Daniel Mack
2011-07-13 21:18               ` Juan Pablo Bouza
2011-07-21  5:08               ` Juan Pablo Bouza
2011-07-21  7:55                 ` Daniel Mack
2011-07-21  8:25                   ` Felix Homann
2011-07-24 14:12                     ` Aurélien Leblond
2011-07-24 14:46                       ` Daniel Mack
2011-07-21 20:31                   ` Juan Pablo Bouza
2011-07-22  8:42                     ` Daniel Mack
2011-07-23  4:25                       ` Juan Pablo Bouza
2011-07-25 13:07         ` Clemens Ladisch [this message]
2011-06-27  8:52     ` Felix Homann
2011-06-24  9:08 ` Felix Homann

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=4E2D6AAC.7010707@ladisch.de \
    --to=clemens@ladisch.de \
    --cc==?UTF-8?B?QXVyw6lsaWVuIExlYmxv?=@alsa-project.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=blablack@gmail.com \
    --cc=gdiffey@gmail.com \
    --cc=linuxaudio@showlabor.de \
    --cc=tiwai@suse.de \
    --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 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.