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)

Adam Ryczkowski
  • 4,403
  • 9
  • 40
  • 65
  • I do not remember complete solution with my A2DP box, but I remember the tools which helped me - paman and pavucontrol. – N0rbert Nov 19 '17 at 20:09
  • @N0rbert Thank you for input. I suspect the problem is not in PulseAudio. I can use A2DP sound on all computers with other device - Creative D100 speaker. – Adam Ryczkowski Nov 20 '17 at 11:33
  • 1
    Hi @AdamRyczkowski, I know this is a silly question, but, I've had a similar issue with my SAAB and a BlueTooth Mobile. I know that is not an Ubuntu device but I did kick myself. Once the BT was connected I had to select 'Aux In' on the radio, then turn up the volume beyond 50% to gear anything. It seems the BT connection plays at a low volume and the BT connection is managed in the same way as the aux in audio jack. Maybe worth tinkering with the radios settings for five minutes, just to make sure. – Piloti Nov 24 '17 at 11:44
  • @Piloti I understand, but it is not the problem. I went to my car with three notebooks, (some dual boot), and tried many times all the OSes. The device definitely works under Ubuntu 14.04 and doesn't on 16.04 regardless of volume settings. Unfortunately - that would be an easy fix! – Adam Ryczkowski Nov 25 '17 at 14:51

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,023
  • 25
  • 98
  • 183