Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lennart Poettering <mznyfn@0pointer.de>
To: alsa-devel@alsa-project.org
Subject: Re: [PATCH] control, hw, rawmidi: accept control	device node as card identifier when opening
Date: Tue, 12 May 2009 14:29:42 +0200	[thread overview]
Message-ID: <20090512122942.GA29607@tango.0pointer.de> (raw)
In-Reply-To: <alpine.LNX.2.00.0905120744260.25064@eeebox2.perex-int.cz>

On Tue, 12.05.09 08:09, Jaroslav Kysela (perex@perex.cz) wrote:

> 
> On Tue, 12 May 2009, Lennart Poettering wrote:
> 
> > Heya!
> >
> > Traditionally low-level ALSA devices are opened with device strings like
> > 'hw:CARD' where CARD is either a numeric index or a card name. This
> > patch introduces a third syntax that allows you to specify the file name
> > of the control device node. The purpose for this is to make ALSA a bit
> > more like other Linux devices and allow implementaiton of udev device
> > symlinks similar to how disks are currently handled, with
> > /dev/disk/by-path/xxxx /dev/disk/by-id/xxxx and so on.
> >
> > With this patch this line:
> >
> >  aplay -f CD -D hw:/dev/snd/controlC0 < /dev/urandom
> >
> > becomes equivalent to this line:
> >
> >  aplay -f CD -D hw:0 < /dev/urandom
> >
> > A more useful example is this:
> >
> >  aplay -f CD -D hw:/dev/snd/by-path/pci-0000:00:1a.7-usb-0:2:1.2
> >
> > (this line requires a a few additional udev rules)
> >
> > This only works for control devices nodes, not for PCM or any other
> > device nodes. Since the control device node is used as 'entry point'
> > when opening PCM devices this is no limitation.
> 
> NAK. Passing control device to open() functions is not a good idea. 

Why? Please elaborate!

The whole point of this patch is to allow users to write struff like
hw:/dev/snd/by-path/pci-0000:00:1a.7-usb-0:2:1.2 whereever they could
otherwise write hw:0. Why is that a bad idea?

> The snd_card_get_index() function might be extended to allow /dev
> style argument. Returned card index can be used as argument for hw:
> devices without this massive change.

This is no improvement at all, because no application does that. The
point of the patch was to improve the flexibility for all
applications. 

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/           GnuPG 0x1A015CC4

      parent reply	other threads:[~2009-05-12 12:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-11 22:41 [PATCH] control, hw, rawmidi: accept control device node as card identifier when opening Lennart Poettering
2009-05-12  6:09 ` Jaroslav Kysela
2009-05-12 11:40   ` Jaroslav Kysela
2009-05-12 12:32     ` Lennart Poettering
2009-05-12 12:42       ` Jaroslav Kysela
2009-05-12 13:24         ` Lennart Poettering
2009-05-12 14:40           ` Jaroslav Kysela
2009-05-12 16:04             ` Lennart Poettering
2009-05-12 16:54               ` Jaroslav Kysela
2009-05-12 12:29   ` Lennart Poettering [this message]

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=20090512122942.GA29607@tango.0pointer.de \
    --to=mznyfn@0pointer.de \
    --cc=alsa-devel@alsa-project.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