pepoとネットワークを語ろう

40年前からこれまでとこれからのネットワークを語る

Raspberry Pi Zero WHで中華Bluetoothとスピーカーを繋いで見たけど

2022-02-27 16:46:31 | パソコンよもやまばなし

興味本意で随分前に買って放置していた中華BluetoothのBT-DONGLEをRaspberry Pi Zero WHにBluetoothスピーカーとして使えるか試した

結果から言うとBT-DONGLEと500円スピーカーでそこそこの音源が再生出来たがノイズのプチプチだったのさ

さすがは中華Bluetooth、Amazonで検索したけどー日本はすでにトンズラ、海外市場に似たものはあったけどちょっと違うような

https://www.amazon.in/SS-Electronics-SYNEXTIX-Bluetooth-Receiver/dp/B078YS2RLQ


# apt install 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

# systemctl start pulseaudio.service
Created symlink /etc/systemd/system/multi-user.target.wants/pulseaudio.service → /etc/systemd/system/pulseaudio.service.
# systemctl enable pulseaudio.service

# bluetoothctl
Agent registered
[bluetooth]# help
Menu main:
Available commands:
-------------------
advertise                                         Advertise Options Submenu
scan                                              Scan Options Submenu
gatt                                              Generic Attribute Submenu
list                                              List available controllers
show [ctrl]                                       Controller information
select                                     Select default controller
devices                                           List available devices
paired-devices                                    List paired devices
system-alias                               Set controller alias
reset-alias                                       Reset controller alias
power <on/off>                                    Set controller power
pairable <on/off>                                 Set controller pairable mode
discoverable <on/off>                             Set controller discoverable mode
agent <on/off/capability>                         Enable/disable agent with given capability
default-agent                                     Set agent as the default one
advertise <on/off/type>                           Enable/disable advertising with given type
set-alias                                 Set device alias
scan <on/off>                                     Scan for devices
info [dev]                                        Device information
pair [dev]                                        Pair with device
trust [dev]                                       Trust device
untrust [dev]                                     Untrust device
block [dev]                                       Block device
unblock [dev]                                     Unblock device
remove                                      Remove device
connect                                     Connect device
disconnect [dev]                                  Disconnect device
menu                                       Select submenu
version                                           Display version
quit                                              Quit program
exit                                              Quit program
help                                              Display help about this program
export                                            Print evironment variables

[bluetooth]# scan on
[NEW] Device DA:ED:2A:4D:62:5F BT_DONGLE
[bluetooth]# scan off
Discovery stopped
[bluetooth]# pair DA:ED:2A:4D:62:5F
Pairing successful

[bluetooth]# connect DA:ED:2A:4D:62:5F
Connection successful

trust DA:ED:2A:4D:62:5F
Changing DA:ED:2A:4D:62:5F trust succeeded
quit

# usermod -a -G pulse-access,audio root

この後ななちゃんの子守唄
# mplayer nennendog.mp3

MPlayer 1.3.0 (Debian), built with gcc-7 (C) 2000-2016 MPlayer Team
do_connect: could not connect to socket
connect: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing nennendog.mp3.
libavformat version 57.83.100 (external)
Audio only file format detected.
Load subtitles in ./
==========================================================================
Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
==========================================================================
AO: [pulse] Init failed: Connection refused
Failed to initialize audio driver 'pulse'
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A:  42.9 (42.8) of 43.0 (43.0)  0.9%


最新の画像もっと見る

コメントを投稿

ブログ作成者から承認されるまでコメントは反映されません。