Raspberry Pi (Bluetoothスピーカー接続編)…Raspberry PiでBluetoothスピーカーを鳴らす。
AS-BT100(Pioneer)の例ですが、他のBluetoothスピーカーでもOKです。
1.Bluetoohドングル接続 ← Raspberry Pi B+なら内蔵
Planex BT-MicroEDR2X等
2.Bluetoothパッケージのインストール
# apt-get install bluetooth bluez-utils bluez-alsa blueman
3.再起動
# reboot
ドングルのLEDが点滅し始めれば、ドングルが認識されています。
# lsusb
ドングルのデバイス名が表示されます。
4.Bluetoothスピーカーをペアリングモードにする。
BTAボタン、▷ の順に押すとBT AUDIOインジケータが点滅します。
5.Bluetoothデバイスの登録
①Desktop(or VNCビュア) > メニュー > 設定からBluetooth Managerを起動
②検索ボタンを押す。
③AS-BT100が表示されたら、アドレス(例:10:B7:F6:01:54:7A)をコピーする。
④右クリックでsetupを起動、Use Custom PassKeyにパスキーを入力、[進む]ボタンを押す。
接続:A2DP Sink(Send Audio)を選択して、[進む]ボタンを押す。
パスキーが認証されて、AS-BT100に自動的に接続されます。
⑤次回からは、アイコンをクリックしてAudio Sinkで接続します。
6.~/.asoundrc を作成する。
# nano ~/.asoundrc
——————————————————————————
pcm.!bluetooth {
type bluetooth
device “10:B7:F6:01:54:7A”
profile “auto”
}
——————————————————————————
7.~/.asoundrc を/etcにコピーする。
# cp ~/.asoundrc /etc/asound.conf
8./etc/bluetooth/audio.conf を編集する。
# nano /etc/bluetooth/audio.conf
——————————————————————————
[General]
Enable=Source,Sink,Headset,Gateway,Control,Socket,Media ←追記
——————————————————————————
9.bluetoothデーモン再起動
# /etc/init.d/bluetooth restart
10.再生
$ mplayer -ao alsa:device=bluetooth /mnt/usbssd/music/test.mp3
MPlayer svn r34540 (Debian), built with gcc-4.6 (C) 2000-2012 MPlayer Team
Playing test.mp3.
libavformat version 53.21.1 (external)
Mismatching header version 53.19.0
Audio only file format detected.
Load subtitles in ./
==========================================================================
Requested audio codec family [mpg123] (afm=mpg123) not available.
Enable it at compilation.
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio Recoders
libavcodec version 53.35.0 (external)
Mismatching header version 53.32.2
AUDIO: 44100 Hz, 2 ch, floatle, 128.0 kbit/4.54% (ratio: 16000->352800)
Selected audio codec: [ffmp3float] afm: ffmpeg (FFmpeg MPEG layer-3 audio)
==========================================================================
[AO_ALSA] Format floatle is not supported by hardware, trying default.
AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback…
A: 68.5 (01:08.5) of 190.0 (03:10.0) 8.1%
…こんな表示が出てBluetoothスピーカーから音が出ればOK
11.他のBluetoothデバイスの利用
Bluetoothデバイスの登録をすれば、Bluetoothマウス、Bluetoothキーボードなども使えるようになります。