# apt install bluez pulseaudio-module-bluetooth
# vi /etc/systemd/system/pulseaudio.service
[Unit]
Description=Pulse Audio
[Service]
Type=simple
ExecStart=/usr/bin/pulseaudio --system --disallow-exit --disable-shm
[Install]
WantedBy=multi-user.target
# vi /etc/dbus-1/system.d/pulseaudio-bluetooth.conf
<busconfig>
<policy user="pulse">
<allow send_destination="org.bluez"/>
</policy>
</busconfig>
ネットの文献では/etc/pulse/system.paの末尾に以下を追加とあったが、私のファイルには既に追加されていた。
### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif
.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif
パルスオーディオを起動する。
# systemctl start pulseaudio.service
# systemctl enable pulseaudio.service
これでBluetoothスピーカーから音が出るようになった。最初の1回はペアリングのときにエラーが出た。そのときはbluetoothctlコマンドでデバイスを1回removeしたら直った。
$ bluetoothctl
[NEW] Controller B8:27:EB:52:48:48 raspi [default]
[NEW] Device 98:B7:15:3B:F7:90 BT_DONGLE
# remove 98:B7:15:3B:F7:90
# pair 98:B7:15:3B:F7:90
# connect 98:B7:15:3B:F7:90
# trust 98:B7:15:3B:F7:90
# quit
主にamazon musicを聴いているのだけど、今まで使っていたiPhoneやXperiaで聴くより高音質だ。なぜ?ラズパイってそんなにいいハードなのか?デジタル信号をBluetoothで飛ばしているだけだろうに、ハードの違いなんて出るのか。しかし良い音だ。Bluetoothでオーディオ信号を飛ばすとき、符号化方法が4種類くらいあるのを聞いたことがある。SBC/AAC/apt-X/LDACとか。それがスマホとは違うのだろうか。
0 件のコメント:
コメントを投稿