You are not logged in.

#1 2011-07-27 05:42:59

quantumcoffeemug
Member
Registered: 2010-02-14
Posts: 9

[Solved] Alsamixer error "cannot open mixer: Invalid argument"

I had to remove my sound card to free a pci slot, so I switched to the Realtek ALC662 built into the motherboard. Previously alsamixer had been working, but now when I try to invoke it I get the following error:

$ alsamixer
cannot open mixer: Invalid argument

On the advice of one forum post I changed my .asoundrc to read

pcm.!default {
type hw
card 0
device 0
}
ctl.!default {
type hw
card 0
device 0
}

This did not help, nor did adding modprobe snd-hda-intel model=auto to /etc/modprobe.conf or /etc/modprobe.d/sound.conf as various posters on various forums suggested. I also ran alsactl init to no avail. What am I doing wrong?

Last edited by quantumcoffeemug (2011-07-27 18:42:39)

Offline

#2 2011-07-27 17:23:35

llawwehttam
Member
From: United Kingdom
Registered: 2010-01-19
Posts: 181

Re: [Solved] Alsamixer error "cannot open mixer: Invalid argument"

The problem will probably be in your /etc/modprobe.d/alsa.conf and your old card will probable be listed there. Simply remove the card name, start alsamixer , and select the new default sound chip.

Offline

#3 2011-07-27 18:39:24

quantumcoffeemug
Member
Registered: 2010-02-14
Posts: 9

Re: [Solved] Alsamixer error "cannot open mixer: Invalid argument"

Thanks, that, along with deleting the .asoundconf file that an apparently way outdated post on another forum suggested, solved the problem.

Offline

#4 2014-07-20 21:58:26

kevinf28
Member
Registered: 2014-07-20
Posts: 2

Re: [Solved] Alsamixer error "cannot open mixer: Invalid argument"

This is the first result in google... so this deserves a better answer, necro or not.

Having two soundcards, and wanting the digital out (dev 1) of the second (card 1) to be the default... This is a common asound.conf (as mentioned in OP).

pcm.!default {
   type hw
   card 1
   device 1
}

ctl.!default {
    type hw
    card 1
    device 1
}

It generates the same 'Alsamixer error "cannot open mixer: Invalid argument" ' with alsa 1.0.27.2-1ubuntu2 while speaker-test did work (Ubuntu 14.04)

The "CTL" element defines the Mixer. The mixer controls ALL (sub)devices on a sound card (eg: analog and digital). Therefore it is frivolous to reference the "device 1" for CTL.

SOLUTION: remove the "device 1" line from CTL.


pcm.!default {
   type hw
   card 1
   device 1
}

ctl.!default {
    type hw
    card 1
}

The error message went away for me, while still keeping my second sound card as default when opening mixer controls.

Last edited by kevinf28 (2014-07-20 22:01:26)

Offline

#5 2014-07-20 23:03:05

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [Solved] Alsamixer error "cannot open mixer: Invalid argument"

kevinf28 wrote:

This is the first result in google... so this deserves a better answer, necro or not.

Indeed it does, and certainly not that one. Use defaults.ctl.card node instead:

defaults.ctl.!card 1;

 # for the second card
# it would be even better to use the name reference
# that can be obtained using
# cat /proc/asound/card*/id
# for example
# defaults.ctl.!card "PCH"

Do not use that kind of configuration for your pcm devices either. Read the alsa wiki for more explanation.

Alsa Wiki wrote:

Simply setting a type hw as default card is equivalent to addressing hardware directly, which leaves the device unavailable to other applications. This method is only recommended if it is a part of a more sophisticated setup ~/.asoundrc or if user deliberately wants to address sound card directly (digital output through eic958 or dedicated music server for example).

Thank you Jason.

Offline

#6 2014-07-20 23:04:13

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [Solved] Alsamixer error "cannot open mixer: Invalid argument"

Closing now the record has been corrected: thanks emeres.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB