# Unable to force sound to headphone jack RPI 4

**URL:** https://dietpi.com/forum/t/unable-to-force-sound-to-headphone-jack-rpi-4/4331
**Category:** Troubleshooting
**Created:** [29 July 2020 01:26 UTC](https://dietpi.com/forum/t/unable-to-force-sound-to-headphone-jack-rpi-4/4331 "2020-07-29T01:26:56Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![gofireworks](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/7bcc69/32.png) [@gofireworks](https://dietpi.com/forum/u/gofireworks)
#### Post date: [29 July 2020 01:26 UTC](https://dietpi.com/forum/t/unable-to-force-sound-to-headphone-jack-rpi-4/4331/1 "2020-07-29T01:26:56Z")

</div>

Hello, I have a raspberry pi 4 running the latest version of DietPi (v6.31.2). I have it plugged in to my TV through an HDMI cord, and to my speakers through the 3.5mm jack. I would like to force the audio through 3.5mm so that I am able to use shairport-sync and play audio without having to turn on the TV, but I am unable to do so. I have set the audio to force 3.5mm through the use of dietpi-config \> audio options \> sound card \> rip-bcm2835-3.5mm (also see image below), but no sound comes through until I turn on the TV. Is this an issue with shairport-sync that I need to configure, or something else?

I appreciate any help!

 ![Screen Shot 2020-07-28 at 8.22.57 PM.jpg](https://dietpi.com/forum/uploads/default/original/2X/d/dc8d0cc295745ba71db2fce102089ea3598ab486.jpeg)

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [31 July 2020 18:37 UTC](https://dietpi.com/forum/t/unable-to-force-sound-to-headphone-jack-rpi-4/4331/2 "2020-07-31T18:37:46Z")

</div>

Many thanks for your report.

Did you reboot one time after applying the sound card selection?

Can you paste the output of amixer -c 0 contents (in case after reboot if 3.5mm output still does not work).

And in case try to add hdmi\_drive=1 to /boot/config.txt and reboot another time. This forces DVI mode which disables HDMI sound from the other side.

---

<div class="post-metadata">

### Author: ![gofireworks](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/7bcc69/32.png) [@gofireworks](https://dietpi.com/forum/u/gofireworks)
#### Post date: [3 August 2020 18:30 UTC](https://dietpi.com/forum/t/unable-to-force-sound-to-headphone-jack-rpi-4/4331/3 "2020-08-03T18:30:51Z")

</div>

I did not reboot, but after doing so I have not been able to force 3.5mm. I’ve added the hdmi\_drive=1 line, reboot, and I actually lose all sound coming from the Pi, even when the TV is on.

The contents of amixer -c 0 contents are as follows:

```nohighlight
numid=2,iface=MIXER,name='HDMI Playback Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=1,iface=MIXER,name='HDMI Playback Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=-10239,max=400,step=0
  : values=2
  | dBscale-min=-102.39dB,step=0.01dB,mute=1

```

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [7 August 2020 19:22 UTC](https://dietpi.com/forum/t/unable-to-force-sound-to-headphone-jack-rpi-4/4331/4 "2020-08-07T19:22:19Z")

</div>

Strange. hdmi\_drive=1 disables HDMI sound the other way, so it makes sense that you loose all sound then.

What is strange is that numid=2 is not shown in your amixer output as this is what usually switches between 3.5mm, HDMI and auto: [https://www.raspberrypi.org/documentation/configuration/audio-config.md](https://www.raspberrypi.org/documentation/configuration/audio-config.md)

If you again comment/remove the hdmi\_drive line, does amixer -c 0 contents still only show those two switches?

And just to assure: dtparam=audio=on is set in config.txt, right?

---

<div class="post-metadata">

### Author: ![gofireworks](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/7bcc69/32.png) [@gofireworks](https://dietpi.com/forum/u/gofireworks)
#### Post date: [7 August 2020 19:28 UTC](https://dietpi.com/forum/t/unable-to-force-sound-to-headphone-jack-rpi-4/4331/5 "2020-08-07T19:28:36Z")

</div>

Yes, I get the same results from amixer after uncommenting the hdmi\_drive line

The portion in config.txt is also set to on, as well: dtparam=audio=on

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [10 August 2020 10:10 UTC](https://dietpi.com/forum/t/unable-to-force-sound-to-headphone-jack-rpi-4/4331/6 "2020-08-10T10:10:31Z")

</div>

Hmm, probably this needs to be configured differently on RPi4 (although never heard of an 3.5mm issue) or hardware issue?  
Btw you can follow any Raspbian/Raspberry Pi OS instructions you find.

Just checked raspi-config and they do the same: [https://github.com/RPi-Distro/raspi-config/blob/master/raspi-config#L1724-L1737](https://github.com/RPi-Distro/raspi-config/blob/master/raspi-config#L1724-L1737)

Ah did we already check if onboard audio is really card 0 or if something else occupied that ID? Please paste the output of:  
aplay -l  
aplay -L

---

<div class="post-metadata">

### Author: ![gofireworks](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/7bcc69/32.png) [@gofireworks](https://dietpi.com/forum/u/gofireworks)
#### Post date: [21 November 2020 04:14 UTC](https://dietpi.com/forum/t/unable-to-force-sound-to-headphone-jack-rpi-4/4331/7 "2020-11-21T04:14:41Z")

</div>

Hi, I did not see your reply to this for a long time.

The output of aplay -l is as follows  
\*\*\*\* List of PLAYBACK Hardware Devices \*\*\*\*  
card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]  
Subdevices: 4/4  
Subdevice #0: subdevice #0  
Subdevice #1: subdevice #1  
Subdevice #2: subdevice #2  
Subdevice #3: subdevice #3  
card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]  
Subdevices: 4/4  
Subdevice #0: subdevice #0  
Subdevice #1: subdevice #1  
Subdevice #2: subdevice #2  
Subdevice #3: subdevice #3  
  
  
The output of aplay -L is as follows  
null  
Discard all samples (playback) or generate zero samples (capture)  
sysdefault:CARD=b1  
bcm2835 HDMI 1, bcm2835 HDMI 1  
Default Audio Device  
dmix:CARD=b1,DEV=0  
bcm2835 HDMI 1, bcm2835 HDMI 1  
Direct sample mixing device  
dsnoop:CARD=b1,DEV=0  
bcm2835 HDMI 1, bcm2835 HDMI 1  
Direct sample snooping device  
hw:CARD=b1,DEV=0  
bcm2835 HDMI 1, bcm2835 HDMI 1  
Direct hardware device without any conversions  
plughw:CARD=b1,DEV=0  
bcm2835 HDMI 1, bcm2835 HDMI 1  
Hardware device with all software conversions  
sysdefault:CARD=Headphones  
bcm2835 Headphones, bcm2835 Headphones  
Default Audio Device  
dmix:CARD=Headphones,DEV=0  
bcm2835 Headphones, bcm2835 Headphones  
Direct sample mixing device  
dsnoop:CARD=Headphones,DEV=0  
bcm2835 Headphones, bcm2835 Headphones  
Direct sample snooping device  
hw:CARD=Headphones,DEV=0  
bcm2835 Headphones, bcm2835 Headphones  
Direct hardware device without any conversions  
plughw:CARD=Headphones,DEV=0  
bcm2835 Headphones, bcm2835 Headphones  
Hardware device with all software conversions

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [23 November 2020 00:51 UTC](https://dietpi.com/forum/t/unable-to-force-sound-to-headphone-jack-rpi-4/4331/8 "2020-11-23T00:51:14Z")

</div>

gofireworks  
Meanwhile the issue is known: [https://github.com/MichaIng/DietPi/issues/3887](https://github.com/MichaIng/DietPi/issues/3887)  
Will be fixed with next release.

If you find time, could you do the following:

```nohighlight
G_CONFIG_INJECT 'hdmi_drive:0=' `hdmi_drive:0=1` /boot/config.txt # forces DVI mode on HDMI port 0
G_CONFIG_INJECT 'hdmi_drive:1=' `hdmi_drive:1=1` /boot/config.txt # forces DVI mode on HDMI port 1
reboot # Reboot to make changes becoming effective
cat /proc/asound/cards

```

I want to assure that all RPi models in such case do not list HDMI as sound “card” anymore but instead the “Headphones” (3.5mm jack) as card 0.

---

<div class="post-metadata">

### Author: ![gofireworks](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/7bcc69/32.png) [@gofireworks](https://dietpi.com/forum/u/gofireworks)
#### Post date: [23 November 2020 03:14 UTC](https://dietpi.com/forum/t/unable-to-force-sound-to-headphone-jack-rpi-4/4331/9 "2020-11-23T03:14:02Z")

</div>

MichaIng  
When I copy and paste the command (with and without `sudo`) I get this error: [https://imgur.com/a/7U4NDXk](https://imgur.com/a/7U4NDXk)

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [23 November 2020 07:15 UTC](https://dietpi.com/forum/t/unable-to-force-sound-to-headphone-jack-rpi-4/4331/10 "2020-11-23T07:15:55Z")

</div>

can you try this as user root pls

---

<div class="post-metadata">

### Author: ![gofireworks](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/7bcc69/32.png) [@gofireworks](https://dietpi.com/forum/u/gofireworks)
#### Post date: [23 November 2020 17:04 UTC](https://dietpi.com/forum/t/unable-to-force-sound-to-headphone-jack-rpi-4/4331/11 "2020-11-23T17:04:35Z")

</div>

I switched to root user with sudo su, and then entered the following commands

```nohighlight
G_CONFIG_INJECT 'hdmi_drive:0=' 'hdmi_drive:0=1' /boot/config.txt
G_CONFIG_INJECT 'hdmi_drive:1=' 'hdmi_drive:1=1' /boot/config.txt
reboot
cat /proc/asound/cards

```

I had to switch the backticks on hdmi\_drive:0=1 to single quotes because I was getting an error of bash: hdmi\_drive:0=1: command not found.

The output of cat /proc/asound/cards doesn’t seem to have changed, but the output is here

```nohighlight
root@Kodi:/home/joshl# cat /proc/asound/cards
 0 [b1]: bcm2835_hdmi - bcm2835 HDMI 1
                      bcm2835 HDMI 1
 1 [Headphones]: bcm2835_headphonbcm2835 Headphones - bcm2835 Headphones
                      bcm2835 Headphones

```
