ALSA audio through 3.5mm jack instead of HDMI

Hi, I’m running OSMC on a Raspberry Pi 1 model B.
I’m trying to stream Bluetooth audio from my phone and laptop to it, and the video out is through HDMI connected to my TV, and the audio should be through the 3.5mm jack to the aux on my internet radio. The audio out from Kodi itself is coming through the 3.5mm jack, yes after changing the option in settings, however the Bluetooth audio doesn’t go through Kodi, it goes through ALSA.
I need to know how to change ALSA settings to output audio through the 3.5mm jack rather than HDMI. This works on an Pi I have in another room but that required no setup as it defaulted to that due to the lack of an HDMI connection. Previously, this worked for me by running:
sudo apt-get install alsa-utils
amixer cset numid=3 1
However, since reinstalling Kodi, this no longer works, it just mutes the audio coming out of the hdmi, without making it come out of the 3.5mm jack. All the solutions I have found say that that works, so does anyone know any other ways to do this, or alternatively, why that method no longer works?
Thanks,
Benjamin

What’s your audio setting in Kodi?

The audio setting in Kodi is set to Analogue, but like I said, Bluetooth audio doesn’t go through Kodi so it has no affect on it.

On my Pi2B, numid=3 is the volume control, numid=4 is the mute switch, so this sort of thing might be better:

amixer cset numid=3 56231,56231
amixer cset numid=4 1

Check with amixer controls

Having said that, I think Kodi doesn’t use alsa on the Pi for hdmi or analogue, but try it. You shouldn’t actually need alsa at all - the only alsa sound sink should be the BT output device. from kodi.log:

02:41:19.391 T:1959120896  NOTICE: Found 2 Lists of Devices
02:41:19.391 T:1959120896  NOTICE: Enumerated PI devices:
02:41:19.391 T:1959120896  NOTICE:     Device 1
02:41:19.392 T:1959120896  NOTICE:         m_deviceName      : HDMI
02:41:19.392 T:1959120896  NOTICE:         m_displayName     : HDMI
02:41:19.392 T:1959120896  NOTICE:         m_displayNameExtra:
02:41:19.392 T:1959120896  NOTICE:         m_deviceType      : AE_DEVTYPE_HDMI
02:41:19.392 T:1959120896  NOTICE:         m_channels        : FL,FR
02:41:19.392 T:1959120896  NOTICE:         m_sampleRates     : 8000,11025,16000,22050,24000,32000,44
100,48000,88200,96000,176400,192000
02:41:19.392 T:1959120896  NOTICE:         m_dataFormats     : AE_FMT_FLOAT,AE_FMT_S32NE,AE_FMT_S16N
E,AE_FMT_S32LE,AE_FMT_S16LE,AE_FMT_FLOATP,AE_FMT_S32NEP,AE_FMT_S16NEP,AE_FMT_RAW
02:41:19.392 T:1959120896  NOTICE:         m_streamTypes     : STREAM_TYPE_AC3,STREAM_TYPE_EAC3,STRE
AM_TYPE_DTSHD_CORE,STREAM_TYPE_DTS_2048,STREAM_TYPE_DTS_1024,STREAM_TYPE_DTS_512
02:41:19.392 T:1959120896  NOTICE:     Device 2
02:41:19.392 T:1959120896  NOTICE:         m_deviceName      : Analogue
02:41:19.392 T:1959120896  NOTICE:         m_displayName     : Analogue
02:41:19.392 T:1959120896  NOTICE:         m_displayNameExtra:
02:41:19.392 T:1959120896  NOTICE:         m_deviceType      : AE_DEVTYPE_PCM
02:41:19.392 T:1959120896  NOTICE:         m_channels        : FL,FR
02:41:19.392 T:1959120896  NOTICE:         m_sampleRates     : 48000
02:41:19.393 T:1959120896  NOTICE:         m_dataFormats     : AE_FMT_FLOAT,AE_FMT_S32LE,AE_FMT_S16L
E,AE_FMT_FLOATP,AE_FMT_S32NEP,AE_FMT_S16NEP
02:41:19.393 T:1959120896  NOTICE:         m_streamTypes     : No passthrough capabilities
02:41:19.393 T:1959120896  NOTICE:     Device 3
02:41:19.393 T:1959120896  NOTICE:         m_deviceName      : Both
02:41:19.393 T:1959120896  NOTICE:         m_displayName     : HDMI and Analogue
02:41:19.393 T:1959120896  NOTICE:         m_displayNameExtra:
02:41:19.393 T:1959120896  NOTICE:         m_deviceType      : AE_DEVTYPE_PCM
02:41:19.393 T:1959120896  NOTICE:         m_channels        : FL,FR
02:41:19.393 T:1959120896  NOTICE:         m_sampleRates     : 48000
02:41:19.393 T:1959120896  NOTICE:         m_dataFormats     : AE_FMT_FLOAT,AE_FMT_S32LE,AE_FMT_S16L
E,AE_FMT_FLOATP,AE_FMT_S32NEP,AE_FMT_S16NEP
02:41:19.393 T:1959120896  NOTICE:         m_streamTypes     : No passthrough capabilities
02:41:19.393 T:1959120896  NOTICE: Enumerated ALSA devices:
02:41:19.393 T:1959120896  NOTICE:     Device 1
02:41:19.393 T:1959120896  NOTICE:         m_deviceName      : pulse
02:41:19.393 T:1959120896  NOTICE:         m_displayName     : OSMC streaming to Bluetooth speaker /
 headphones
