Bluetooth audio does not play in car without reconnecting bluetooth

REPRODUCIBILITY: Always
OS VERSION: 4.5.0.25
HARDWARE: Xperia 10 III
UI LANGUAGE: English
REGRESSION: Not that I’m aware

DESCRIPTION:

When I start my car (Hyundai Ioniq Electric 2018), it automatically connects with my phone over Bluetooth. However audio plays from the phone’s speaker until I go to settings, disconnect the car’s bluetooth and let it reconnect. After that it works find, but having to do this every time is annoying.

PRECONDITIONS:

I’m not aware of any, but I haven’t tested this with any other cars.

STEPS TO REPRODUCE:

  1. Start car
  2. Wait a few seconds for bluetooth connection
  3. Start music playback (from phone or from car, doesn’t matter)

EXPECTED RESULT:

Music plays from car’s speakers.

ACTUAL RESULT:

Music plays from phone’s speaker.

MODIFICATIONS:

I have a few native applications installed from unofficial sources (Pure Maps, OSM Scout Server, Sailtrix, DeaDBeef) plus some Android applications, but it seems unlikely that those would affect this issue.

ADDITIONAL INFORMATION:

On the first connection pacmd list-cards shows the car’s a2dp_sink profile as unavailable. On reconnect the profile is available and gets activated.

There doesn’t seem to be any way to attach files here when creating a new topic, so I’ll add logs later once I figure out how.

Still can’t find any button for attaching files. The upload button on the toolbar only works for images.

System journal for failed connection:

Apr 08 22:02:48 Xperia10III bluetoothd[5036]: bluetoothd[5036]: profiles/audio/avctp.c:uinput_create() Can't open input device: No such file or directory (2)
Apr 08 22:02:48 Xperia10III bluetoothd[5036]: bluetoothd[5036]: profiles/audio/avctp.c:init_uinput() AVRCP: failed to init uinput for IONIQ
Apr 08 22:02:48 Xperia10III bluetoothd[5036]: profiles/audio/avctp.c:uinput_create() Can't open input device: No such file or directory (2)
Apr 08 22:02:48 Xperia10III bluetoothd[5036]: profiles/audio/avctp.c:init_uinput() AVRCP: failed to init uinput for IONIQ
Apr 08 22:02:48 Xperia10III bluetoothd[5036]: bluetoothd[5036]: src/service.c:btd_service_connect() a2dp-sink profile connect failed for 44:91:60:8C:B3:9A: Device or resource busy
Apr 08 22:02:48 Xperia10III bluetoothd[5036]: src/service.c:btd_service_connect() a2dp-sink profile connect failed for 44:91:60:8C:B3:9A: Device or resource busy

Bluetoothctl output:

[CHG] Device 44:91:60:8C:B3:9A Connected: yes
[NEW] Endpoint /org/bluez/hci0/dev_44_91_60_8C_B3_9A/sep1 
[NEW] Transport /org/bluez/hci0/dev_44_91_60_8C_B3_9A/fd6 
[DEL] Transport /org/bluez/hci0/dev_44_91_60_8C_B3_9A/fd6 
[DEL] Endpoint /org/bluez/hci0/dev_44_91_60_8C_B3_9A/sep1 
[CHG] Device 44:91:60:8C:B3:9A Connected: no

Pulseaudio device information:

    index: 5
        name: <bluez_card.44_91_60_8C_B3_9A>
        driver: <module-bluez5-device.c>
        owner module: 26
        properties:
                device.description = "IONIQ"
                device.string = "44:91:60:8C:B3:9A"
                device.api = "bluez"
                device.class = "sound"
                device.bus = "bluetooth"
                device.form_factor = "hands-free"
                bluez.path = "/org/bluez/hci0/dev_44_91_60_8C_B3_9A"
                bluez.class = "0x240408"
                bluez.alias = "IONIQ"
                device.icon_name = "audio-handsfree-bluetooth"
                device.intended_roles = "phone"
        profiles:
                a2dp_source: High Fidelity Capture (A2DP Source) (priority 20, available: unknown)
                a2dp_sink: High Fidelity Playback (A2DP Sink) (priority 40, available: no)
                headset_head_unit: Headset Head Unit (HSP/HFP) (priority 30, available: unknown)
                off: Off (priority 0, available: yes)
        active profile: <off>
        ports:
                handsfree-output: Handsfree (priority 0, latency offset 0 usec, available: unknown)
                        properties:
                                
                handsfree-input: Handsfree (priority 0, latency offset 0 usec, available: unknown)
                        properties:
                                

System journal from successful connection:

Apr 08 22:03:22 Xperia10III bluetoothd[5036]: bluetoothd[5036]: profiles/audio/avdtp.c:avdtp_connect_cb() connect to 44:91:60:8C:B3:9A: Connection refused (111)
Apr 08 22:03:22 Xperia10III bluetoothd[5036]: profiles/audio/avdtp.c:avdtp_connect_cb() connect to 44:91:60:8C:B3:9A: Connection refused (111)
Apr 08 22:03:22 Xperia10III bluetoothd[5036]: bluetoothd[5036]: profiles/audio/avctp.c:uinput_create() Can't open input device: No such file or directory (2)
Apr 08 22:03:22 Xperia10III bluetoothd[5036]: bluetoothd[5036]: profiles/audio/avctp.c:init_uinput() AVRCP: failed to init uinput for IONIQ
Apr 08 22:03:22 Xperia10III bluetoothd[5036]: profiles/audio/avctp.c:uinput_create() Can't open input device: No such file or directory (2)
Apr 08 22:03:22 Xperia10III bluetoothd[5036]: profiles/audio/avctp.c:init_uinput() AVRCP: failed to init uinput for IONIQ
Apr 08 22:03:24 Xperia10III bluetoothd[5036]: bluetoothd[5036]: /org/bluez/hci0/dev_44_91_60_8C_B3_9A/fd9: fd(30) ready
Apr 08 22:03:24 Xperia10III bluetoothd[5036]: /org/bluez/hci0/dev_44_91_60_8C_B3_9A/fd9: fd(30) ready

Bluetoothctl output:

[CHG] Device 44:91:60:8C:B3:9A Connected: yes
[NEW] Endpoint /org/bluez/hci0/dev_44_91_60_8C_B3_9A/sep1 
[NEW] Transport /org/bluez/hci0/dev_44_91_60_8C_B3_9A/fd7 
[CHG] Transport /org/bluez/hci0/dev_44_91_60_8C_B3_9A/fd7 State: active
[CHG] Transport /org/bluez/hci0/dev_44_91_60_8C_B3_9A/fd7 State: idle
[CHG] Transport /org/bluez/hci0/dev_44_91_60_8C_B3_9A/fd7 State: active
[CHG] Transport /org/bluez/hci0/dev_44_91_60_8C_B3_9A/fd7 State: idle
[DEL] Transport /org/bluez/hci0/dev_44_91_60_8C_B3_9A/fd7 
[DEL] Endpoint /org/bluez/hci0/dev_44_91_60_8C_B3_9A/sep1 
[CHG] Device 44:91:60:8C:B3:9A Connected: no

Pulseaudio device information:

    index: 6
        name: <bluez_card.44_91_60_8C_B3_9A>
        driver: <module-bluez5-device.c>
        owner module: 27
        properties:
                device.description = "IONIQ"
                device.string = "44:91:60:8C:B3:9A"
                device.api = "bluez"
                device.class = "sound"
                device.bus = "bluetooth"
                device.form_factor = "hands-free"
                bluez.path = "/org/bluez/hci0/dev_44_91_60_8C_B3_9A"
                bluez.class = "0x240408"
                bluez.alias = "IONIQ"
                device.icon_name = "audio-handsfree-bluetooth"
                device.intended_roles = "phone"
        profiles:
                a2dp_source: High Fidelity Capture (A2DP Source) (priority 20, available: no)
                a2dp_sink: High Fidelity Playback (A2DP Sink) (priority 40, available: yes)
                headset_head_unit: Headset Head Unit (HSP/HFP) (priority 30, available: unknown)
                off: Off (priority 0, available: yes)
        active profile: <a2dp_sink>
        sinks:
                bluez_sink.44_91_60_8C_B3_9A.a2dp_sink/#6: IONIQ
        sources:
                bluez_sink.44_91_60_8C_B3_9A.a2dp_sink.monitor/#8: Monitor of IONIQ
        ports:
                handsfree-output: Handsfree (priority 0, latency offset 0 usec, available: yes)
                        properties:
                                
                handsfree-input: Handsfree (priority 0, latency offset 0 usec, available: unknown)
                        properties:
                                

(Output from different programs was collected at different times so some things do not match, particularly the fdN strings in the object paths.)

Since I couldn’t attach the files, I’ve put them on my web server: https://www.tdb.fi/~tdb/tmp/sailfish_audio_problem_logs.zip

Let me know if there’s any other information I should gather.

1 Like

Some additional data points:

  • Bluetooth audio works correctly with my Steelseries Arctis Pro Wireless headset and doesn’t need this reconnect dance
  • Behavior is the same with both the builtin media player and DeaDBeef

Has any solution for this been found? Looks very much like what I’m seeing at the moment (C2, 5.0.0.70).

The car even displays the information on the audio currently being played, and i can pause via the car, but the sound output only come from the phone speaker. If I delete the bluetooth pairing and reinitialise it, it works. Once.

Phone connection also seems unreliable, not sure if this issue is related.

I created a program which monitors the status of the bluetooth audio device of the car and automatically disconnects if it detects that the profile isn’t working as it should. That “solved” the issue for me in the sense that I don’t have to manually fiddle with the phone when I get in the car. However I don’t know if completely removing and re-pairing the device can be automated in a similar way.

Out of curiosity, I wouldn’t need this program currently, but as my terminology understanding is a little bit meh, does program mean app and if so are you planning to publish it somewhere? Sounds like good solutions for those that suffer from this problem!

It’s more of a background service than an app visible in the phone’s UI. Currently it needs to be run in the terminal because I haven’t had time to figure out how to write a systemd unit file for it. I probably won’t be publishing any ready-to-install packages because I don’t have the resources to make it work on different kinds of cars (currently it’s very much hardcoded for my specific car), but might publish the source code for others to take inspiration of.

1 Like

In my case its even worse… When I connect my C2 to any car in any radio setup its always the same result: my C2 gets treated as speaker and I cant hear anything..I can control the music with the car radio start/stop/change songs etc. But sound is getting send to the phone. Thats definitive an issue of the C2 with SFOS5 as my old Sony XA2 Ultra never had this behaviour.

There was another post with this issue but I dont know if it was solved finally

I would imagine that to be helpful to others. Great to hear that you were able to solve the problem!

How do you detect that the profile is not working as it should?

I query PulseAudio for information about the device representing the car (recognized by the name “IONIQ”) and check if it has an active profile with any audio sinks. If there’s no sinks then it’s malfunctioning and I send a D-Bus message to Bluez asking it to disconnect the device. There’s a few seconds of delay to let any necessary initialization happen.