Attemting to install Bluez-alsa on Vero4k+

Hi, after installing the latest version of Bluez-alsa:

…on my pi4, it gives support for much better quality bluetooth codecs, wasn’t too much of a pain to install and setup, and the difference in audio quality between the standard bluetooth codec SBC and LDAC or Aptx-HD is like night and day.

So Im having a crack at installing it on my Vero4k+, but running into a few issues.

One of the requirements is the package bluez >= 5.0, but when I try to install it im getting the error:

Unpacking bluez (5.43-2+deb9u1) ...

dpkg: error processing archive /var/cache/apt/archives/bluez_5.43-   2+deb9u1_armhf.deb (--unpack):

trying to overwrite '/etc/dbus-1/system.d/bluetooth.conf', which is also in package armv7-bluez-osmc 5.43-3

dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)

Errors were encountered while processing:

/var/cache/apt/archives/bluez_5.43-2+deb9u1_armhf.deb

E: Sub-process /usr/bin/dpkg returned an error code (1)

Any ideas chaps?

We already ship BlueZ 5.

Don’t try to install bluez from the Debian repo.

The package builder is using pkg-config, so the best approach is probably to follow the instructions from the page you linked to:

$ autoreconf --install
$ mkdir build && cd build
$ ../configure --enable-aac --enable-ofono --enable-debug

When you get to the third (configure) step it’ll fail when it checks for various packages, eg bluez, dbus-1, glib-2.0, and so on. You’ll need to install the relevant development package for each missing package you encounter. Most will be in the format lib<pkgname>-dev, eg libdbus-1-dev, libglib-2.0-dev, etc, though the bluez package is, I believe, called libbluetooth-dev.

Cheers fellas, I will have another bash at it tomorrow.

@sam_nazarko @dillthedog
Progress:
Followed the advice here and everything is installed and working, in that I can successfully play wav files from the CLI to my bluetooth receiver using both AptX-HD and LDAC codecs, and they sound great.

Only problem now is diverting the Kodi audio to the bluetooth on the Vero.

On my Pi4, after creating the .asoundrc file, I just set Kodi’s audio output setting to ‘ALSA:default’ and audio comes through the bluetooth, or ‘ALSA:HDMI’ to get the sound back through the TV.

I’ve tried the same approach on my Vero, but I still only get the options of ‘AML-M8AUDIO’, either PCM or HDMI.

There’s obviously a step needed on the Vero that wasn’t needed on the Pi4…feel like I’m really close now, any ideas?

If you’re streaming to the Vero, I don’t think you need to change anything for audio. It should only be necessary to stream from it

Yes thats the aim here Sam, to stream from Vero4k to Bt headset.

That’s quite experimental. I don’t know if the audio sink will show up.

Did you install the A2DP package?

Yeah I’m aware of that Sam…I was hoping it would be relatively simple, as it was on the Pi.

The A2DP package insists on installing pulseaudio, when that’s installed BT streaming works, but then its only with the basic SBC codec.

To get it working on the Pi4, the recommendation is to completely remove anything to do with pulse audio, then it just works.

I feel I’m irritatingly close…as on the Pi4 once I had it playing from the CLI, it was just a question of setting the correct output in Kodi.

We looked in to bluez-alsa and the reason we didn’t use the package above is it doesn’t support streaming from some devices to others. I even spoke to Arkadiusz (the developer) of the package; but we both came to the conclusion that it wasn’t the right solution.

Can you post a Kodi log so we can see which sinks are being made available to Kodi?

Sam

Sure, im popping out for an hour and will do so when I get back.
Thanks for looking into it Sam.

Hi Sam, here are the logs…
https://paste.osmc.tv/sihizakoto

Ive made a change to the .asoundrc file (renamed the device from ‘default’ to ‘dongle’) and now the device shows up as an option in audio devices…however when selected I still get no audio output from the bluetooth dongle.

.asoundrc:

defaults.bluealsa.interface "hci0"
defaults.bluealsa.device "40:ED:98:19:9A:8E"
defaults.bluealsa.profile "a2dp"
defaults.bluealsa.delay 10000

pcm.dongle {
  type plug
  slave.pcm {
          type bluealsa
          device "40:ED:98:19:9A:8E"
          profile "a2dp"
  }
  hint {
          show on
          description "BT_Headset"
  }
}

Apart from that It’s exactly as suggested by the guy who made Bluealsa.

Kodi can see the dongle:

