[patch] simple sysfs sound objects

David Zeuthen davidz at redhat.com
Fri Feb 11 08:02:57 PST 2005


On Thu, 2005-02-10 at 23:56 +0000, Richard Hughes wrote:
> On Thu, 2005-02-10 at 14:03 -0500, David Zeuthen wrote:
> > Not sure this is a good idea; the device files are used in different
> > ways, no? We might also want to call it alsa.* instead of sound.*, as
> > well as v4l.* instead of multimedia.*.
> 
> Something like?
> 
> alsa.can_record
> yes, bool

Suggest alsa.type = {control, playback, capture, midi, ...}

> alsa.has_mixer
> yes, bool

>From where do you get this information?

> 
> alsa.has_timer
> yes, bool

>From where do you get this information?

> 
> alsa.id
> yes, string

>From where do you get this information?

It seems a bit to me that you're mixing up the global settings of the
card with each device node that the card offers? E.g. on my IBM T41 I
have these device nodes

        [davidz at daxter hald]$ tree /sys/class/sound/pcmC*
        /sys/class/sound/pcmC0D0c
        |-- dev
        |-- device -> ../../../devices/pci0000:00/0000:00:1f.5
        `-- driver -> ../../../bus/pci/drivers/Intel ICH
        /sys/class/sound/pcmC0D0p
        |-- dev
        |-- device -> ../../../devices/pci0000:00/0000:00:1f.5
        `-- driver -> ../../../bus/pci/drivers/Intel ICH
        /sys/class/sound/pcmC0D1c
        |-- dev
        |-- device -> ../../../devices/pci0000:00/0000:00:1f.5
        `-- driver -> ../../../bus/pci/drivers/Intel ICH
        /sys/class/sound/pcmC0D2c
        |-- dev
        |-- device -> ../../../devices/pci0000:00/0000:00:1f.5
        `-- driver -> ../../../bus/pci/drivers/Intel ICH
        /sys/class/sound/pcmC0D3c
        |-- dev
        |-- device -> ../../../devices/pci0000:00/0000:00:1f.5
        `-- driver -> ../../../bus/pci/drivers/Intel ICH
        /sys/class/sound/pcmC0D4p
        |-- dev
        |-- device -> ../../../devices/pci0000:00/0000:00:1f.5
        `-- driver -> ../../../bus/pci/drivers/Intel ICH
        /sys/class/sound/pcmC1D0c
        |-- dev
        |-- device -> ../../../devices/pci0000:00/0000:00:1f.6
        `-- driver -> ../../../bus/pci/drivers/Intel ICH Modem
        /sys/class/sound/pcmC1D0p
        |-- dev
        |-- device -> ../../../devices/pci0000:00/0000:00:1f.6
        `-- driver -> ../../../bus/pci/drivers/Intel ICH Modem
        
So I suspect that for each physical device, the modem and the sound
card, I'll get respectively four and two hal device objects of
capability alsa. 

I think it's fine to duplicate some information on each device object
such as /proc/asound/cardN/id as alsa.id. I guess you can find N by just
looking at the kernel name, e.g. pcmC1D0p would yield a N of 1 while
pcmC42D0p would yield a N of 42 and so on.

But I don't know much about ALSA so you may come up with something even
better!

David


_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list