2

I try to get Bluetooth A2DP audio working on car's multimedia system (W53850, Toyota brand, 2011) with Ubuntu 16.04.

Audio works from Windows, or from Ubuntu 14.04, so the problem must be Ubuntu 16.04-specific. And it is not a hardware problem, because the bluetooth audio works on the same Ubuntu 16.04 laptop, when I dual-boot into Windows 10.

The whole setup procedure looks and feels exactly the same in Ubuntu 14.04 and Ubuntu 16.04, with the only obvious difference that when I finally play the sound on the 16.04, I hear nothing from car's speakers.

This the procedure I use in detail:

  1. Remove old pairings from the car's multimedia system
  2. Remove old pairings from Ubuntu

  3. Start pairing procedure on car's multimedia system.

  4. On Ubuntu under "Bluetooth settings" click "+" to get "Device Search"
  5. After a few seconds a device "CAR M_MMEDIA" appears, click it.
  6. Under Ping options select the correct pin (it is "0000" anyway, but just be safe). OK.
  7. Next. After a second I get confirmation "Successfully setup new device 'CAR M_MEDIA'. Quit.
  8. In car's system exit the "setup" menu (otherwise the sound will be blocked).
  9. In Sound settings I select "Handsfree CAR M_MEDIA" in "Play sound through" list. Sound settings
  10. Play some music.
  11. The music player show progression in playback time - which indicate that the player is effectively pushing data into the pulse audio sink.
  12. No sound is heard.

Diagnostics I was able to do so far

On Ubuntu 14.04 I was able to discover the services from the command line:

$ bt-device -s "CAR M_MEDIA"
Discovering services...

[RECORD:65537]
SrvClassIDList: "AudioSink"
ProtocolDescList:
    "L2CAP", 0x19
    "AVDTP", 0x100
BTProfileDescList:
    "AdvAudio", 0x100
SrvName: "Audio Sink"
ProviderName: ""

[RECORD:65538]
SrvClassIDList: "AVRemote"
ProtocolDescList:
    "L2CAP", 0x17
    "AVCTP", 0x102
BTProfileDescList:
    "AVRemote", 0x103
SrvName: "A/V RemoteControl"
ProviderName: ""

Done

I can't do the same on 16.04, because all my two 16.04 computers display error

$ bt-device -s "CAR M_MEDIA"
Discovering services...
Failed to start SDP discovery. Please make sure you have bluez-utils installed on your system.

even if I run bluetoothd in the --compat mode.

Maybe Ubuntu 14.04 sends sound in a different sampling frequency (48 kHz as opposed to 44.1 kHz)? But I don't know how to test it.


Here is a hcidump from the sequence: a) connecting to the audio sink (car audio) b) playing music, c) stopping music and d) disconnecting.

Ubuntu 14.04 hcidump (audio works)

Ubuntu 16.04 hcidump (audio doesn' work)

1 Answers1

2

bluez-utils is currently listed as a transitional package for trusty (14.04) and is currently unavailable for Xenial (16.04). Research indicates that the package you need for Xenial is bluez-tools.

One gotcha is that bluez-tools post v0.2 uses bluez-5.20 API. Due to the removal of DiscoverServices in the BlueZ 5 device API, bt-device requires `sdptool' (included in bluez-utils for 14.04) for service discovery.

A quick search indicates that sdptool can now be found in the bluez package. This package appears to be required for sdptool based on the error message:

Failed to start SDP discovery. Please make sure you have bluez-utils installed on your system.

My approach would be as follows:

1) Enable the universe repository

2) install necessary packages

sudo apt install bluez bluez-tools

Note: bluez is installed by default if I'm not mistaken, so you might need to

sudo apt-get install --reinstall bluez

3) It's entirely feasible that you may also require D-Bus service for OBEX client and server side functionality

sudo apt install obex-data-server

Sources:

The error message in your question

https://packages.ubuntu.com/

https://github.com/khvzak/bluez-tools

https://www.synopsys.com/software-integrity/security-testing/fuzz-testing/defensics/protocols/bt-obexs.html

https://en.wikipedia.org/wiki/OBject_EXchange

Elder Geek
  • 36,752