-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not force sound card but fall back to ALSA config #150
base: buster
Are you sure you want to change the base?
Conversation
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 Signed-off-by: MichaIng <[email protected]>
Hey Michael, I think we also need to update the setup scripts. Unfortunately there are some places expecting this particular string to do a search and replace for other hardware, eg: enclosure-picroft/home/pi/auto_run.sh Lines 391 to 394 in afd739e
maybe we can switch to
|
Wouldn't it make sense to configure the ALSA and/or PulseAudio directly instead? I don't know much about PulseAudio, but Otherwise I see there are other places where the RPi legacy audio interface is assumed: enclosure-picroft/home/pi/auto_run.sh Lines 301 to 318 in afd739e
It's a pain (IMO) but a 3.5mm choice cannot be reliably applied anymore without touching the device tree. On could loop through aplay -l or /proc/asound/card[0-9]/ identifiers to identify which one is "headphones" (=3.5mm jack) and which one is HDMI (if even present), but plugging or unplugging a HDMI device makes the 3.5mm sound card index change.
See here how we solved it via device tree overlay: https://github.com/MichaIng/DietPi/pull/3938/files#diff-e1f2e63b74209db8768bc28025d8727d20f2a2fa96ef44a0db7991724abeb507R1948-R1961 |
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-config
to 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-config
now 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 ALSA
sound device name btw only applies in case of outdated RPi kernel versions.