デスクトップをBluetoothヘッドセットとして使用

デスクトップをBluetoothヘッドセットとして使用

デスクトップスピーカーは携帯電話のスピーカーよりもはるかに良いので、携帯電話のスピーカーの代わりにデスクトップスピーカーを使用したいと思います。 USBやオーディオジャックを使用するのが不便で、Bluetoothをオンにしました。携帯電話をペアリングしたが接続しようbluetoothctlとすると、次のメッセージが表示されます。

[bluetooth]# pair 00:00:00:00:00:00 
Attempting to pair with 00:00:00:00:00:00
[CHG] Device 00:00:00:00:00:00 Connected: yes
Request confirmation
[agent] Confirm passkey 000000 (yes/no): yes
[CHG] Device 00:00:00:00:00:00 Modalias: bluetooth:a000Aa000000000
[CHG] Device 00:00:00:00:00:00 UUIDs: 00000000-0000-1000-8000-00000a0a00aa
[CHG] Device 00:00:00:00:00:00 UUIDs: 00000000-0000-1000-8000-00000a0a00aa
...
[CHG] Device 00:00:00:00:00:00 UUIDs: 00000000-0000-1000-8000-00000a0a00aa
[CHG] Device 00:00:00:00:00:00 UUIDs: 000000000-0000-1000-8000-00000a0a00aa
[CHG] Device 00:00:00:00:00:00 Paired: yes
Pairing successful
[CHG] Device 00:00:00:00:00:00 Connected: no
[CHG] Device 00:00:00:00:00:00 RSSI: -75
[bluetooth]# connect 00:00:00:00:00:00 
Attempting to connect to 00:00:00:00:00:00
Failed to connect: org.bluez.Error.Failed

私のMacアドレスを次に変更しましたが、00:00:00:00:00:00実際のMacアドレスは私の携帯電話が報告するものと一致します。UUIDs私は最後の2つのピンが何であるかはわかりませんが、ペアリングピンであるModaliasと同じことをしました。

ベストアンサー1

の2つのモジュールのおかげでpulseaudio*今これと接続するのはbluez本当に簡単です。

必須パッケージをインストールします。

sudo pacman -S bluez bluez-utils pulseaudio-bluetooth

pulseaudioグループにユーザーを追加します。

sudo usermod -a -G pulseaudio $USER

Bluetoothデーモンをオンまたは再起動します。

sudo systemctl restart bluetooth

Bluetoothデバイスを有効にします。

sudo hciconfig hci0 up

Bluetoothデバイスが複数ある場合は、引数なしで実行して見つけることができるhci0正しい識別子に置き換える必要があります。hciconfig

これで、bluetoothctl対話型ユーティリティを使用してデバイスを接続できます。

まず、ホスト名でArchマシンを検索可能にします。

$ bluetoothctl
[NEW] Controller AA:BB:CC:DD:EE:FF arch [default]

[bluetooth]# agent on
Agent registered

[bluetooth]# default-agent
Default agent request successful

[bluetooth]# discoverable on
Changing discoverable on succeeded
[CHG] Controller AA:BB:CC:DD:EE:FF Discoverable: yes

今、あなたの携帯電話はアーチボックスを見つけることができます。デバイスを選択し、確認プロンプトに戻ります。

Request confirmation
[agent] Confirm passkey 748794 (yes/no): yes
[CHG] Device FF:EE:DD:CC:BB:AA ...
... snipped ...
[agent] Authorize service 0001... (yes/no): yes
... snipped ...
[agent] Authorize service 0001... (yes/no): yes
[CHG] Controller AA:BB:CC:DD:EE:FF Discoverable: no

trust接続後にコマンドを実行すると、接続が切断される問題を修正しました。

[phone]# trust
[CHG] Device FF:EE:DD:CC:BB:AA Trusted: yes
Changing  trust suceeded

これでデスクトップスピーカーでオーディオを再生できるようになりました。

おすすめ記事