asoundconf causes disruption to programs that expect other defaults in ALSA config files
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
alsa-utils (Ubuntu) |
New
|
Medium
|
Unassigned |
Bug Description
I have deduced that when using alsaconf, some programs are looking for definitions in ~/.asoundrc.
1) with ~/.asoundrc.
2) without.
I have no other definitions in ~/.asoundrc, but without the inclusion of ~/.asoundrc.
For situation 1, the output is this:
09:49:36.569 Startup script...
09:49:36.569 artsshell -q terminate
can't create mcop directory
Link points to "/tmp/ksocket-toby"
09:49:39.503 Startup script terminated with exit status=256.
09:49:39.503 JACK is starting...
09:49:39.504 /usr/bin/jackd -R -u -dalsa -r96000 -p1024 -n2 -D -Chw:1,2 -Phw:1,3 -s -H -M
09:49:39.517 JACK was started with PID=5401 (0x1519).
jackd 0.100.0
Copyright 2001-2005 Paul Davis and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK compiled with System V SHM support.
loading driver ..
apparent rate = 96000
creating alsa driver ... hw:1,3|
control device hw:1
ALSA lib confmisc.
ALSA lib conf.c:
ALSA lib conf.c:
ALSA lib pcm.c:2099:
ALSA lib confmisc.
ALSA lib conf.c:
ALSA lib conf.c:
ALSA lib pcm.c:2099:
ALSA: Cannot open PCM device alsa_pcm for playback. Falling back to capture-only mode
cannot load driver module alsa
09:49:39.635 JACK was stopped successfully.
------
For situation 2:
09:52:08.396 Startup script...
09:52:08.396 artsshell -q terminate
can't create mcop directory
Creating link /home/toby/
09:52:08.780 Startup script terminated with exit status=256.
09:52:08.780 JACK is starting...
09:52:08.780 /usr/bin/jackd -R -u -dalsa -r96000 -p1024 -n2 -D -Chw:1,2 -Phw:1,3 -s -H -M
09:52:08.791 JACK was started with PID=5510 (0x1586).
jackd 0.100.0
Copyright 2001-2005 Paul Davis and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK compiled with System V SHM support.
loading driver ..
apparent rate = 96000
creating alsa driver ... hw:1,3|
control device hw:1
configuring for 96000Hz, period = 1024 frames, buffer = 2 periods
Note: audio device hw:1,2 doesn't support a 32bit sample format so JACK will try a 24bit format instead
Note: audio device hw:1,2 doesn't support a 24bit sample format so JACK will try a 16bit format instead
nperiods = 2 for capture
Note: audio device hw:1,3 doesn't support a 32bit sample format so JACK will try a 24bit format instead
Note: audio device hw:1,3 doesn't support a 24bit sample format so JACK will try a 16bit format instead
nperiods = 2 for playback
09:52:10.809 Server configuration saved to "/home/
09:52:10.811 Statistics reset.
09:52:11.024 Client activated.
09:52:11.026 Audio connection change.
09:52:11.029 Audio connection graph change.
09:52:38.287 Client deactivated.
09:52:38.289 JACK is stopping...
jack main caught signal 15
no message buffer overruns
09:52:38.535 JACK was stopped successfully.
----
This shows that there is a difference in the reading of the configuration files when ~/.asoundrc.
Martin et al.,
I've done some further debugging for Malone #31699, and it appears that pcm.subdevice, alsa/alsa. conf's use of asoundconf:
the current fix for #35540 is insufficient (partially my fault). Some
applications expect defaults.pcm.device and defaults.
which must be integers due to /usr/share/
igetenv for .DEV and .SUBDEV. So to make all audio applications play
nicely together, we need to enumerate the following variables in
~/.asoundrc.
!defaults.pcm.card <string> pcm.subdevice <integer>
!defaults.ctl.card <string>
defaults.pcm.device <integer>
defaults.
[pcm.device <integer>]
Here's the breakdown: defaults.pcm.card and defaults.ctl.card can be pcm.subdevice must also be set. The good news is that we pcm.subdevice -1 (per definition in alsa/alsa. conf) always, since apps will override it as
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.
can get away with setting defaults.
/usr/share/
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 pcm.subdevice -1
!defaults.ctl.card ICH6
defaults.pcm.device 0
defaults.
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 asoundconf, I am able to asoundconf.
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.
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.
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 pcm.subdevice
defaults.ctl.card
defaults.pcm.device
defaults.
I suggest we use the nominal default of -1 for defaults. pcm.subdevice, {ctl,pcm} .card, and use an pcm.device. This means that gnome-control- center' s patches/ 23_default_ soundcard_ selector. patch needs to be modified
continue using the strings for !defaults.
integer for defaults.
debian/
such that set_default_card() also sets defaults.pcm.device and
...