0

How do I get i3status to display the volume level from alsamixer instead of Pulseaudio?

This is my volume configuration right now:

volume master {
        format = "♪: %volume"
        format_muted = "♪: muted (%volume)"
        device = "default"
        mixer = "Master"
}

According to the docs, setting device to 'default', PulseAudio will be tried if detected and will fallback to ALSA (Linux) or OSS (FreeBSD/OpenBSD). What string do I use for ALSA?

I have tried "alsa" "alsamixer" "ALSA" and they don't work.

2

You can try

device = "sysdefault"

Explanation

Any value for device that is not default or does not start with pulse tells i3status not to use PulseAudio and fall back to alsa. The value is then directly passed to alsa as device indetifier, so just setting it to alsa or something similar will not work. Before i3status had support for PulseAudio you could just set it to default to have alsa use the default device. default is still a valid name for an alsa device. But i3status now tries to auto-detect PulseAudio and use it in preference to alsa, when device is set to default (or unset).

By using sysdefault, you can bypass the automatism in i3status while still using a valid general device name for alsa.

Trouble shooting

If using systemdefault does not work for some reason, you may have to use a specific device name. If you have only one sound card, hw:0 should work.

device = "hw:0"

But on a modern desktop computer there may be more "sound cards" than one might expect. Aside from "true" on-board or dedicated sound cards there graphics cards (sound for HDMI), web cams, USB-Headsets, Bluetooth adapters, etc..

You can get a list of the cards in your system from the file /proc/asound/cards. For example:

 0 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xfa120000 irq 41
 1 [Nvidia         ]: HDA-Intel - HDA Nvidia
                      HDA Nvidia at 0xd3000000 irq 16

These can then be accessed with the device names hw:N in i3status.conf, where N is the number in the first column.

If you need more information to decide, which device number is the correct one, you can use amixer -c N info (amixer can be found in the alsa-utils package):

% amixer -c 0 info
Card hw:0 'PCH'/'HDA Intel PCH at 0xfa120000 irq 41'
  Mixer name    : 'Realtek ALC262'
  Components    : 'HDA:10ec0262,103c1587,00100202'
  Controls      : 41
  Simple ctrls  : 20

With amixer -c N you get a complete list of all mixer controls and their settings for card N. With amixer -c N sget CONTROL you can retrieve a specific value. So you can use amixer -c N sget Master, to verify that the output from i3status matches the actual values in alsa.

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.