Mopidy Discourse

Recent update renumbered my audio devices

Against my better judgement, I’m running Ubuntu 21 (dev channel) on my Raspberry Pi 4 mopidy machine.

A recent update reordered my audio devices and mopidy no longer worked. The update may have been an ALSA update or something unrelated, I’m not sure.

Just in case anyone else notices this behavior, check your error logs with journalctl -u mopidy (for daemonized servers) and look for errors.

and after today’s update, it happened again. There were new device drivers installed, so maybe that’s a cause?

Does anyone know how to “lock” the ordering of a machine’s ALSA devices?

Use names, not numbers. e.g. output = alsasink device=hw:Headphones

1 Like

brilliant! :slight_smile: Thank you.

is there a corresponding lookup for amixer devices?

e.g., I have now: card = 2

looking at the docs for the plugin, looks like it’s all numerics. GitHub - mopidy/mopidy-alsamixer: Mopidy extension for ALSA volume control

Unfortunately you are right in that case. Only devices indexes are supported in Mopidy-Alsamixer but the underlying pyalsaaudio library does support both device indexes and names so that would be a good enhancement to propose (and ideally also implement).

1 Like

Might be an easy addition. I’ll file it and take a look. Thanks!

appears to be already on file: Support selecting cards based on card name · Issue #6 · mopidy/mopidy-alsamixer · GitHub

Good spot. Doesn’t seem so easy to implement after all.

As an alternative, I think you should also be able to use device names when setting the defaults in your /etc/asound.conf, something like this?

pcm.!default {
    type hw
    card Headphones
}

ctl.!default {
    type hw
    card Headphones
}

I’ll have a look at that and see if that could be a viable work-around.

I’d really like it if alsamixer could just “do the thing” though, so I’ll see if I can get anywhere with it.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.