A1Topgun
Posts: 1
Joined: Sun Aug 13, 2017 6:24 pm

Alternate Audio Output When HDMI Is Connected?

Sun Feb 24, 2019 9:51 pm

I guess I will join the ranks of Pi users who can not get audio output to a BlueTooth speaker. I would like to make a small portable TV to receive local digital TV broadcasts.

Development Setup is a Raspberry Pi 3 B+, Raspbian Stretch with desktop and recommended software (2018-11-13)-(Fresh install with current updates as of 2019-01-25), 24” ViewSonic HDMI display with audio speakers, Hauppauge 950Q WinTV USB digital tuner, CCP-4303 Bluetooth speaker, USB keyboard, and USB Bluetooth dongle mouse. Kaffeine TV application.

The plan was to get everything working and switch the display to a 7” Maker Fire LCD HDMI screen which does not have audio, so I need an alternate audio output. I thought a Bluetooth speaker would be the perfect solution, but the Pi does not play well in the sandbox with a Bluetooth speaker when video is connected to HDMI. All audio goes to the HDMI audio.

What I have tried already:
1. Using the Desktop, discovered and paired the CPP-4303 Bluetooth speaker, select CPP-4303 as audio device using the audio icon in the upper right corner of the Desktop. Speaker responds with connect tone.
2. Run MP4 using VLC - audio goes to HDMI.
3. Run OTA DVB using Kaffeine - audio goes to HDMI.
4. Tried forcing the audio to 3.5mm analog jack using CLI raspi-config & reboot - audio goes to HDMI.
5. Run MP4 video using omxplayer from CLI - audio goes to HDMI.
6. Checked the configuration file /boot/config.txt and verified HDMI is NOT forced.

I think I am starting to see a pattern here. After two day of checking many forums, it seems that when HDMI is connected, all audio goes to HDMI.

Debugging:
1. Verify Bluetooth mouse and ViewSonic are not part of the problem. Setup Pi with Maker fire 7” display, USB wired mouse. No audio. Tried selecting audio out to analog, no audio on headset. Tried audio out to CPP-4303 Bluetooth, no audio.
2. Paired Bluetooth speaker to cell phone – Bluetoothspeaker works well.
3. Ran CLI bluetoothctl and verified correct setup.
Then edit 20-bluealsa.conf as per a forum thread.
sudo nano /usr/share/alsa/alsa.conf.d/20-bluealsa.conf

#ADD to end of file and save

pcm.CPP-4303 {
type plug
slave.pcm {
type bluealsa
device "54:5D:A7:1F:50:75"
profile "a2dp"
}
hint {
show on
description "JUSTOP BTR006"
}
}

This CLI command will play through the Bluetooth speaker using the speaker MAC.
aplay -D bluealsa:HCI=hci0,DEV=54:5D:A7:1F:50:75,PROFILE=a2dp /usr/share/scratch/Media/Sounds/Instruments/SpookyString.wav

Copied a .wav file from a music CD to the Pi and played the audio through the Bluetooth speaker using CLI aplay command.

So the Raspberry Pi can output to a Bluetooth speaker, but it seems to only work with aplay and a .wav file using the CLI.
Now if I could make it work from the Desktop with Kaffeine and / or VLC.
The CLI will not be available in the finished Pi TV because I won’t have a keyboard connected.

Return to “Graphics, sound and multimedia”