sound only from 2 speakers

Asked by Brian Murray

I have a 4.1 speaker system attached to by Creative sound card and only hear sounds from the front right and front left speakers. I used to use the following config in my .asoundrc in Intrepid but it no longer works:

pcm.!default {
type plug
slave.pcm "surround51"
slave.channels 4
route_policy duplicate
}

ProblemType: Bug
Architecture: amd64
Card0.Amixer.info:
 Card hw:0 'Intel'/'HDA Intel at 0xefffc000 irq 16'
   Mixer name : 'SigmaTel STAC9221 A1'
   Components : 'HDA:83847680,102801a7,00103201'
   Controls : 30
   Simple ctrls : 17
Card1.Amixer.info:
 Card hw:1 'Live'/'SBLive 5.1 [SB0060] (rev.7, serial:0x80611102) at 0xbce0, irq 17'
   Mixer name : 'SigmaTel STAC9708,11'
   Components : 'AC97a:83847608'
   Controls : 224
   Simple ctrls : 45
DistroRelease: Ubuntu 9.04
Package: linux-sound-base 1.0.18.dfsg-1ubuntu8
PackageArchitecture: all
ProcEnviron:
 SHELL=/bin/zsh
 PATH=(custom, user)
 LANG=en_US.UTF-8
SourcePackage: alsa-driver
Uname: Linux 2.6.28-11-generic x86_64

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu linux Edit question
Assignee:
No assignee Edit question
Solved by:
Daniel T Chen
Solved:
Last query:
Last reply:

This question was originally filed as bug #370553.

Revision history for this message
Brian Murray (brian-murray) said :
#1
Revision history for this message
Daniel T Chen (crimsun) said :
#2

For clarity, the sole contents of ~/.asoundrc should be the pcm.!default {} snippet you wish to use.

Please reproduce the error using "speaker-test -c4" after you've made the above modification.

Revision history for this message
Daniel T Chen (crimsun) said :
#3

Note also that, according to your "aplay -l" from that particular boot, hw:0 is the built-in HDA and hw:1 is the Live. Your pcm.!default {} snippet assumes hw:0, which is probably not what you intend. You can use the Live in two ways. One, you can use "surround51:1" instead of "surround51" in the pcm.!default {} snippet. Two, you can tell snd.ko, via a module parameter, that you always want the Live driver to occupy slot 0 (hw:0) with: echo options snd slots=snd-emu10k1,snd-hda-intel|sudo tee -a /etc/modprobe.d/always_sblive_default.conf

Revision history for this message
Brian Murray (brian-murray) said :
#4

I'm sorry but I'm not quite clear on what you are suggesting should be in in my ~/.asoundrc. Could you spell it out for me?

Revision history for this message
Daniel T Chen (crimsun) said :
#5

I'll proceed presuming that you want your SB Live to be the default card always, and we'll call that hw:0 for alsa-kernel and alsa-lib.

You should make these two modifications:

1) Open a Terminal, and issue: echo options snd slots=snd-emu10k1,snd-hda-intel|sudo tee -a /etc/modprobe.d/always_sblive_default.conf

2) Edit your ~/.asoundrc to read as follows:
# ALSA library configuration file

# Include settings that are under the control of asoundconf(1).
# (To disable these settings, comment out this line.)
#</home/theman/.asoundrc.asoundconf>
# http://ph.ubuntuforums.com/showthread.php?s=1624d7a5cf7d26ee1f34a9bf732a92cd&t=161817&page=3
pcm.!default {
  type plug
  slave.pcm "surround51"
  slave.channels 4
  route_policy duplicate
}

(Essentially, you don't want ~/.asoundrc.asoundconf at all. You can erase it if doing so suits you.)

After you've made the above two modifications, you may either reboot or issue "sudo /sbin/alsa force-reload" to effect the changes.

Revision history for this message
Daniel T Chen (crimsun) said :
#6

Because PCI audio device enumeration is nondeterministic during boot, either the onboard (HDA) or the peripheral (SB Live) will claim the first audio card slot (hw:0). The root of the problem seems to be as follows:

1) Initially hw:0 was the peripheral (SB Live) but shifted to hw:1 during some nondeterministic sequence of subsequent boots;
2) The user's commented-out pcm.!default entries in ~/.asoundrc assumes that hw:0 is always the peripheral (SB Live);
3) Upon the onboard (HDA) assuming hw:1, an attempt was made to recover the peripheral as the default by issuing "asoundconf set-default-card Live" (or some variant, including manually editing ~/.asoundrc.asoundconf);
4) The user's ~/.asoundrc.asoundconf does not have entries for duplicate routing as in the user's original commented-out pcm.!defaults entries in ~/.asoundrc.

Revision history for this message
Brian Murray (brian-murray) said :
#7

After making the changes suggested and executing speaker-test -c4 I received the following erro:

8:53:56 - flash:[~] speaker-test -c4

speaker-test 1.0.18

Playback device is default
Stream parameters are 48000Hz, S16_LE, 4 channels
Using 16 octaves of pink noise
ALSA lib pcm_params.c:2135:(snd1_pcm_hw_refine_slave) Slave PCM not usable
Broken configuration for playback: no configurations available: Invalid argument
Setting of hwparams failed: Invalid argument

Revision history for this message
Best Daniel T Chen (crimsun) said :
#8

"slave.channels 4" is invalid without a type route and type plug wrapper; removing that line should do the trick, since alsa-lib already has definitions to "do the right thing" for 1, 2, ..., 6 speakers regardless whether they're physically connected.

Revision history for this message
Brian Murray (brian-murray) said :
#9

Thanks Daniel T Chen, that solved my question.