02:41:19.393 T:1959120896  NOTICE:         m_displayNameExtra:
02:41:19.393 T:1959120896  NOTICE:         m_deviceType      : AE_DEVTYPE_PCM
02:41:19.394 T:1959120896  NOTICE:         m_channels        : FL,FR,BL,BR,FC,LFE,SL,SR,UNKNOWN1,UNK
NOWN2,UNKNOWN3,UNKNOWN4,UNKNOWN5,UNKNOWN6,UNKNOWN7,UNKNOWN8
02:41:19.394 T:1959120896  NOTICE:         m_sampleRates     : 5512,8000,11025,16000,22050,32000,441
00,48000,64000,88200,96000,176400,192000
02:41:19.394 T:1959120896  NOTICE:         m_dataFormats     : AE_FMT_FLOAT,AE_FMT_S32NE,AE_FMT_S16NE,AE_FMT_S16LE,AE_FMT_S16BE,AE_FMT_U8
02:41:19.394 T:1959120896  NOTICE:         m_streamTypes     : No passthrough capabilities

amixer cset numid=3 56231,56231
amixer cset numid=4 1 did nothing but reduce the volume to 86%, if it helps any, here is the output of amixer controls:

numid=4,iface=MIXER,name='Master Playback Switch'
numid=3,iface=MIXER,name='Master Playback Volume'
numid=2,iface=MIXER,name='Capture Switch'
numid=1,iface=MIXER,name='Capture Volume'

Also, like I said, I know that Kodi doesn’t use ALSA for Analogue or HDMI audio, but Bluetooth audio doesn’t come through Kodi, it comes through a package called ‘a2dp-app-osmc’ from here.

OK, thanks. You have highlighted something I didn’t know. The a3dp package adds an alsa sink bcm2835 ALSA Analog Stereo which pulse uses to output the BT stream. That’s what amixer is controlling and you could reset that to 65536,65536 for full volume. But for some reason, that ‘Analogue’ device is sending sound to hdmi, not the analogue jack - it’s the same on my Pi2B.

Are you running the same OSMC/kodi version on the Pi that works? Can you post debug logs for that device, please?

I am, however that Pi didn’t require any changes in settings as it doesn’t have an HDMI output plugged in, so it defaults to Analogue, I don’t know if it would help. Which log do you want, I don’t know where logs from the Bluetooth app go, and the Kodi log doesn’t mention anything about Bluetooth or ALSA in it, other than that bit at the top adding Bluetooth as an output device in Kodi’s settings.

Yes, that’s the difference. No need for logs. I think this is a bug/missing feature in the a2dp package and I’ll see what can be done.

Meanwhile, setting hdmi_ignore_edid_audio=1 in /boot/config.txt seems to do what you want. Note that all the RPi advice is based on Raspbian so amixer cset is not going to have the same effect.

1 Like

Thank you! Changing config.txt fixed it for me!