1

I'm on Lubuntu 20.04, with no PulseAudio installed. I'm having some trouble editing my ALSA setting, as any change I make interferes with my microphone.

In particular, if I use the following basic configuration file:

pcm.!default {
    type hw
    card 2
}

ctl.!default {
    type hw
    card 2
}

Then I am unable to run OBS and Discord in parallel, as the first tries to open the microphone in stereo mode, while the latter in mono. The last to try always fails to open the device.

However, with just the lines

defaults.pcm.card 2
defaults.ctl.card 2

Everything works correctly. This hints to me that the default device that ALSA provides is more flexible than a simple type hw plugged to the correct device. I tried to look into somehow making ALSA print its defaults, but could not find anything about it.

How can I replicate the default ALSA device in my configuration file, so that I can make and test my changes as diffs to what ALSA already does for me?

2
  • You solved it with the pair of lines. What is the problem now? – Eduardo Trápani Jan 15 at 18:41
  • @EduardoTrápani I need to edit my audio file to setup a loopback of my desktop (to record my desktop audio), but every time I try to make an edit my mic stops working. – Svalorzen Jan 16 at 17:35
1

The default definition of the default device can be found in /usr/share/alsa/pcm/default.conf. If it does not redirect to a driver-specific default, it is defined like this:

pcm.!default {
    type plug
    slave.pcm {
        type hw
        card 2
    }
}

The plug plugin implements automatic sample rate/format conversion.

Most drivers do have their own default definition. In particular, most motherboard devices are handled by /usr/share/alsa/cards/HDA-Intel.conf, which defines something like this to allow multiple clients:

pcm.!default {
    type asym
    playback.pcm {
        type plug
        slave.pcm "dmix:2"
    }
    capture.pcm {
        type plug
        slave.pcm "dsnoop:2"
    }
}
1
  • In my case, it seems like that default.conf file is very generic, with hints and variable names and @func being used liberally. The dsnoop plugin was the right choice to fix my mic issues. Thanks for the help and hints! – Svalorzen Jan 18 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.