4

I am building an application where the sound needs to be over the 3.5mm jack and video over HDMI.

However, sometimes it does send the sound over HDMI and 3.5mm jack. And sometimes it just uses HDMI only.

How can I force the sound always goes over 3.5mm jack (I do not care if the sound gets duplicated over HDMI, I will turn of the TV sound)?

Thankyou, Rick

1
  • Have a look here at hdmi_drive and hdmi_group settings for /boot/config.txt. I haven't tested or looked into this, but at a guess, using DMT may exclude the sound from HDMI (and hdmi_drive=1 definitely will), which may mean it goes out via the headphone jack.
    – goldilocks
    Jan 31, 2017 at 14:37

3 Answers 3

5

use rasp-config to force sound in 3.5 jack. To do so use below commannd

sudo raspi-config

and then select

9 Advanced Options             Configure advanced settings 

and then select

A9 Audio        Force audio out through HDMI or 3.5mm jack

and finally

1 Force 3.5mm ('headphone') jack
1
  • in the more recent versions (bullseye, 2023) the option is now under 1 System Options -> S2 Audio.
    – ccpizza
    Jan 13 at 9:10
2

For those looking to achieve the same result from the command line, here is the extract from the documentation:

COMMAND LINE

The following command, entered in the command line, will switch the audio output to HDMI:

amixer cset numid=3 2

Here the output is being set to 2, which is HDMI. Setting the output to 1 switches to analogue (headphone jack). The default setting is 0 which is automatic.

0

For Raspberry Pi 4, an update to @rajesh6115's answer:

use rasp-config to force sound in 3.5 jack. To do so use below commannd

sudo raspi-config

and then select

1 System Options       Configure system settings

and then select

S2 Audio             Select audio out through HDMI or 3.5mm jack

and finally

1 Headphones

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.