[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ALSA device names.



On Tue 09 Nov 2021 at 23:04:13 (+0100), deloptes wrote:
> peter@easthope.ca wrote:
> 
> > OK, although
> > surround21:CARD=Set,DEV=0
> > and
> > surround40:CARD=Set,DEV=0
> > aren't atomic names.  Is the syntax and semantics explained in
> > documentation?
> > 
> > No surround22, surround23 ... surround39 evident here. How does ALSA
> > derive or find the names and numbers?
> 
> you hopefully know that sourround21 stands there for 2+1 and 40 stands for 4
> outputs
> Also it is explained in documents like for example on the alsa-project web
> site
> https://alsa-project.org/wiki/DeviceNames
> 
> I sometimes wonder if some peoples google is broken. For me it worked quite
> well. I type in "ALSA device name"
> 
> another excellent reading is
> https://wiki.archlinux.org/title/Advanced_Linux_Sound_Architecture

And you can also read the channel mappings in the kernel's
sound/hda/hdmi_chmap.c. So these names are invented by the ALSA
modules in the kernel.

> > What is meant by CARD=Set?

You enumerated your sound cards a while back:

> > root@joule:~# cat /proc/asound/cards
> >  0 [ICH5        ]: ICH4 - Intel ICH5
> >                    Intel ICH5 with AD1980 at irq 17
> >  1 [Live        ]: EMU10K1X - Dell Sound Blaster Live!
> >                    Dell Sound Blaster Live! at 0xdf20 irq 22
> >  2 [U0x46d0x807 ]: USB-Audio - USB Device 0x46d:0x807
> >                    USB Device 0x46d:0x807 at usb-0000:03:08.2-3, high speed
> >  3 [Set         ]: USB-Audio - C-Media USB Headphone Set
> >                    C-Media USB Headphone Set at usb-0000:00:1d.0-2, full speed

so Set is the headphones. Nowadays, sound "cards" often aren't
actual cards, but just part of a chipset, like the SouthBridge, which
can handle virtually everything in a PC that is "slow", ie all but
the CPU and memory.

I think the names after the : are in the kernel module's source and
object code, and are passed to ALSA, which then generates a set of
shortnames for you to use, avoiding any name collisions.

> > DEV=0 turns up frequently.  What's the point?  DEV=1?

Again, you enumerated the devices on your EMU10K1X card:

> > dmix:CARD=Live,DEV=0
> >     Dell Sound Blaster Live!, EMU10K1X Front
> >     Direct sample mixing device
> > dmix:CARD=Live,DEV=1
> >     Dell Sound Blaster Live!, EMU10K1X Rear
> >     Direct sample mixing device
> > dmix:CARD=Live,DEV=2
> >     Dell Sound Blaster Live!, EMU10K1X Center/LFE
> >     Direct sample mixing device

On one of my computers, there's a separate headphone output in
the ICH10, which it calls DEV=2.

I have found that HDMI cards with multiple DEV devices can be
awkward to pin down, sound sometimes coming from DEV=0, and
sometimes DEV=1. I use a trick to flip between them, but I've
read that pulseaudio is meant to be able to detect which is the
one to use. I've not read enough to know the details.

> > Incidentally, the AUDIODEV variable is a distraction.  Rather than 
> > mess with it, specify the device directly.
> > sox noise.WAV -t alsa plughw:CARD=ICH5,DEV=0 gain 1

I thought AUDIODEV was specific to sox. The idea is that applications
or scripts that use sox can always use "default", and different
machines can be set up with AUDIODEV pointing to the appropriate
device, all without changing the script or whatever. It could even
allow them not to have deal with reading/setting any device options.

Cheers,
David.


Reply to: