RaspberryPi4+Ubuntu24.04 で ssh接続時にBluetoothスピーカーから再生させる

ALL
スポンサーリンク

RaspberryPi4 + Ubuntu24.04 への ssh接続時のターミナルで、Bluetoothスピーカーから再生させる手順です。

必要モジュールをインストールします。

sudo apt-get install pi-bluetooth pulseaudio-module-bluetooth pavucontrol bluez

再起動します。

RaspberryPi4でBluetoothスピーカーを接続する | パソコン鳥のブログ の「Bluetooth接続」の箇所に従って Bluetoothスピーカーを接続します。

ssh接続した際に次を実行します。

sudo killall wireplumber
systemctl --user restart wireplumber pipewire pipewire-pulse

この後、次のコマンドを実行し、出力結果に「bluez_card.XX_XX_XX_XX_XX_XX module-bluez5-device.c」(XX_XX_XX_XX_XX_XX は BluetoothデバイスのMACアドレス)のような表示が出ることを確認してください。

pactl list cards short


この状態で、サウンドファイルを再生すると Bluetoothスピーカーから聞こえます。

mplayer /usr/share/sounds/alsa/Front_Center.wav

コメント