Max2Play Home › Forums › Max2Play Add-ons › Bluetooth – latency via Squeezebox Server
Tagged: bluetooth
- This topic has 18 replies, 4 voices, and was last updated 3 years, 3 months ago by MarioM Moderator.
-
Posted in: Max2Play Add-ons
-
12. Juni 2020 at 14:25 #48993
Hello
at first – thanks a lot for great softwareI want to use Bluetooth to stream sounds from my handy to M2P
When I stream to soundcard directly, the latency is ok, 1sec at maximum. But player is occupied by BT or Squeezelite I have to stop player etc…
So I would like to use Squeezebox to play the BT sound, but I have high latency, 3 up to 6 seconds. Each action is delayed – start/stop, volume change, skip or forward.. Each Android app I tried has the same latency. With other BT devices my handy has no problemsCould you please help? Can BT -> Squeezebox normally cause such a latency? a buffer?
Raspberry PI 2B, Raspbian updated, fresh M2P
Br Bohuslav
16. Juni 2020 at 13:26 #49023Hi Bohuslav,
Bluetooth problems can often have various causes. But usually, the latency shouldn’t be that high. In terms of hardware, this could have to do with the Bluetooth dongle you are using. Apart from that you can only try to update max2play to the latest beta and reinstall bluetooth.
Then you should install the Wave Input Fix in the Squeezebox Server tab (depending on which LMS version you are using). To adjust the buffer size of the stream, go to the Squeezebox server settings under advanced/network and change the radio station buffer seconds or timeout.13. Mai 2021 at 17:27 #51243Hello, i have the same problem. It´s just a latency of 2-3 seconds, but it´s too much to get a good streaming experience. Is there a possibility to reduce the latency?
I have a pi 4 and use the buildt in bluetooth, i also use the beta version of max2play and the nightly 8.2 version. I have also installed the waveinput plugin for the 8.x versions.
What i want to do is to stream from my windows pc, my firetv stick and my android phone to the squeezebox server and then stream that input to multiple raspberry squeezeboxes in the house. But i want to stream any audio output, for example youtube videos or netflix. Therefore they have to be synchronized and must have a low latency for watching videos.
thanks, Bernhard
18. Mai 2021 at 13:44 #51259Hi Bernhard,
You will always have some latency when streaming via Bluetooth. If you add the Squeezebox server to the chain you will hardly manage to keep audio and video in sync. Unfortunately, there’s not much you can do about that. Even if you connect your audio source to the Max2Play device via cable, there might be a small latency when using the WaveInput plugin.
11. Juni 2021 at 21:03 #51329Hi!
Sorry to tag along this thread: this is my first post and I believe I cannot create a new topic.
So I’ve spent a few hours trying to get streaming from my phone (Samsung Galaxy S8) to my LMS instance over Bluetooth on my pi to work with no success.
Streaming directly to the Max2Play Soundcard works fine (using it as a bluetooth speaker) but streaming to Squeezebox Server does not work for me.
When I click on “Bluetooth” in Favorites, nothing happens. The “timer” stays at 0:00 or goes up to 2-3 seconds and then stops and no sound comes out of my setup. See picture:
Also, instead of being named “Bluetooth – [name of my device]”, my favorite is just named “Bluetooth”.
I believe my device is connected as it’s name is shown in green. See my debug info below.
I’m running version 2.53 of Max2Play over the Raspberry Pi 7“ Touch Display Bundle with HiFiBerry.
I deactivated Multisqueeze just to ease troubleshooting.
Below is the debug info from Squeezelite:
#### SQUEEZELITE VERSION ####
Squeezelite Max2Play v1.0.3 based on v1.8.7-999, Copyright 2012-2015 Adrian Smith, 2015-2017 Ralph Irving.#### SQUEEZELITE BUILDOPTIONS ####
Build options: LINUX ALSA EVENTFD RESAMPLE FFMPEG VISEXPORT IR GPIO DSD CONTROLSBS ALSASYNC BLUETOOTHSYNC#### AUDIOPLAYER CONFIG ####
### Configuration of Audioplayers
SQUEEZELITE_PARAMETER=-o sysdefault:CARD=sndrpihifiberry -a 80:4::
SQUEEZESLAVE_PARAMETER=-n plugequal
SHAIRPORT_PARAMETER=-d default:CARD=sndrpihifiberry
USE_USB_DAC=0
USE_EQUALIZER=0
SYSTEM_USER=pi
YMPD_PARAMETER=–webport 8081
MULTISQUEEZE_PLAYERCOUNT=0
MULTISQUEEZE_NAME_0=Kitchen
MULTISQUEEZE_PARAMETER_0=-o sysdefault:CARD=sndrpihifiberry -a 80:4:: -B
MULTISQUEEZE_NAME_1=Kitchen Secondary
MULTISQUEEZE_PARAMETER_1=-o default:CARD=ALSA -a 80::: -B
BLUEALSA_PLAY_AUDIOCARD=hw:1,0
BLUEALSA_PLAY_MIXER=Digital
BLUETOOTH_MACADDRESS_MAINPLAYER=b8:25:eb:c1:71:f0#### SQUEEZELITE -l ####
Output devices:
null – Discard all samples (playback) or generate zero samples (capture)
equal
plugequal – Equalizer for plughw:0,0
bluetooth – Your Bluetooth device C0:28:8D:88:1C:6D
default:CARD=ALSA – bcm2835 ALSA, bcm2835 ALSA – Default Audio Device
sysdefault:CARD=ALSA – bcm2835 ALSA, bcm2835 ALSA – Default Audio Device
dmix:CARD=ALSA,DEV=0 – bcm2835 ALSA, bcm2835 ALSA – Direct sample mixing device
dmix:CARD=ALSA,DEV=1 – bcm2835 ALSA, bcm2835 IEC958/HDMI – Direct sample mixing device
dsnoop:CARD=ALSA,DEV=0 – bcm2835 ALSA, bcm2835 ALSA – Direct sample snooping device
dsnoop:CARD=ALSA,DEV=1 – bcm2835 ALSA, bcm2835 IEC958/HDMI – Direct sample snooping device
hw:CARD=ALSA,DEV=0 – bcm2835 ALSA, bcm2835 ALSA – Direct hardware device without any conversions
hw:CARD=ALSA,DEV=1 – bcm2835 ALSA, bcm2835 IEC958/HDMI – Direct hardware device without any conversions
plughw:CARD=ALSA,DEV=0 – bcm2835 ALSA, bcm2835 ALSA – Hardware device with all software conversions
plughw:CARD=ALSA,DEV=1 – bcm2835 ALSA, bcm2835 IEC958/HDMI – Hardware device with all software conversions
default:CARD=sndrpihifiberry – snd_rpi_hifiberry_dacplus, – Default Audio Device
sysdefault:CARD=sndrpihifiberry – snd_rpi_hifiberry_dacplus, – Default Audio Device
dmix:CARD=sndrpihifiberry,DEV=0 – snd_rpi_hifiberry_dacplus, – Direct sample mixing device
dsnoop:CARD=sndrpihifiberry,DEV=0 – snd_rpi_hifiberry_dacplus, – Direct sample snooping device
hw:CARD=sndrpihifiberry,DEV=0 – snd_rpi_hifiberry_dacplus, – Direct hardware device without any conversions
plughw:CARD=sndrpihifiberry,DEV=0 – snd_rpi_hifiberry_dacplus, – Hardware device with all software conversions#### SHAIRPORT (SYNC) VERSION ####
3.1.1-OpenSSL-Avahi-ALSA-soxr-sysconfdir:/usr/local/etc#### OUTPUT SOUND DETAILS CARD 0 ####
closed#### OUTPUT SOUND DETAILS CARD 1 ####
access: MMAP_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 48000 (384000/8)
period_size: 960
buffer_size: 3840The bluetooth debug info is below:
#### Bluetooth Installation ####
#### Bluetooth Dongle ####
hci0: Type: Primary Bus: UART
BD Address: B8:27:EB:6A:D3:8C ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING
RX bytes:4578983 acl:7452 sco:0 events:617 errors:0
TX bytes:24656 acl:576 sco:0 commands:162 errors:0#### DEVICE Pepin’s Galaxy S8 ####
spawn /usr/bin/bluetoothctl
Waiting to connect to bluetoothd…
[0;94m[bluetooth][0m#[[0;92mNEW[0m] Controller B8:27:EB:6A:D3:8C MyServer [default]
[0;94m[bluetooth][0m#[[0;92mNEW[0m] Device C8:D7:B0:40:71:D4 Pepin’s Galaxy S8
[0;94m[bluetooth][0m#
[0;94m[Pepin’s Galaxy S8][0m# info C8:D7:B0:40:71:D4
Device C8:D7:B0:40:71:D4
Name: Pepin’s Galaxy S8
Alias: Pepin’s Galaxy S8
Class: 0x5a020c
Icon: phone
Paired: yes
Trusted: yes
Blocked: no
Connected: yes#### BLUEALSA RUNNING ####
1#### BLUETOOTH SQUEEZEBOX SERVER AUTOSTART ####
Reading last 10 lines of /var/log/daemon.log
Logfile was modified.
Reading last 10 lines of /var/log/daemon.log
Logfile was modified.
Reading last 10 lines of /var/log/daemon.log
Logfile was modified.
Reading last 10 lines of /var/log/daemon.log
Logfile was modified.
Reading last 10 lines of /var/log/daemon.log
Off – Stop Stream on Squeezebox Server (Restore Stream before Bluetooth)Many thanks in advance
Stéphane
- This reply was modified 3 years, 4 months ago by Stephane Bourque.
16. Juni 2021 at 13:36 #51338Hi Stéphane,
Please follow these instructions in our wiki: https://www.max2play.com/en/wiki/bluetooth-direct-stream/ and contact us if the problem persists after that.
Edit: Please also consider burning a fresh (current Stretch or Buster) image to the SD card and try again with that.- This reply was modified 3 years, 4 months ago by MarioM.
22. Juni 2021 at 19:07 #51352Hi Mario,
Thank you for you reply. So I tried everything you proposed, namely:
– Start fresh with the latest Stretch build for 7 inch Touch Display
– Update all the modules I’m using
– Install the nightly 8.2 Squeezebox Server
– Install the WaveInput plugin fix for 8.xI have then again followed the instructions you are pointing to.
Unfortunately, I get the same results as last time.
The peculiar thing is that I can stream directly to the sound card but going through the Squeezebox Server is not giving any useful results.
I posted all DEBUG info in my previous post. Maybe there is something that would make sense to in there?
Thanks in advance,
Stéphane
23. Juni 2021 at 13:09 #51355Hi Stéphane,
I tried the whole thing with a Pi 4 and the current beta version of our Buster image and it worked.
Here is my approach:1. Installed Sqeezebox Server v8.2
2. Installed Bluetooth
3. Rebooted the System
4. Scanned for BT Devices
5. Connected Smartphone
6. Installed Bluetooth for Squeezebox Server
7. Rebooted the System
8. Connected Smartphone again
9. Started BT playback in the Squeezebox Server (Favorites –> Play Button)
10. Started playback on SmartphoneThe same should work with the stretch image. Please test this again and write me if it works. If it doesn’t, we’ll take another look at the stretch image and possibly come up with a fix. Please note that Squeezelite must run with your sound card as output device (in the advanced settings of Squeezelite) for the stream to work.
25. Juni 2021 at 17:44 #51366Hi Mario,
Those are the exact steps I’ve followed. My phone connects to the bluetooth interface with no issue and I can stream directly to the Max2Play soundcard with no issue. Only streaming to the Squeezebox Serve is giving me issues.
The part I’m not following is when you say that „squeezelite must run with your sound card as output device“.
All I can say is that my settings are working fine when listening music from my library or Spotty.
My Squeezelite debug info is as follows:
#### SQUEEZELITE VERSION ####
Squeezelite Max2Play v1.0.2 based on v1.8.4-726, Copyright 2012-2015 Adrian Smith, 2015-2016 Ralph Irving.#### SQUEEZELITE BUILDOPTIONS ####
Build options: LINUX ALSA EVENTFD RESAMPLE FFMPEG VISEXPORT IR GPIO DSD CONTROLSBS ALSASYNC BLUETOOTHSYNC#### AUDIOPLAYER CONFIG ####
### Configuration of Audioplayers
SQUEEZELITE_PARAMETER=-o sysdefault:CARD=sndrpihifiberry -a 80:4:: -C 5
SQUEEZESLAVE_PARAMETER=-n plugequal
SHAIRPORT_PARAMETER=-d default:CARD=sndrpihifiberry
USE_USB_DAC=0
USE_EQUALIZER=0
SYSTEM_USER=pi
YMPD_PARAMETER=–webport 8081
BLUEALSA_PLAY_AUDIOCARD=hw:1,0
BLUEALSA_PLAY_MIXER=Digital
MULTISQUEEZE_PLAYERCOUNT=0
MULTISQUEEZE_NAME_1=Kitchen_Secondary
MULTISQUEEZE_PARAMETER_1=-o sysdefault:CARD=ALSA -a 80:::
MULTISQUEEZE_NAME_0=Kitchen
MULTISQUEEZE_PARAMETER_0=-o sysdefault:CARD=sndrpihifiberry -a 80:4::#### SQUEEZELITE -l ####
Output devices:
null – Discard all samples (playback) or generate zero samples (capture)
equal
plugequal – Equalizer for plughw:0,0
bluetooth – Your Bluetooth device 40:EF:4C:FF:03:22
default:CARD=ALSA – bcm2835 ALSA, bcm2835 ALSA – Default Audio Device
sysdefault:CARD=ALSA – bcm2835 ALSA, bcm2835 ALSA – Default Audio Device
dmix:CARD=ALSA,DEV=0 – bcm2835 ALSA, bcm2835 ALSA – Direct sample mixing device
dmix:CARD=ALSA,DEV=1 – bcm2835 ALSA, bcm2835 IEC958/HDMI – Direct sample mixing device
dsnoop:CARD=ALSA,DEV=0 – bcm2835 ALSA, bcm2835 ALSA – Direct sample snooping device
dsnoop:CARD=ALSA,DEV=1 – bcm2835 ALSA, bcm2835 IEC958/HDMI – Direct sample snooping device
hw:CARD=ALSA,DEV=0 – bcm2835 ALSA, bcm2835 ALSA – Direct hardware device without any conversions
hw:CARD=ALSA,DEV=1 – bcm2835 ALSA, bcm2835 IEC958/HDMI – Direct hardware device without any conversions
plughw:CARD=ALSA,DEV=0 – bcm2835 ALSA, bcm2835 ALSA – Hardware device with all software conversions
plughw:CARD=ALSA,DEV=1 – bcm2835 ALSA, bcm2835 IEC958/HDMI – Hardware device with all software conversions
default:CARD=sndrpihifiberry – snd_rpi_hifiberry_dacplus, – Default Audio Device
sysdefault:CARD=sndrpihifiberry – snd_rpi_hifiberry_dacplus, – Default Audio Device
dmix:CARD=sndrpihifiberry,DEV=0 – snd_rpi_hifiberry_dacplus, – Direct sample mixing device
dsnoop:CARD=sndrpihifiberry,DEV=0 – snd_rpi_hifiberry_dacplus, – Direct sample snooping device
hw:CARD=sndrpihifiberry,DEV=0 – snd_rpi_hifiberry_dacplus, – Direct hardware device without any conversions
plughw:CARD=sndrpihifiberry,DEV=0 – snd_rpi_hifiberry_dacplus, – Hardware device with all software conversions#### SHAIRPORT (SYNC) VERSION ####
3.1.1-OpenSSL-Avahi-ALSA-soxr-sysconfdir:/usr/local/etc#### OUTPUT SOUND DETAILS CARD 0 ####
closed#### OUTPUT SOUND DETAILS CARD 1 ####
closedMany thanks,
Stéphane
30. Juni 2021 at 17:33 #51376Hi Stéphane,
I have now tested different versions of the LMS with the Stretch Image again. In fact, I did not manage to output sound either. I have informed our developer about this. I’ll let you know as soon as we have a fix.
6. Juli 2021 at 11:32 #51413Hi Stéphane,
Until we have found a solution, you could of course switch to the buster image, since it works with that.
6. Juli 2021 at 19:34 #51424Thank you for the advice!
Knowing I have a Raspberry Pi 7″ Touch Display and the image that is suggested for it is Stretch, what am I looking to in terms of configuration to be able to make the Buster image on par with Stretch for touch display support?
Thanks!
7. Juli 2021 at 15:33 #51429The display should work exactly the same with the Buster image. You would only need to install the RPI Display plugin manually. Nevertheless, I would recommend you to create a backup of your current image with our Imageburner plugin beforehand.
10. Juli 2021 at 0:27 #51442Soooooo….
I downloaded the latest Buster image and reinstalled everything. I still cannot get the „Stream to Squeezebox Server“ option to work.
Again, the „Stream directly to Max2Play Soundcard“ option works perfectly fine.
I’m really clueless and after hours of trying, I don’t know what else to do.
What information can I provide so that you can help me out?
Many thanks for your patience and support.
Stéphane
13. Juli 2021 at 16:56 #51459Have you ever tried the whole thing without the display? So only connect the Pi and the sound card and nothing else. In addition, you could try disabling the „Autostart Desktop“ on the Settings/Reboot page. Does it work then? Have you also tried changing the Squeezelite audio output? Please select
sysdefault:CARD=ALSA – bcm2835 ALSA, bcm2835 ALSA – Default Audio Device
and connect headphones to the jack input on the Pi.14. Juli 2021 at 18:42 #51466Hi Mario,
I have disabled the „Autostart Desktop“ but to no success.
Also, I don’t have the
sysdefault:CARD=ALSA – bcm2835 ALSA, bcm2835 ALSA – Default Audio Device
as part of the available options for my setup. I do havesysdefault:CARD=Headphones - bcm2835 Headphones, bcm2835 Headphones - Default Audio Device
which does not work either.As for „trying the whole thing without the display“, you mean physically disconnecting the display?
Thanks,
Stéphane
- This reply was modified 3 years, 3 months ago by Stephane Bourque.
14. Juli 2021 at 19:00 #51468Another interesting side effect is that whenever I install Bluetooth, the headphone jack stops to work.
I usually use Multisqueeze and both the HiFi Berry Dac+ Pro AND headphone jack are used. Once bluetooth is installed and „configured“ for the Squeezebox Server, the jack does not work anymore, even if I disable and uninstall Multisqueeze and just use plain vanilla Squeezelite.
The only cure to gain back my headphone jack is to uninstall Bluetooth.
Stéphane
16. Juli 2021 at 13:24 #51472Hi Stéphane,
Yes exactly, please try disconnecting the display from the Pi and test the Pi alone. Maybe there is a problem with the power supply when the display is on. Please do not use Multisqueeze to test streaming to the server via Bluetooth. Please just use the Pi, the jack output of the Pi and Squeezelite. If it doesn’t work (which it definitely should, after all I tested it again on site with test devices), then there is some kind of misunderstanding. I don’t think it’s a hardware problem (except for the display maybe).
Bluetooth should not affect the headphone output, of course. Please make sure that in the advanced settings of Squeezelite „sysdefault…“ (without „…hifiberrydac…“) is selected to use the jack output or HDMI for audio output. To be on the safe side, you could also burn a fresh image (Buster) and follow the 10 steps I sent you the other day.
I know it’s frustrating when something like this doesn’t work even though it should. But I can’t do more than give you these tips to solve the problem yourself. -
You must be logged in to reply to this topic.