At the terminal where agent is running, you will answer two questions during the process: RequestPinCode (/org/bluez/1981/hci0/dev_xx_xx_xx_xx_xx_xx)Īuthorize (/org/bluez/1981/hci0/dev_xx_xx_xx_xx_xx_xx, )
Grab your phone, search for devices, select raspberrypi-0 (this is the default bluetooth name for your Pi, you can change it), and start pairing. Now, run the bluetooth agent (providing basic functions, together with dbus): $ bluez-simple-agent Setting up the Pi to be visible first will be helpful: $ sudo hciconfig hci0 piscan
Your phone’s bluetooth MAC is provided as xx:xx:xx:xx:xx:xx throughout the article. Now you need to pair your phone (or other source of audio) with your Pi. If you get similar output, bluetooth works as expected. When done, you might want to reboot and see whether bluetooth comes up at boot, and pulseaudio loads the bluetooth module (see my previous article for more information about pulseaudio with Raspberry Pi). Make sure you have module-bluetooth-discover lines uncommented in /etc/pulse/default.pa. There is also a recommendation to adjust resampling method in pulseaudio: resample-method = trivial Now you need to configure your bluetooth host for audio by setting up: Enable=Source,Sink,Media,Socket You will also need to add user pi to the lp group (this seems to be required to be able to talk to bluetooth daemon): $ sudo usermod -a -G lp pi
And then, need to install bluez, as well as bluetooth module for pulseaudio: $ sudo aptitude -P install bluez pulseaudio-module-bluetooth python-gobject python-gobject-2 To use your Pi as a bluetooth speaker you will need a bluetooth dongle. In the end you get a multi-protocol audio-playing Raspberry Pi. Parts 1 and 2 focus on setting up pulseaudio over network, and a DLNA renderer role for the Pi respectively. This other question may have useful commands you may wish to study too.This article is part 3 of 3, where I cover configuring Raspberry Pi as A2DP bluetooth speaker(s). After that, the procedures should be the same as with AirPlay-capable devices. find that the default codec or bitrate selections produce bad results with particular hardware. Because of the variety of DLNA-capable devices, you'll have the option of specifying various options to pulseaudio-dlnaif you e.g. With them, you'll need to start the pulseaudio-dlna process first so it can auto-discover any DLNA-capable devices. If you want to use a microphone, you might try loading a Pulseaudio loopback module to connect the microphone to the sink device: pactl load-module module-loopback source="" sink=""įor Chromecast-compatible and other DLNA/uPnP-capable audio devices, there is pulseaudio-dlna (check your distribution's package collection first, it may already be there). You can use pavucontrol to interactively send any audio stream to any device that is detected by PulseAudio.
Likewise, you can use pacmd list-sources to identify the PulseAudio name for your microphone - you'll need that information. RAOP sinks (= devices that can receive AirPlay audio) can be auto-discovered, so you might run pacmd list-sinks and find that your system already sees any AirPlay-capable devices. PulseAudio has a RAOP module (Debian/Ubuntu package pulseaudio-module-raop) which can send audio to Apple AirPlay-capable devices. It depends on which protocol(s) those speakers/converters will support.