2019-12-30 13:12:51.092 T:4024431328  NOTICE:     Device 2
2019-12-30 13:12:51.092 T:4024431328  NOTICE:         m_deviceName      : dongle
2019-12-30 13:12:51.092 T:4024431328  NOTICE:         m_displayName     : BT_Headset
2019-12-30 13:12:51.092 T:4024431328  NOTICE:         m_displayNameExtra:
2019-12-30 13:12:51.092 T:4024431328  NOTICE:         m_deviceType      : AE_DEVTYPE_PCM
2019-12-30 13:12:51.092 T:4024431328  NOTICE:         m_channels        : FL, FR
2019-12-30 13:12:51.092 T:4024431328  NOTICE:         m_sampleRates     : 96000
2019-12-30 13:12:51.092 T:4024431328  NOTICE:         m_dataFormats     : AE_FMT_S16NE,AE_FMT_S16LE
2019-12-30 13:12:51.092 T:4024431328  NOTICE:         m_streamTypes     : No passthrough capabilities

Maybe try set # of channels to 2.
I’m not sure why there is no sound.

Yes I noticed that after changing the name.
The default is 2 channel, ive tried adjusting lots of Kodi audio settings, but it doesn’t make a difference…ive reverted back to default which is 2 channels.

My brother is coming round later and he’s bringing his BT headphones, I’ll see if they behave any differently.

Any other suggestions are welcome.

Also worth seeing if bluez-alsa makes any complaints / anything in logs

Just tried a different set of BT headphones Sam and the behaviour is identical.

Nothing looks worrying in the Bluealsa logs:

Dec 30 14:01:58 osmc bluealsa[308]: /usr/bin/bluealsa: D: ../../src/bluealsa-dbus.c:139: Called: org.bluealsa.Manager1.GetPCMs()
Dec 30 14:01:58 osmc bluealsa[308]: /usr/bin/bluealsa: D: ../../src/bluealsa-dbus.c:139: Called: org.bluealsa.Manager1.GetPCMs()
Dec 30 14:02:47 osmc bluealsa[308]: /usr/bin/bluealsa: D: ../../src/bluez.c:719: Called: org.bluez.MediaEndpoint1.SelectConfiguration()
Dec 30 14:02:47 osmc bluealsa[308]: /usr/bin/bluealsa: D: ../../src/bluez.c:1270: Signal: org.freedesktop.DBus.ObjectManager.InterfacesAdded()
Dec 30 14:02:47 osmc bluealsa[308]: /usr/bin/bluealsa: D: ../../src/bluez.c:719: Called: org.bluez.MediaEndpoint1.SetConfiguration()
Dec 30 14:02:47 osmc bluealsa[308]: /usr/bin/bluealsa: D: ../../src/bluez.c:640: A2DP Source (AAC) configured for device AC:19:06:01:18:90
Dec 30 14:02:47 osmc bluealsa[308]: /usr/bin/bluealsa: D: ../../src/bluez.c:642: Configuration: channels: 2, sampling: 48000
Dec 30 14:02:47 osmc bluealsa[308]: /usr/bin/bluealsa: D: ../../src/ba-transport.c:715: State transition: 0 -> 0
Dec 30 14:02:47 osmc bluealsa[308]: /usr/bin/bluealsa: D: ../../src/bluez.c:764: Creating media endpoint object: /org/bluez/hci0/A2DP/MPEG24/Source/3
Dec 30 14:02:47 osmc bluealsa[308]: /usr/bin/bluealsa: D: ../../src/bluez.c:795: Registering media endpoint: /org/bluez/hci0/A2DP/MPEG24/Source/3

Identical to the logs when on a working system (Pi4), and when I playback a wav file from the command line…just no audio from Kodi.

Is this in anyway similar to the issues that prompted you to avoid Bluez-alsa?

The problem we had with bluez ALSA is that it doesn’t support streaming from a device, such as a phone. I’m not sure what the issue is, but it may be worth contacting the maintainer or seeing if they have some troubleshooting steps.

When I last looked, the issue was that bluez-alsa didn’t present itself as a separate device. There has been some github discussion about that but I haven’t seen anything to suggest a device has been implemented.

If it works in RPi, we ought to be able to get it to work (as a sink) on vero.

2019-12-30 13:12:56.093 T:4024431328 ERROR: ActiveAE::InitSink - failed to init

Can you turn on detailed debugging for the audio component and repeat?

It works really well on the pi graham, had it all setup and working in under 15 mins, including compiling it.
I naively thought it would be the same simple process on the Vero.

Its a shame as I use my BT headphones a lot with kodi, so I can blow my own ears in late at night without disturbing anyone…tbh if the difference in quality wasn’t so stark then id just blow the idea off and use pulse and the SBC codec, but it really makes a difference.

Any ideas or suggestions then please give the thread a bump mate.

Edit: Just seen your post mate, ill turn on detailed debugging for the audio component and repeat.

Here you go Graham:
https://paste.osmc.tv/bisasodama

Something worth noting, the BT device in the .asoundrc only shows up after manually connecting via bluetoothctl, then restarting the mediacenter service, not sure if thats important or not.