Bluetooth audio output

However with configuration described in my first post of this topic, I can hear sound from my bluetooth speakers using command speaker-test. Apparently Kodi is the problem.

I’m testing on a fresh install of OSMC on a Pi3, which is my sandbox machine, but I’m seeing the pulseaudio service – which is what I’d expect.

Based on some tests I’ve managed to run, the system-wide pulseaudio.service is installed as part of the a2dp-app-osmc package. If it’s not there, it looks like you haven’t yet installed the package you built.

osmc@osmc:~$ dpkg -l | grep a2dp
ii  a2dp-app-osmc                        1.1.1                             all          A2DP streaming capabilities for OSMC

Did you compile and then install the compiled package? My compiled version is 1.1.0, whereas the version from the repository is 1.1.1.

osmc@osmc:~$ dpkg -l a2dp-app-osmc
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                            Version              Architecture         Description
+++-===============================-====================-====================-====================================================================
ii  a2dp-app-osmc                   1.1.0                all                  A2DP streaming capabilities for OSMC

The system instance of pulseaudio is not included in version 1.1.1.

In the other thread you mentioned @Den4t installed latest osmc 2018-02-01.

Hi Sam !

Made a fresh installation (latest osmc 2018-02-01) with the git-version of a2dp-app-osmc, and here is my dicovering.

However system instance was removed in December. See History for package/a2dp-app-osmc - osmc/osmc · GitHub.

Kinda weird. Are you suggesting that I should use the older version? Like the one from Nov 21, 2017?

The version of OSMC was the latest but the version of a2dp-app-osmc was taken from git, per this post:

as you seem to be willing to tinker with this a bit, I’d recommend you get to where we were before we made changes to try and get it running out of system mode.

apt-get install git build-essential
git clone https://github.com/osmc/osmc
cd osmc
git checkout 27a9e28b6d7224c540424445b45da87096042030
cd package/a2dp-app-osmc
make

Sam was suggesting that Den4t use the previous version of a2dp-app-osmc , which contains the system instance of pulseaudio.

Ok, I will try. Thanks!

It seems to be working. Thanks!

Ehm. Audio is out of sync by 1 or 2 seconds. Not the Bluetooth issue because my laptop with Kodi running on Arch Linux has no such issue.

Can this be fixed without manually adding offset?

PulseAudio has a big buffer, so this is an unfortunate side effect, and why we don’t want to use PA for the long term.

That’s interesting – and excellent news. Since I was under the impression that it no longer worked under Debian stretch, could you tell us if you did anything, other than what has already been discussed here?

It’s fantastically sporadic. In my testing I found that once it worked, it seemed to work permanently

About the audio synchronization, I don’t think it’s a Pulseaudio issue. I have just connected my bluetooth dongle and it is working perfectly. But I had to sacrifice wifi, it stopped being stable.

By the way I was testing Xiaomi TV Box and I have returned it to the seller because of same bluetooth audio lag. Maybe it is somehow connected with Amlogic chipsets.

Are you saying the audio lag has disappeared when using the external bluetooth dongle?

Yes

The AMLogic SoC and WiFi module are completely separate components.
Were you also using the on-board WiFi module, and were you connected to a 2.4Ghz network?

Connecting to a 2.4Ghz network will obviously degrade performance if you use Bluetooth simultaneously due to the proximity of the radios.

PulseAudio uses large buffers which can cause delays.
If there were issues with the on-board Bluetooth I’d expect you to experience dropouts / crackling.

Sam

No, nothing like dropouts, crackling or lags. It was clear all the time 2 second delay.

And yes, I have 2.4GHz WiFi. But when I connected external dongle, delay was gone even on WiFi.