====== Bluetooth Box ====== ==== noch nicht geprüft und getestet ==== https://www.voss.earth/2018/04/07/volumio-auf-dem-raspberry-pi-als-bluetooth-lautsprecher-verwenden/ http://www.knight-of-pi.org/finally-raspberry-pi-3b-buster-as-bluetooth-audio-sink/ ==== ähnlich wie getestet aber noch ungetestet: ==== https://gist.github.com/mill1000/74c7473ee3b4a5b13f6325e9994ff84c https://github.com/guillaumezin/bluez-alsa/tree/master ==== vorherige Versuche ==== cat /boot/cmdline.txt console=serial0,115200 console=tty1 root=PARTUUID=d9b3f436-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait bluetooth.disable_ertm=1 vorherige Ausgabe: cat /sys/module/bluetooth/parameters/disable_ertm N nun nach hinzufügen von ''bluetooth.disable_ertm=1'' cat /sys/module/bluetooth/parameters/disable_ertm Y sudo vi /etc/bluetooth/network.conf auf true gesetzt, bzw. # davor entfernt: DisableSecurity=true Privacy = off Cache = always MinEncKeySize = 0 ReconnectAttempts=7 ==== getestet: ==== https://github.com/Arkq/bluez-alsa https://github.com/Arkq/bluez-alsa/wiki/Installation-from-source https://github.com/nicokaiser/rpi-audio-receiver Im Original Raspbian erscheinen zunächst die folgenden Meldungen wenn ''journalctl -u bluealsa.service'' aufgerufen wird wärend man ein älteres Smartphone mit der BlueBox verbunden hat. bluealsa: Unsupported RTP payload type: 1 bluealsa: Unsupported RTP payload type: 1 bluealsa: Unsupported RTP payload type: 1 Die Bluetooth Box oder kurz BlueBox, besteht aus einem Raspberry Pi 3 oder jeden anderen Linux Computer mit Bluetooths, welcher Musik-Dateien von entfernten Geräten wie z.B. Smartphones über seine angeschlossenen Musik-Boxen wiedergibt. ==== Installation von libfdk-aac ==== sudo apt-get install autoconf libtool -y mkdir ffmpeg cd ffmpeg wget -O fdk-aac.zip https://github.com/mstorsjo/fdk-aac/zipball/master unzip fdk-aac.zip cd mstorsjo-fdk-aac* autoreconf -fiv ./configure --prefix="$HOME/ffmpeg_build" --disable-shared sudo make sudo make install export PKG_CONFIG_PATH=/home/pi/ffmpeg_build/lib/pkgconfig ==== Installation von blue-alsa ==== Eine neuere Version von blue-alsa wird unter Raspbian Buster kompiliert, damit auch von älteren Geräten mit pulseaudio < Version 13 Musik über der BlueBox abgespielt werden können. Wichtig ist hier beim kompilieren die Option ''--disable-payloadcheck''. https://github.com/Arkq/bluez-alsa Auf dieser Webseite steht noch mal ausdrücklich warum, in meinem Fall, beim Kompilieren die Option ''--disable-payloadcheck'' verwendet wird: :!: //disable RTP payload type check (workaround for a bug in PulseAudio versions before 13.0) Earlier releases of pulseaudio set a non-compliant value in the payload type field of RTP packets, meaning that bluetooth standard compliant devices and applications (such as bluealsa) would reject those packets. This option disables that check in bluealsa, permitting a computer running PulseAudio to use another computer running bluealsa as an audio sink. This bug in PulseAudio was fixed in release 13.0.// Benötigt? sudo apt-get install libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev -y wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.52.tar.xz tar xvf bluez-5.52.tar.xz && cd bluez-5.52 ./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --enable-experimental make -j4 sudo make install sudo reboot ../configure --enable-aac --enable-ofono --enable-debug --disable-payloadcheck export LIBASOUND_THREAD_SAFE=0 sudo make install Nach dem Kompilieren von bluealsa wird die bestehende Binär-Datei unter ''/usr/bin/bluealsa'' mit der neuen Version überschrieben: /usr/bin/bluealsa -V 2.1.0 Nach einem reboot sollten die folgenden Dienste für die BlueBox laufen: ~ $ ps aux|grep -i blue root 322 3.6 0.4 37064 3908 ? Ssl 20:27 0:23 /usr/bin/bluealsa -i hci0 -p a2dp-sink root 411 1.3 0.1 15424 1896 ? Ssl 20:27 0:08 /usr/bin/bluealsa-aplay --pcm-buffer-time=250000 00:00:00:00:00:00 root 435 0.0 0.3 7064 3504 ? Ss 20:27 0:00 /usr/libexec/bluetooth/bluetoothd pi 1372 0.0 0.0 7680 516 pts/0 S+ 20:38 0:00 grep --color=auto -i blue ===== Übersicht aufgerufene Kommandos ===== sudo raspi-config sudo nano /lib/systemd/system/bluealsa.service sudo apt update ip a sudo ip link set wlan0 down apt list "*bluealsa*" sudo apt install bluealsa sudo nano /lib/systemd/system/bluealsa.service sudo systemctl restart bluealsa.service bluetoothctl sudo systemctl restart bluetooth.service systemctl status bluetooth.service sudo bluetoothctl bluealsa-aplay 00:00:00:00:00:00 sudo halt https://scribles.net/streaming-bluetooth-audio-from-phone-to-raspberry-pi-using-alsa/ systemctl status bluetooth.service systemctl status bluealsa.service bluetoothctl sudo bluetoothctl bluealsa-aplay --pcm-buffer-time=170000 --profile-a2dp 00:00:00:00:00:00 bluealsa-aplay 00:00:00:00:00:00 sudo nano /lib/systemd/system/bluealsa.service sudo systemctl status bluealsa.service sudo systemctl restart bluealsa.service sudo systemctl stop bluealsa.service sudo nano /lib/systemd/system/bluealsa.service sudo systemctl restart bluealsa.service /lib/systemd/system/bluealsa.service systemctl daemon-reload sudo systemctl daemon-reload sudo systemctl restart bluealsa.service sudo systemctl status bluealsa.service bluealsa-aplay 00:00:00:00:00:00 sudo journalctl -u alsa-state.service sudo journalctl -u bluealsa.service sudo journalctl -u bluealsa.service sudo nano /lib/systemd/system/bluealsa.service sudo apt install bluealsa python-dbus sudo apt list "*bluealsa*" wget https://github.com/guillaumezin/bluez-alsa/releases/download/v1.2.0c/bluezalsa_20171106-1_armhf.deb sudo apt list "*bluealsa*" sudo apt list "*bluez*" sudo apt show bluealsa sudo apt purge bluealsa apt list "*bluez*" sudo dpkg -i bluezalsa_20171106-1_armhf.deb apt list "*bluez*" bluealsa-aplay 00:00:00:00:00:00 sudo systemctl status bluealsa.service /usr/bin/bluealsa -p a2dp-sink sudo apt install autoconf libtool -y mkdir ffmpeg cd ffmpeg/ wget -O fdk-aac.zip https://github.com/mstorsjo/fdk-aac/zipball/master unzip fdk-aac.zip cd mstorsjo-fdk-aac-e7d8591/ autoreconf -fiv ./configure --prefix="$HOME/ffmpeg_build" --disable-shared sudo make echo $? sudo make install echo $? export PKG_CONFIG_PATH=/home/pi/ffmpeg_build/lib/pkgconfig sudo apt list "*bluez*" bluetoothctl -v sudo nano /etc/bluetooth/main.conf sudo bluetoothctl sudo chmod +x /usr/local/bin/a2dp-agent /usr/bin/bluealsa -p a2dp-sink sudo apt purge bluezalsa wget -O fdk-aac.zip https://github.com/mstorsjo/fdk-aac/zipball/master wget -O bluez-alsa_arkq.zip https://github.com/Arkq/bluez-alsa/archive/master.zip unzip bluez-alsa_arkq.zip cd bluez-alsa-master/ autoreconf --install echo $? mkdir build cd build/ ../configure --enable-aac --enable-ofono --enable-debug --disable-payloadcheck echo $? apt list "*alsa*" sudo apt install alsa sudo apt install alsa-base ../configure --enable-aac --enable-ofono --enable-debug --disable-payloadcheck rm -r bluez-alsa-master apt list "*alsa*" apt list "*libasound2*" sudo apt install libasound2-dev unzip bluez-alsa_arkq.zip cd bluez-alsa-master/ autoreconf --install mkdir build && cd build sudo apt install libkf5bluezqt-dev sudo apt install bluez-tools ../configure --enable-aac --enable-ofono --enable-debug --disable-payloadcheck sudo apt install bluez-utils bluez-compat bluez-hcidump checkinstall libusb-dev libbluetooth-dev sudo apt install bluez-compat bluez-hcidump checkinstall libusb-dev libbluetooth-dev sudo apt install bluez-hcidump checkinstall libusb-dev libbluetooth-dev sudo apt install libdbus-1-dev sudo apt install libglib2.0-dev ../configure --enable-aac --enable-ofono --enable-debug --disable-payloadcheck apt list "*sbc*" sudo apt install libsbc-dev ../configure --enable-aac --enable-ofono --enable-debug --disable-payloadcheck echo $? sudo bluetoothctl wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.52.tar.xz tar xvf bluez-5.52.tar.xz && cd bluez-5.52 find . -type f -iname "*a2dp*" ./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --enable -experimental echo $? apt list "*libudev*" sudo apt install libudev-dev ./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --enable -experimental sudo apt install libical-dev sudo apt install libreadline-dev ./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --enable -experimental echo $? make -j4 echo $? sudo make install echo $? bluetoothctl -v sudo bluetoothctl ls -la /usr/local/bin/ find . -type f -iname "*a2dp-agent*" cd bluez-5.52 # a2dp war auf der Git Projektseite Datei im Code aufgelistet und konnte per copy & paste geladen werden. sudo find . -type f -iname "*a2dp*" sudo find . -type f -iname "*a2dp.service*" cd bluez-alsa-master/ sudo find . -type f -iname "*a2dp.service*" find /usr/ -type f -iname "*.wav" aplay /usr/share/sounds/alsa/Front_Center.wav aplay /usr/share/sounds/alsa/Rear_Center.wav alsamixer aplay /usr/share/sounds/alsa/Rear_Center.wav aplay -l aplay /usr/share/sounds/alsa/Front_Center.wav sudo nano /usr/local/bin/a2dp sudo chmod +x /usr/local/bin/a2dp ls -la /usr/local/bin/ sudo mv /usr/local/bin/a2dp /usr/local/bin/a2dp-agent /usr/local/bin/a2dp-agent sudo bluetoothctl /usr/local/bin/a2dp-agent sudo systemctl status bluetooth.service sudo systemctl daemon-reload sudo systemctl status bluetooth.service /usr/local/bin/a2dp-agent sudo systemctl restart bluetooth.service sudo systemctl status bluetooth.service sudo systemctl status bluealsa.service sudo systemctl stop bluealsa.service /usr/local/bin/a2dp-agent nano /usr/local/bin/a2dp-agent bluealsa-aplay -vv 00:00:00:00:00:00 sudo reboot sudo systemctl status bluealsa.service sudo systemctl status bluetooth.service sudo journalctl -u bluetooth.service bluealsa-aplay 00:00:00:00:00:00 apt list "blue*" bluealsa-aplay 00:00:00:00:00:00 ls -la /usr/local/bin/ ls -la /usr/local/sbin/ sudo apt install bluealsa nano ~/.asoundrc bluealsa-aplay 00:00:00:00:00:00 sudo apt purge bluezalsa sudo nano /etc/bluetooth/main.conf rm bluezalsa_20171106-1_armhf.deb ls -la bluez-5.52/client/ ls -la bluez-5.52/tools ==== Hab hier Installation von NicoKaiser GitRepo ==== mkdir nicokaiser cd nicokaiser/ wget https://github.com/nicokaiser/rpi-audio-receiver/archive/master.zip ls -la unzip master.zip cd rpi-audio-receiver-master/ cat ~/.asoundrc rm ~/.asoundrc ./install.sh sudo reboot cd nicokaiser/ cd rpi-audio-receiver-master/ ps aux|grep -i blue sudo journalctl -u bluetooth.service sudo journalctl -u bluealsa-aplay.service cat /boot/config.txt aplay /usr/share/sounds/alsa/Rear_Center.wav ps aux|grep -i blue sudo journalctl -u bluealsa.service apt list "*bluez*" cd bluez-alsa-master/ ls -la ==== Neukompelieren vom bluealsa ==== Es wird eine neuere Version von Bluealsa benötigt, daher wird die bestehende mit dem payload Error durch diese ersetzt, überschrieben. Eine Deinstallation der bestehenden wurde nicht durchgeführt. Die alte Version zeigt zunächst noch eine niedrigere Versions-Nr. an: /usr/bin/bluealsa -V autoreconf --install cd build/ rm -r build/ mkdir build && cd build ../configure --enable-aac --enable-ofono --enable-debug --disable-payloadcheck 449 echo $? apt list "*fdk*" ls -la ../../ffmpeg_build/ history |grep PKG export PKG_CONFIG_PATH=/home/pi/ffmpeg_build/lib/pkgconfig ../configure --enable-aac --enable-ofono --enable-debug --disable-payloadcheck echo $? export LIBASOUND_THREAD_SAFE=0 make echo $? /usr/bin/bluealsa -V make install echo $? sudo make install echo $? /usr/bin/bluealsa -V sudo reboot /usr/bin/bluealsa -V ps aux|grep -i blue sudo journalctl -u bluealsa.service ===== Fehler Errors ===== Ist es nicht möglich sich mit der BlueBox zu verbinden? Dann muss sichergestellt sein das der //bluealsa-aplay// Service läuft. sudo systemctl status bluealsa-aplay.service Dieser wird nicht automatisch mitgestartet wenn man den //bluetooth// Service startet. Es reicht aber aus nur //bluealsa-aplay// Service zu starten, denn dieser startet alle anderen benötigten //bluetooth// Services.