Re: ALSA device names.

2021-11-10 Thread David Wright
On Tue 09 Nov 2021 at 23:04:13 (+0100), deloptes wrote:
> pe...@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-:03:08.2-3, high speed
> >  3 [Set ]: USB-Audio - C-Media USB Headphone Set
> >C-Media USB Headphone Set at usb-: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.



Re: ALSA device names.

2021-11-09 Thread deloptes
pe...@easthope.ca wrote:

> 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

-- 
FCD6 3719 0FFB F1BF 38EA 4727 5348 5F1F DCFE BCB0



ALSA device names.

2021-11-09 Thread peter
Ref. https://lists.debian.org/debian-user/2021/09/msg01112.html
Subject: Re: Persistent names for audio devices.
From: David Wright 
Date: Wed, 29 Sep 2021 22:35:11 -0500
Message-id: <20210930033511.gc22...@axis.corp>
References:  
<_Vy48xSpy3r0uj8kBgbIiS_l-GGEeoinqJc5I64K4YfKpqSs7HJIz4-v6PvMpeJ609TFiLSqSiG2VbElSR5NzLAiMqSkwAjFCHI1gK1NNlc=@protonmail.com>
  <[] 20210928233134.ga22...@axis.corp> <[] 
E1mVfDB-cu-IE@joule.invalid>

> I think this thread has been around for a couple of years now.
> I assume the penny dropped that names like Live and ICH5 are
> the persistent items you were looking for.

Yah, 2019-10-20 a guinea wore a hole through my pocket and fell 
down a sewer grate.  =8~|  https://en.wikipedia.org/wiki/Guinea_(coin)

Ref. https://lists.debian.org/debian-user/2019/10/msg00743.html
Subject: Re: Unidentified subject!
From: Reco 
Date: Sun, 20 Oct 2019 18:23:08 +0300
Message-id: 
References:  


> Use "aplay -L" to get strings that are specific for your hardware.
> The way I see it, there's no need for these "predictable audio devices
> names", they are here already.

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?

What is meant by CARD=Set?

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

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

Regards & thanks for the multiple earlier replies,
... P.

-- 
mobile: +1 778 951 5147
  VoIP: +1 604 670 0140
   48.7693 N 123.3053 W