1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Gentoo LinuxでPipewireがBluetoothヘッドセットを認識しない問題の解決方法

1
Posted at

この記事はAIによって生成されましたが、実際の環境で問題を再現し、解決手順を検証した上で公開しています。

発生した問題

Gentoo Linux上でPipewireとBluezを使用している環境において、Bluetoothヘッドセットがペアリング済みにもかかわらず、音声出力デバイスとして認識されない問題が発生しました。

症状

  • bluetoothctlでは正常にペアリング・接続できる
  • wpctl statuspactl list cardsでBluetoothデバイスが表示されない
  • Pipewire経由でBluetoothオーディオが利用できない

環境

  • OS: Gentoo Linux (Base System 2.18)
  • Kernel: 6.12.48-gentoo-x86_64
  • Pipewire: 1.4.8
  • Wireplumber: 0.5.11
  • Bluez: 5.83

前提条件

以下のパッケージがインストールされ、サービスが起動していることを確認してください。

# パッケージの確認
equery list pipewire wireplumber bluez

# サービスの確認
systemctl status bluetooth
systemctl --user status pipewire pipewire-pulse wireplumber

必要なコンポーネント

  • media-video/pipewire (bluetoothサポート付き)
  • media-video/wireplumber
  • net-wireless/bluez
  • media-libs/libspa-bluez (Pipewireに含まれる)

Bluez5 SPAプラグインが正しくインストールされていることを確認:

ls /usr/lib/spa-0.2/bluez5/
# または
ls /usr/lib64/spa-0.2/bluez5/

libspa-bluez5.soなどのファイルが存在する必要があります。

診断手順

1. Pipewire/Wireplumberサービスの状態確認

systemctl --user status pipewire pipewire-pulse wireplumber

すべてのサービスがactive (running)であることを確認します。

2. Bluetoothデバイスの状態確認

# Bluetoothサービスの状態
systemctl status bluetooth

# ペアリング済みデバイスの一覧
bluetoothctl devices

# デバイスの詳細情報
bluetoothctl info <デバイスアドレス>

デバイスがPaired: yesかつTrusted: yesになっていることを確認します。

3. Pipewireでのデバイス認識確認

# オーディオデバイスの一覧
wpctl status

# 登録されているカード
pactl list cards short

# Bluez5デバイスの存在確認
pw-dump | grep -A 20 '"device.api" = "bluez5"'

Bluetoothデバイスが表示されない場合、Wireplumberの設定に問題がある可能性があります。

4. Wireplumber設定の確認

cat ~/.config/wireplumber/wireplumber.conf | grep -A 5 "hardware.bluetooth"

原因

Wireplumberの設定ファイル(~/.config/wireplumber/wireplumber.conf)において、mainプロファイル内のhardware.bluetoothがコメントアウトされていたことが原因でした。

デフォルト設定では以下のようになっている場合があります:

main = {
  inherits = [ base ]

  metadata.sm-settings = required
  metadata.sm-objects = required

  policy.standard = required

  #hardware.audio = required
  #hardware.bluetooth = required  #  ここがコメントアウトされている
  hardware.video-capture = required
}

この状態では、Wireplumberがbluetoothモニターを起動しないため、Bluezデバイスが検出されません。

解決方法

1. Wireplumber設定ファイルの編集

vim ~/.config/wireplumber/wireplumber.conf
# または
nano ~/.config/wireplumber/wireplumber.conf

設定ファイルがない場合は、システムのデフォルト設定をコピー:

mkdir -p ~/.config/wireplumber
cp /usr/share/wireplumber/wireplumber.conf ~/.config/wireplumber/

2. hardware.bluetoothの有効化

mainプロファイル内で、hardware.bluetoothのコメントを外します:

修正前:

main = {
  inherits = [ base ]

  metadata.sm-settings = required
  metadata.sm-objects = required

  policy.standard = required

  #hardware.audio = required
  #hardware.bluetooth = required
  hardware.video-capture = required
}

修正後:

main = {
  inherits = [ base ]

  metadata.sm-settings = required
  metadata.sm-objects = required

  policy.standard = required

  hardware.audio = required
  hardware.bluetooth = required
  hardware.video-capture = required
}

3. Wireplumberの再起動

設定変更を反映するため、Wireplumberを再起動します:

systemctl --user restart wireplumber

4. デバイス認識の確認

wpctl status

AudioセクションのDevices[bluez5]デバイスが表示されることを確認します:

Audio
 ├─ Devices:
 │      46. Built-in Audio                      [alsa]
 │     116. Bose Open Earbuds Ultra             [bluez5]  # ← Bluetoothデバイスが表示される
 │
 ├─ Sinks:
 │  *   41. Built-in Audio Digital Stereo (IEC958) [vol: 0.70]
 │     115. Bose Open Earbuds Ultra             [vol: 0.50]

参考: その他の便利なコマンド

Bluetoothデバイスへの接続

bluetoothctl connect <デバイスアドレス>

デフォルトオーディオデバイスの設定

wpctl set-default <デバイスID>

Pipewire全体の再起動

問題が解決しない場合、Pipewire関連サービスを全て再起動:

systemctl --user restart pipewire pipewire-pulse wireplumber

ログの確認

Wireplumberのログでエラーを確認:

journalctl --user -u wireplumber -n 50 --no-pager

Bluetooth関連のログのみ抽出:

journalctl --user -u wireplumber -n 100 --no-pager | grep -i blu

まとめ

Gentoo LinuxでPipewire/Wireplumberを使用する際、Bluetooth機能を利用するには~/.config/wireplumber/wireplumber.confで明示的にhardware.bluetooth = requiredを有効化する必要があります。

この設定が有効になっていることで、Wireplumberがbluetoothモニター(monitors/bluez.lua)を起動し、Bluezデバイスを検出・管理できるようになります。

関連リンク

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?