Raspberry Pi/Raspbian

bluetooth ヘッドセット設定

必要なソフトをインストールする。

apt install pi-bluetooth bluealsa pulseaudio pulseaudio-utils pulseaudio-module-bluetooth

タイマーベースのスケジューリングを無効にする

sudo vi /etc/pulse/default.pa

org.bluez を許可する

sudo vi /etc/dbus-1/system.d/bluetooth.conf

bluetooth サービス起動設定

sudo vi /lib/systemd/system/bluetooth.service

下記変更する。

bluetooth サービス起動

service bluetooth start

bluetooth サービス状態確認

service bluetooth status
or
systemctl status bluetooth

接続してみる

$ pulseaudio --start
$ sudo bluetoothctl
[bluetooth]# scan on               <-- スキャン開始
[bluetooth]# pair [アドレス]       <-- アドレスを指定してペアリングする
[bluetooth]# trust [アドレス]      <-- アドレスを指定して信頼されたデバイスとする
[bluetooth]# scan off
[bluetooth]# connect [アドレス]    <-- アドレスを指定して接続する
[bluetooth]# quit

<その他 bluetoothctl で使うコマンド>
[bluetooth]# devices               <-- デバイス一覧表示
[bluetooth]# paired-devices        <-- ペアリング設定されたデバイス表示
[bluetooth]# info [アドレス]       <-- 指定したデバイス情報表示
[bluetooth]# disconnect [アドレス] <-- 切断
[bluetooth]# remove [アドレス]     <-- デバイス削除

bluetooth サービスの自動起動設定

sudo systemctl enable bluetooth.service

以降、起動時は、下記実施で

pulseaudio --start
sudo bluetoothctl
[bluetooth]# connect [アドレス]

pulseaudio 停止

pulseaudio --kill

その他

bluetooth のヘッドセット接続できているか確認

pacmd list

音を鳴らす

aplay [webファイル]

うまくいかないとき

pacmd list で認識しているけど、aplay で再生されない場合
pulseaudio --kill
pulseaudio --start
sudo systemctl
connect [アドレス]

でうまくいくか試してみる

トップ   差分 バックアップ リロード   一覧 検索 最終更新   ヘルプ   最終更新のRSS