Skip to content
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

[FEATURE] Disable screen blanking and select HDMI/3.5mm as part of pi setup #322

Open
vicwomg opened this issue Mar 20, 2024 · 1 comment

Comments

@vicwomg
Copy link
Owner

vicwomg commented Mar 20, 2024

Is your feature request related to a problem? Please describe.

The pi requires some more steps to make it karaoke-ready. It would be great to automate this in scripts. Namely

  • Disable screen blanking (turns off the screen)
  • Select default audio output (HDMI or 3.5mm out)

Describe the solution you'd like
Add some user prompts to the setup.sh script that will handle additional pi setup steps. Here's what raspi-config is doing under the hood, copying a file and restarting:

Screen blanking
https://github.com/RPi-Distro/raspi-config/blob/9ef367eda1f18328b2c47e7347fc9eb6ebdbb657/raspi-config#L442-L446

Audio output
https://github.com/RPi-Distro/raspi-config/blob/9ef367eda1f18328b2c47e7347fc9eb6ebdbb657/raspi-config#L2175-L2267

Describe alternatives you've considered
Is raspi-config scriptable? Seems so. That might be a better approach:
https://forums.raspberrypi.com/viewtopic.php?t=21632

@doug14
Copy link

doug14 commented Sep 30, 2024

Hello @vicwomg

Would it be possible to add two "links" to the info screen for selecting the audio output? Today I created two shortcuts on the desktop that call a bash to change.
When I want the audio output to be via HDMI, I run the bash that has these lines:

sudo sed -i 's/defaults.ctl.card 1/defaults.ctl.card 0/' /usr/share/alsa/alsa.conf
sudo sed -i 's/defaults.pcm.card 1/defaults.pcm.card 0/' /usr/share/alsa/alsa.conf
sudo shutdown -r now

When I want the audio output to be through the 3.5mm out, I run the bash that has these lines:

sudo sed -i 's/defaults.ctl.card 0/defaults.ctl.card 1/' /usr/share/alsa/alsa.conf
sudo sed -i 's/defaults.pcm.card 0/defaults.pcm.card 1/' /usr/share/alsa/alsa.conf
sudo shutdown -r now

The linux I'm running on my raspberry is:

PRETTY_NAME="Raspbian GNU/Linux 12 (bookworm)"
NAME="Raspbian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants