Skip to content

Conversation

@xxmathias
Copy link
Contributor

After a system reboot, AirPods microphone is detected, but the audio output (A2DP sink) is not available. This occurs because the Bluetooth connection is automatically restored by the system, but the A2DP audio profile is not activated, leaving only the HFP/HSP profile active (microphone only).


Solution

The solution is to add A2DP profile activation in three key scenarios:

  1. On system wake-up: Checks if AirPods are already connected and re-activates the A2DP profile.
  2. On BlueZ device connection: Activates the A2DP profile when AirPods are detected as connected via BlueZ (happens after reboot).
  3. On app startup: Activates the A2DP profile for already connected AirPods found during initialization.

Test Scenario

Category Detail
Platform Linux (OpenSUSE Tumbleweed, kernel 6.16.8-1-default)
Device AirPods Pro 3
Audio System PulseAudio (pactl)
Test Scenarios - System reboot with AirPods already paired
- Wake from sleep/suspend
- App restart while AirPods connected
- ✅ Manual Bluetooth reconnection

Technical Details

The fix ensures that pactl set-card-profile [device] a2dp-sink is called after detecting the AirPods connection, with appropriate delays (1-2 seconds) to ensure the Bluetooth connection is fully established before attempting profile switching.

This addresses the issue where users had to manually select AirPods as the audio output device / audio device not poping up after every reboot.

- Add A2DP profile activation on system wake-up
- Add A2DP profile activation when BlueZ detects connection
- Add A2DP profile activation for already connected devices on startup

Fixes issue where AirPods microphone works but audio output is unavailable after reboot
@kavishdevar
Copy link
Owner

kavishdevar commented Sep 30, 2025

lgtm! just had one small question:

[...] but the A2DP audio profile is not activated, leaving only the HFP/HSP profile active (microphone only)

Do you mean that by default the HSP/HFP profile is activated rather than A2DP, or is the A2DP profile not even available?

From my experience, when the bluetooth service restarts or similar, Pipewire/Pusleaudio doesn't even show the a2dp profile- only the headphone profile is. So I usually have to reconnect the AirPods at least once to get the a2dp profile available.

@xxmathias
Copy link
Contributor Author

lgtm! just had one small question:

[...] but the A2DP audio profile is not activated, leaving only the HFP/HSP profile active (microphone only)

Do you mean that by default the HSP/HFP profile is activated rather than A2DP, or is the A2DP profile not even available?

From my experience, when the bluetooth service restarts or similar, Pipewire/Pusleaudio doesn't even show the a2dp profile- only the headphone profile is. So I usually have to reconnect the AirPods at least once to get the a2dp profile available.

Thanks for the clarification! In my case, the A2DP profile is available after system reboot - it's just not automatically activated.

Here's what I observe on my system after a reboot. When I check the card profiles after reboot with pactl list cards:

  Profiles:
    off: Off (available: yes)
    a2dp-sink-sbc: High Fidelity Playback (A2DP Sink, codec SBC) (available: yes)
    a2dp-sink-sbc_xq: High Fidelity Playback (A2DP Sink, codec SBC-XQ) (available: yes)
    a2dp-sink: High Fidelity Playback (A2DP Sink, codec AAC) (available: yes)
    headset-head-unit-cvsd: Headset Head Unit (HSP/HFP, codec CVSD) (available: yes)
    headset-head-unit: Headset Head Unit (HSP/HFP, codec mSBC) (available: yes)
  Active Profile: off

So the profile is set to off initially, even though A2DP is available. The fix activates it programmatically.

However, based on your description, it sounds like you're experiencing a different issue where the A2DP profile doesn't even show up as available after Bluetooth/PipeWire restarts. That would require a different solution - possibly waiting for the profile to become available or, probably the better solution, triggering a reconnection.

Should I modify this PR to also handle that scenario, or would you prefer a separate fix for when A2DP is not initially available?

@kavishdevar
Copy link
Owner

Should I modify this PR to also handle that scenario, or would you prefer a separate fix for when A2DP is not initially available?

Nope, thank you! I think that's on BlueZ (or my config) to not setup the audio profiles properly. It happens even when A2DP wasn't disabled and then Audio/Bluetooth was restarted. I think there might be something in the config that I've changed causing this.

Anyway, thanks for the fix! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants