Skip to content

Instantly share code, notes, and snippets.

@instinctive
Last active August 19, 2020 15:58
Show Gist options
  • Select an option

  • Save instinctive/ba2b93c6ff4cfbb4f6ad82464ae76be6 to your computer and use it in GitHub Desktop.

Select an option

Save instinctive/ba2b93c6ff4cfbb4f6ad82464ae76be6 to your computer and use it in GitHub Desktop.
Notes on Linux Audio issues

Linux Audio

I run Fedora and KDE. Tags: #linux #audio #pulseaudio #alsamixer.

Headphones not detected

If I reboot with the headphones plugged in, they are not detected. Fix:

https://superuser.com/questions/1047666/headphone-jack-stops-working-after-suspend-reboot

Speakers and Headphones

I couldn't figure out how to easily switch between speakers and headphones. I have the speakers plugged in to the rear IO panel, my headphones are in the front jack. I want a simple way to switch them, but the default behavior is to mute the line out if the headphone jack is plugged.

Finally settled on scripts to switch them:

$ cat headphones
#!/bin/bash
amixer set 'Auto-Mute Mode' Enabled > /dev/null
pacmd set-sink-port alsa_output.pci-0000_0d_00.4.analog-stereo analog-output-headphones

$ cat speakers
#!/bin/bash
pacmd set-sink-port alsa_output.pci-0000_0d_00.4.analog-stereo analog-output-lineout
sleep 0.1
amixer set 'Auto-Mute Mode' Disabled > /dev/null

The sleep 0.1 is to give the lineout change time to settle before disabling auto-mute, otherwise the speakers kick in at headphone volume for a moment.

(You can find your sinks with pactl list short sinks.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment