Skip to content

Commit ec17fd3

Browse files
committed
fix(audio): fix BluetoothAudioMode empty after bluez5 support
1. Add bluez5 device API recognition in getCardName to support PipeWire/BlueZ5 bluetooth audio devices 2. Fix refreshBluetoothOpts using friendly card name instead of pulse raw name for isBluezAudio check, causing BluetoothAudioMode to remain empty after bluetooth profile switch Log: fix BluetoothAudioMode empty caused by bluez5 card name change fix(audio): 修复 bluez5 支持后 BluetoothAudioMode 为空的问题 1. getCardName 中增加 bluez5 设备 API 的识别,支持 PipeWire/BlueZ5 蓝牙音频设备 2. 修复 refreshBluetoothOpts 中 isBluezAudio 使用友好名称而非 pulse 原始名称判断, 导致蓝牙 profile 切换后 BluetoothAudioMode 属性未被赋值 Log: 修复 bluez5 声卡名称变更导致 BluetoothAudioMode 为空 PMS: BUG-364299
1 parent 3a6fc43 commit ec17fd3

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

audio1/audio.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,7 @@ func (a *Audio) refreshBluetoothOpts() {
13141314
return
13151315
}
13161316

1317-
if !isBluezAudio(card.Name) {
1317+
if !isBluezAudio(card.core.Name) {
13181318
return
13191319
}
13201320

audio1/card.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func getCardName(card *pulse.Card) (name string) {
5151
propAlsaCardName := card.PropList["alsa.card_name"]
5252
propDeviceApi := card.PropList["device.api"]
5353
propDeviceDesc := card.PropList["device.description"]
54-
if propDeviceApi == "bluez" && propDeviceDesc != "" {
54+
if (propDeviceApi == "bluez5" || propDeviceApi == "bluez") && propDeviceDesc != "" {
5555
name = propDeviceDesc
5656
} else if propAlsaCardName != "" {
5757
name = propAlsaCardName

0 commit comments

Comments
 (0)