Send PC Sound to HifiberryOS on Raspberry Pi via bluetooth

Hey folks,

I would appreciate any help on the following problem.
I have a Raspberry Pi 4 running Hifiberry OS (the 32 version) connected to my analog sound system. I can connect to the hifiberry via bluetooth on my desktop pc running endeavouros, but the hifiberry does not get recognized as a sound output in system settings.

So I cannot send the pc audio output to the raspberry.
I can use other devices (for example my bluetooth headphones or a different wireless bluetooth speaker) just fine, they get recognized in the system settings.

Any tips for troubleshooting?

Thanks in advance!

I don’t know any specifics here, but I would suspect you need to configure the Pi to act like a sound device. The PC it is connecting to isn’t sending sound because it doesn’t think your Pi is a speaker or headphones.

Yeah it is listed as “Multimedia” with a sound card symbol.
But I cannot find any config options in the bluetooth settings in KDE.
Where do I need to look?
Sorry!

By default, Bluetooth is disabled in EndeavourOS.
To enable Bluetooth on RPi 4b, edit the /boot/config.txt file and change this line

dtoverlay=disable-bt

to

# dtoverlay=disable-bt

Then do

sudo systemctl enable --now bluetooth

then reboot.

HTH

Pudge

Check the system messages e.g. with journalctl -f while you connect and look out for messages related to Bluetooth.

Thanks for the info, but bluetooth is enable both on my eos system and also on the rpi (it’s using hifiberryos, not the standard raspberry pi os)

This is the info from journalctl:

Okt 18 17:41:27 host bluetoothd[1304]: src/service.c:btd_service_connect() a2dp-source profile connect failed for E4:5F:01:13:D3:D0: Device or resource busy
Okt 18 17:41:27 host kernel: input: hifiberry (AVRCP) as /devices/virtual/input/input18
Okt 18 17:41:27 host systemd-logind[1307]: Watching system buttons on /dev/input/event18 (hifiberry (AVRCP))

Looks OKish. I stream via roc toolkit not BT to the pi, but maybe I have time over the weekend to give it a try and see if something comes up.

Thanks, no rush!

Roc toolkit sounds interesting, will have to look into it.

One learns something new every day.

When you referred to hifiberryos I jumped to the conclusion it was an app.
Until today, I never knew hifiberryos was a Operating System focusing on music. :notes:

Sounds like you are in good hands with @Schlaefer

Pudge

OK, I’m not familiar with Hifiberry OS, but I assume it’s raspberry OS with an autostart application layer?

I run into the same issue trying to pair via UI from the desktop, it seemed connected but the device didn’t show up in the audio config. The issue here was that actually it was not properly paired. Smartphone, tablet, TV all happily paired (in the past), but apparently not Linux.

If you’re interested we can try and walk through it. Can you use the terminal/ssh into the raspberry to execute bluetoothctl?

Yeah probably.

That would be awesome, if it’s ok for you :slight_smile:
Yes, I can ssh into the pi.

OK, disclaimer. I’ve read that HifiberryOS is not RaspiOS now, and I compile bluez, pipewire, wireplumber myself to use the latest versions. It didn’t even show up with a Soundcard symbol here, just a generic BT symbol. But the symptoms sound similar enough so it might be worth a try.


We will use bluetoothctl (btctl) to pair both devices. If you start it you’re in a new command prompt that allows to issue commands to BT. No worries, can’t do any harm here, everything is easily reversible. That’s how we start, make sure we have a clean slate.

In btctl do on both devices

list

That will show the name and address (addr) of the local BT adapter. We will use the addrs in commands. You can use autocomplete, just type e.g. the first two characters of the addr and hit tab.

Sometimes btctl needs a few seconds to perform its task. As long as the tab completion doesn’t work the addr/adapter isn’t available. Have to wait longer.

Do

devices

which shows known devices. If either knows of the other do

remove <other-addr>

to remove the other device.

On the desktop:

scan on

which will search for new devices.

On the Raspi:

agent off
agent KeyboardDisplay
default-agent

This is important so that we can confirm the pin request on pairing in the CLI.

On the raspi:

pairable on
discoverable on

Back to the desktop. You have to wait until the desktop sees the raspi. Should output [NEW] <raspi something> (wait for tab complete on the address to work).

pair <raspi-addr>

Wait a second, they should both ask for pin confirmation. You have a short window on both devices to confirm (yes + enter).

That should pair both devices (no error messages, give it a second). Check with

devices Paired

They should show each other. Then on each device trust the other:

trust <others-device-addr>

And now we should be good (can be checked with devices Trusted). Try to connect how you usually would.

If something goes wrong and btctl doesn’t seem to respond (bt sometimes gets stuck) quit btctl and do sudo systemctl restart bluetooth and start btctl at the top with removing devices again.

If everything worked turn off pairable, discoverable, scan on the respective devices.

That worked for me, good luck. :wink:

Thanks for your super fast reply!

I have both in a Konsole Split view, but when I get to pair raspi there is no asking for the pin.
I can still pair and trust though, and the hifiberry get’s shown in the bluetooth settings in kde as connected, but still not as a sound option.

That’s were I got stuck too. The desktop always wanted confirmation for the pin but the raspi didn’t show anything. Don’t know why.

agent off
agent KeyboardDisplay
default-agent

Finally triggered a confirmation on the raspi. But it was finicky. Maybe give it a few tries.

PS: Alas run out of time to do multiple tests, will do another clean try later.

Managed to connect with pin confirmation!
They are now paired, trusted and connected.

But unfortunately still nothing shown in kde sound settings :frowning:

I seem to remember I had debian installed once and it worked fine with the raspberry as a streaming device. So I am starting to think maybe it’s something missing on my endeavouros box?

Solved it!

Trick was to use pavucontrol.
In the configuration for the hifiberry I changed it from A2DP-source to A2DP-sink and now it is showing up in the sound settings and the streaming works.

Thanks so much for your tips and help!

Happy weekend :slight_smile:

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.