[PR #212] [MERGED] Fix: Activate A2DP audio profile for AirPods after system reboot on Linx #330

Closed
opened 2026-03-02 12:40:42 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kavishdevar/librepods/pull/212
Author: @xxmathias
Created: 9/30/2025
Status: Merged
Merged: 9/30/2025
Merged by: @kavishdevar

Base: mainHead: fix-airpods-audio-after-reboot


📝 Commits (1)

  • 193481b Fix: Activate A2DP audio profile for AirPods after system reboot

📊 Changes

1 file changed (+40 additions, -0 deletions)

View changed files

📝 linux/main.cpp (+40 -0)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kavishdevar/librepods/pull/212 **Author:** [@xxmathias](https://github.com/xxmathias) **Created:** 9/30/2025 **Status:** ✅ Merged **Merged:** 9/30/2025 **Merged by:** [@kavishdevar](https://github.com/kavishdevar) **Base:** `main` ← **Head:** `fix-airpods-audio-after-reboot` --- ### 📝 Commits (1) - [`193481b`](https://github.com/kavishdevar/librepods/commit/193481bdc96c23b46696a915ab99fdd12aa4ee22) Fix: Activate A2DP audio profile for AirPods after system reboot ### 📊 Changes **1 file changed** (+40 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `linux/main.cpp` (+40 -0) </details> ### 📄 Description 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<br>- Wake from sleep/suspend<br>- App restart while AirPods connected<br>- ✅ 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 12:40:42 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librepods#330
No description provided.