nerves-project / nerves_system_rpi4

Base Nerves system configuration for the Raspberry Pi 4
Apache License 2.0
90 stars 48 forks source link

Audio guide in readme is outdated #244

Open krns opened 3 months ago

krns commented 3 months ago

Environment

Current behavior

The readme says:

Audio

The Raspberry Pi has many options for audio output. This system supports the HDMI and stereo audio jack output. The Linux ALSA drivers are used for audio output.

The general Raspberry Pi audio documentation mostly applies to Nerves. For example, to force audio out the HDMI port, run:

cmd("amixer cset numid=3 2")

Change the last argument to amixer to 1 to output to the stereo output jack.

This is no longer true since May 2020: https://www.raspberrypi.com/news/latest-raspberry-pi-os-update-may-2020/ (see "Other changes").

Some people have asked how they can switch the audio output from the command line without using the desktop. To do this, you will need to create a file called .asoundrc in your home directory; ALSA looks for this file to determine which audio device it should use by default. If the file does not exist, ALSA uses “card 0” – which is HDMI – as the output device.

Expected behavior

I would expect the readme to take this change into account :)

fhunleth commented 3 months ago

@krns Thanks for catching this. Could you make a PR that updates the text?

krns commented 3 months ago

@fhunleth I'd like to contribute, but I'm not sure what all is needed after the changes.

Do we already need an .asoundrc in the home directory for this? Do you already know more about it? Otherwise, I will try to delve deeper towards the end of the week.

fhunleth commented 3 months ago

That's fine. Support everything is really hard and filing this issue might get others involved.

I don't have a much experience with audio. I would expect that there's no need for a .asoundrc file, though, and that every option that would be put in the file could also be passed via the commandline. Passing everything via commandline args would keep all configuration in one place (in theory).

If you feel like you're not making any progress, one PR could be just to remove the wrong info from the README and point people to this issue for updates.