【鼎革‧革鼎】︰ Raspbian Stretch 《六之 G.3 》

Listen to Bluetooth Audio on Your Raspberry Pi 3, Pi Zero, or Earlier Pi

YouTube on the Pi

The Raspberry Pi is a handy little computer for so many uses, but Raspbian doesn’t come already set up for listening to audio over Bluetooth headphones or speakers. However, it’s not hard to do, it’s a lot of fun, and it works!. As I’m writing this, I’m listening to 40s Big Band music on my Pi 3 through my Bluetooth headphones.

The instructions in this post are for the February 26, 2016 version of version of Raspbian or Noobs, but they work with all previous versions of Raspbian Jessie. They work for the Raspberry any Pi version, although the Zero and the original Pi are not really powerful enough to stream from the internet. They work great for playing mp3 files with a media player like VLC.

Except for the Pi 3, you’ll need a Bluetooth adapter like the Plugable Bluetooth adapter. For the Pi Zero, you’ll also need a way to connect to the Internet like a Plugable USB-Ethernet adapter or WiFi adapter, along with an OTG cable and a powered hub like the compact Plugable 4-port USB 2.0 hub. Whichever Pi you use, you end up with is a great little music server that opens the door to a lot of fun projects.

───

只不過眼前似乎『踢到鐵板』?之前 OK 的『藍牙喇叭』

IMAG1178

,現在雖不能用『blueman』連接??不是還可用『bluetoothctl』

pi@raspberrypi ~ bluetoothctl  [NEW] Controller B8:27:EB:23:2B:C8 raspberrypi [default] [bluetooth]# power on Changing power on succeeded [bluetooth]# agent on Agent registered [bluetooth]# default-agent  Default agent request successful [bluetooth]# scan on Discovery started [CHG] Controller B8:27:EB:23:2B:C8 Discovering: yes [NEW] Device 00:02:5B:00:47:4E NOGO B6500 [NEW] Device 74:E5:43:88:E4:16 localhost.localdomain-0 [bluetooth]# pair 00:02:5B:00:47:4E Attempting to pair with 00:02:5B:00:47:4E [CHG] Device 00:02:5B:00:47:4E Connected: yes [CHG] Device 00:02:5B:00:47:4E UUIDs: 	00001108-0000-1000-8000-00805f9b34fb 	0000110b-0000-1000-8000-00805f9b34fb 	0000110c-0000-1000-8000-00805f9b34fb 	0000110e-0000-1000-8000-00805f9b34fb 	0000111e-0000-1000-8000-00805f9b34fb [CHG] Device 00:02:5B:00:47:4E Paired: yes Pairing successful [CHG] Device 00:02:5B:00:47:4E Connected: no [bluetooth]# connect 00:02:5B:00:47:4E Attempting to connect to 00:02:5B:00:47:4E [CHG] Device 00:02:5B:00:47:4E Connected: yes Connection successful [bluetooth]# quit Agent unregistered [DEL] Controller B8:27:EB:23:2B:C8 raspberrypi [default] pi@raspberrypi ~ 

 

連成功乎!怎 A2DP 聲音會 …… 不忍聞的耶!!

─── 摘自《W!o+ 的《小伶鼬工坊演義》︰樹莓派 3 三兩事之 VLC 篇

 

身處 BlueZ  4→5 大變革的時刻,而且品嚐了

Bluetooth Audio ALSA Backend

With this application (later named as BlueALSA), one can achieve the same goal as with PulseAudio, but with less dependencies and more bare-metal-like. BlueALSA registers all known Bluetooth audio profiles in Bluez, so in theory every Bluetooth device (with audio capabilities) can be connected. In order to access the audio stream, one has to connect to the ALSA PCM device called bluealsa. The device is based on the ALSA software PCM plugin.

 

a2dp 之美聲︰

pi@raspberrypi:~ hciconfig -a hci0:	Type: Primary  Bus: UART 	BD Address: B8:27:EB:68:1A:C4  ACL MTU: 1021:8  SCO MTU: 64:1 	UP RUNNING PSCAN  	RX bytes:1476 acl:0 sco:0 events:90 errors:0 	TX bytes:4410 acl:0 sco:0 commands:90 errors:0 	Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87 	Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3  	Link policy: RSWITCH SNIFF  	Link mode: SLAVE ACCEPT  	Name: 'raspberrypi' 	Class: 0x6c0000 	Service Classes: Rendering, Capturing, Audio, Telephony 	Device Class: Miscellaneous,  	HCI Version: 4.1 (0x7)  Revision: 0x145 	LMP Version: 4.1 (0x7)  Subversion: 0x2209 	Manufacturer: Broadcom Corporation (15) </pre>   <pre class="lang:default decode:true">pi@raspberrypi:~ more ~/.asoundrc 
pcm.!default {
	type plug
	slave.pcm {
		type bluealsa
		device "00:02:5B:00:47:4E"
		profile "a2dp"
	}
}

ctl.!default {
	type bluealsa
}
pi@raspberrypi:~ $

 

 

奈何還難忘懷開機

systemctl status bluetooth

的錯誤耶?

Failed to obtain handles for “Service Changed” characteristic

Sap driver initialization failed.

sap-server: Operation not permitted (1)

 

事實,科技本就來自人性◎

Bluetooth HSP/HFP not working in Raspberry PI 3 #2229

Trying to use a bluetooth mic/speaker in a raspberry pi 3 (headless).

Hardware is Raspberry pi 3, firmware updated today, running raspbian also dist-upgraded today. Using bluez and pulseaudio (system service start mode).

  • The device is trusted, paired and connects/disconnects without problems.
  • When device is initially connected, “pactl list” shows the device is using the profile named “headset_head_unit: Headset Head Unit (HSP/HFP) (sinks: 1, sources: 1, priority: 20, available: yes)”. With this profile, no sound (trying to play with aplay command).
  • When profile is changed to “a2dp_sink: High Fidelity Playback (A2DP Sink) (sinks: 1, sources: 0, priority: 10, available: yes)” (using command pactl set-card-profile), the sound is played correctly.

No error messages seen in any log file.

Moreover, if I “down” (“hciadmin hci0 down”) the internal raspberry bluetooth controller and use instead an external bluetooth controller connected in an usb port, both modes works correctly. Thus, problem seems related with the bluetooth device in raspberry card.

 

bluetoothd sap driver issue

jeeva

Sat Jan 09, 2016 6:15 pm

Hello All,

I quite new to rpi world.. When I try to check the status of my bluetooth, I am getting the Sap driver initialization failed error as shown below. Could someone please help me resolve this issue?

……

Bluetooth issues

M4NOOb

Thu Mar 03, 2016 8:38 pm

Hi everyone,

currently I am trying to connect my raspberry pi 2 with my Android 5.1.1 phone via bluetooth (I am trying with Bluez 5.23). The pairing seems to work, but it always returns “Connected: no”. If I try to connect manually it says “Failed to connect: org.bluez.Error.Failed”.

………

 

新舊換代之間能無大哉辯嘛!