Re: [LAU] Alsa setup question

From: <hollundertee@email-addr-hidden>
Date: Mon May 04 2015 - 00:02:14 EEST

On Sat, 2 May 2015 17:11:05 +0200
<hollundertee@email-addr-hidden> wrote:

> On Sat, 2 May 2015 16:41:06 +0200
> Ralf Mardorf <ralf.mardorf@email-addr-hidden-dsl.net> wrote:
>
> > On Sat, 2 May 2015 14:53:16 +0200, hollundertee@email-addr-hidden wrote:
> > >Luckily there is ~/.asoundrc, but I'd still like to know what the
> > >hell is going on.
> >
> > "# A simple script to create a particular default audio device
> > regardless # of what cards are loaded or in what order. It could be
> > used anytime or # placed in a ~/.bashrc script for a persistent
> > setup every login." -
> > http://alsa.opensrc.org/Asoundrc#Default_PCM_device
> >
> > So this way you get the available device as default device?
>
> Thanks Ralf,
>
> that may work in combination with the static ID (not tested yet).
> Without static ID it will fail, since it just picks the first one it
> finds as default.
>
> I think I managed to fix the udev-rule based variant. Will need to
> test some more though.
>
> Regards,
> Philipp

Well, it does not work. This is what my asound.conf looks like after
boot with usb device plugged in:
$ cat /etc/asound.conf
defaults.ctl.card 0
defaults.pcm.card 1
defaults.pcm.card 0
defaults.pcm.card 0
defaults.pcm.card 1
defaults.pcm.card 1
defaults.pcm.card 1

This is what I would like to have:
defaults.ctl.card 0
defaults.pcm.card 0

These are the udev rules, any idea what's wrong with them?
$ cat /etc/udev/rules.d/00-local.rules
KERNEL=="pcmC[D0-9cp]*", ACTION=="add", PROGRAM="/bin/sh -c 'K=%k; K=$${K#pcmC}; K=$${K%%D*}; echo defaults.ctl.card $$K > /etc/asound.conf; echo defaults.pcm.card $$K >>/etc/asound.conf'"
KERNEL=="pcmC[D0-9cp]*", ACTION=="remove", PROGRAM="/bin/sh -c 'echo defaults.ctl.card 1 > /etc/asound.conf; echo defaults.pcm.card 1 >>/etc/asound.conf'"

Regards,
Philipp
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-user
Received on Mon May 4 00:15:02 2015

This archive was generated by hypermail 2.1.8 : Mon May 04 2015 - 00:15:02 EEST