neither /etc/asound.conf or ~/.asoundrc setup in package configuration

Bug #35669 reported by David Tansey
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
alsa-driver (Ubuntu)
New
Medium
Unassigned

Bug Description

I am planning on using ubuntu (currently dapper flight 5) in a recording studio. In order to do this I need jack server to be running. But it won't run because none of the alsa definitions are set. Here are my jackd -dalsa -dhw:1 errors:

ALSA lib confmisc.c:1107:(snd_func_refer) Unable to find definition 'defaults.pcm.device'
ALSA lib conf.c:3493:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib confmisc.c:242:(snd_func_getenv) error evaluating default
ALSA lib conf.c:3493:(_snd_config_evaluate) function snd_func_igetenv returned error: No such file or directory
ALSA lib conf.c:3951:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2099:(snd_pcm_open_noupdate) Unknown PCM hw:1
ALSA lib confmisc.c:1107:(snd_func_refer) Unable to find definition 'defaults.pcm.device'
ALSA lib conf.c:3493:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib confmisc.c:242:(snd_func_getenv) error evaluating default
ALSA lib conf.c:3493:(_snd_config_evaluate) function snd_func_igetenv returned error: No such file or directory
ALSA lib conf.c:3951:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2099:(snd_pcm_open_noupdate) Unknown PCM hw:1
ALSA: Cannot open PCM device alsa_pcm for playback. Falling back to capture-only mode
cannot load driver module alsa

the online suggestions i've gotten all say run alsaconf. I understand alsaconf is just a script that sets up the alsa config file(s). Shoudln't that be handled by alsa-base's configuration?

Thanks.

Revision history for this message
Daniel T Chen (crimsun) wrote : Malone #31699 (alsa-utils: asoundconf: gnome-control-center && default sound card)
Download full text (4.5 KiB)

Martin et al.,

I've done some further debugging for Malone #31699, and it appears that
the current fix for #35540 is insufficient (partially my fault). Some
applications expect defaults.pcm.device and defaults.pcm.subdevice,
which must be integers due to /usr/share/alsa/alsa.conf's use of
igetenv for .DEV and .SUBDEV. So to make all audio applications play
nicely together, we need to enumerate the following variables in
~/.asoundrc.asoundconf:

!defaults.pcm.card <string>
!defaults.ctl.card <string>
defaults.pcm.device <integer>
defaults.pcm.subdevice <integer>
[pcm.device <integer>]

Here's the breakdown: defaults.pcm.card and defaults.ctl.card can be
strings (as ``asoundconf list'', in which case the ! is required) or
integers (in which case the ! shouldn't appear). Currently gnome-
control-center sets these two variables, and most apps play nicely.
However, apps like jackd normally require a specific device (implying
that its subdevice must also be set), in which case defaults.pcm.device
and defaults.pcm.subdevice must also be set. The good news is that we
can get away with setting defaults.pcm.subdevice -1 (per definition in
/usr/share/alsa/alsa.conf) always, since apps will override it as
necessary.

I've currently been testing an ~/.asoundrc.asoundconf, and the above
variables for my current sound card configuration (only one on-board
Intel ICH6; the external USB M-Audio Transit is not present) are as
follows:

!defaults.pcm.card ICH6
!defaults.ctl.card ICH6
defaults.pcm.device 0
defaults.pcm.subdevice -1
pcm.device 1

so that I can use the on-board ICH6 by default and still use jackd with
either the onboard or the external usb sound device.

I've tested using both amixer and jackd with the above block (both with
and without pcm.device 1) as follows:

amixer && amixer -c0 && amixer -c1
jackd -d alsa && jackd -d alsa -dhw:0 && jackd -d alsa -dhw:1

The first two invocations of each program (i.e., amixer && amixer -c0
and jackd -d alsa && jackd -d alsa -dhw:0) work exactly as expected. I
am able to list the values of the mixer and successfully invoke jackd.
With pcm.device 1 present in ~/.asoundrc.asoundconf, I am able to
invoke the last set of each program (i.e., amixer -c1 and
jackd -d alsa -dhw:1) with the expected result that there is no such
device. I also receive identical results without pcm.device 1 present
in ~/.asoundrc.asoundconf.

The reason I mention additional "pcm.device"s is because of the
previously mentioned situation where a user may have multiple sound
cards detected and wish to have GNOME use a different default card from
say, jackd.

So, recap, and conclude with what we need to do to resolve #31699 and
its unfortunate duplicates:

At the very least ~/.asoundrc.asoundconf needs to have values for:

defaults.pcm.card
defaults.ctl.card
defaults.pcm.device
defaults.pcm.subdevice

I suggest we use the nominal default of -1 for defaults.pcm.subdevice,
continue using the strings for !defaults.{ctl,pcm}.card, and use an
integer for defaults.pcm.device. This means that gnome-control-center's
debian/patches/23_default_soundcard_selector.patch needs to be modified
such that set_default_card() also sets defaults.pcm.device and
...

Read more...

Revision history for this message
Stephan Michels (stephan-apache) wrote :

I had similar problems. My problem was that gnome-sound-properties didn't start esd. I got following output:

ALSA lib confmisc.c:1107:(snd_func_refer) Unable to find definition 'defaults.pcm.card'
ALSA lib conf.c:3493:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib confmisc.c:242:(snd_func_getenv) error evaluating default
ALSA lib conf.c:3493:(_snd_config_evaluate) function snd_func_getenv returned error: No such file or directory
ALSA lib conf.c:3951:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2102:(snd_pcm_open_noupdate) Unknown PCM default

That problem went away after I added to my .asoundrc.asoundconf:
defaults.pcm.device 0
defaults.pcm.subdevice -1
pcm.device 1

Now I have:
!defaults.pcm.card SoundSticks
defaults.ctl.card SoundSticks
defaults.pcm.device 0
defaults.pcm.subdevice -1
pcm.device 1

FYI, I have a mac mini with USB Harman Kardon Soundsticks.

Revision history for this message
Mike Fedyk (mfedyk) wrote :

> Here's the breakdown: defaults.pcm.card and defaults.ctl.card can be
> strings (as ``asoundconf list'', in which case the ! is required) or
> integers (in which case the ! shouldn't appear). Currently gnome-
> control-center sets these two variables, and most apps play nicely.
> However, apps like jackd normally require a specific device (implying
> that its subdevice must also be set), in which case defaults.pcm.device
> and defaults.pcm.subdevice must also be set. The good news is that we
> can get away with setting defaults.pcm.subdevice -1 (per definition in
> /usr/share/alsa/alsa.conf) always, since apps will override it as
> necessary.

How many apps don't play nice? Is it just jackd or is it a long list of misbehaving apps?

Since the number is being "overridden" anyway, why is its definition to any integer value necessary?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.