Do not force sound card but fall back to ALSA config #150
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since a recent Raspberry Pi kernel upgrade, ALSA sound card 0 device 0 is pointing to HDMI sound, if a monitor is attached, while 3.5mm jack then is card 1 device 0. Previously both were at card 0 device 0, switchable via amixer control.
Forcing now card 0 device 0 hence forces HDMI audio (even if the monitor does not really support it) and hence breaks 3.5mm jack sound. To allow switching the sound device with usual methods (ALSA configuration or raspi-config on RPi), Mycroft must not force the exact sound device. If no custom ALSA configuration exists, card 0 device 0 is the default anyway.
Related issues:
https://community.mycroft.ai/t/picroft-no-sound-with-3-5mm-jack-output/9726
https://community.mycroft.ai/t/sound-always-go-through-hdmi/9929
raspi-configto configure headphones (=3.5mm jack) for sound output.raspi-config.Yes
Btw, the commented audio selection commands in this script are hence outdated as well: https://github.com/MycroftAI/enclosure-picroft/blob/buster/home/pi/audio_setup.sh
The problem is that it depends on the attached HDMI devices whether card 0 will be HDMI or 3.5mm jack, or the latter instead is card 1. Plugging of the monitor can hence as well break sound configurations. I'm hence no big fan of this new interface, but that's how it is.
raspi-confignow simply shoes the available sound cards with names to let the user select: https://github.com/RPi-Distro/raspi-config/blob/99a8ba5c74104a4c8f90c40fb4ac13df64d53fe0/raspi-config#L1925-L1952The check above the highlighted code with
bcm2835 ALSAsound device name btw only applies in case of outdated RPi kernel versions.