Setting up Bluetooth Speaker with piCorePlayer v3.5.0 optimized for audio

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Grumpy Bob
    Senior Member
    • Dec 2010
    • 1315

    #16
    Originally posted by Grumpy Bob
    Well, using 4.1.0 and after pairing the headphones, Squeezelite refused to start, so the player never showed up in LMS.

    Using 4.0.0 everything worked as per my previous experiences with piCorePlayer - the headphones paired, Squeezelite started, and the player appeared in LMS and music can be played.

    Maybe this is an issue with the specific BT headphones I have.

    R
    I've used this Pi Zero setup with 4.0.0 for a couple of weeks now, works well. Last night I did an in situ update to piCorePlayer 4.1.0, and everything still works as it should. I've no idea why the two attempts to set this up from scratch with 4.1.0 failed.

    Robert
    Home: Raspberry Pi 4/pCP7.0/LMS8.1.2/Material with files on QNAP TS-251A
    Touch > DacMagic 100 > Naim Audio Nait 3 > Mission 752 (plus Rega Planar 3 > Rega Fono Mini; Naim CD3)
    2 x Squeezebox Radios, 1 X Squeezebox 3 (retired), 1 x SqueezeAMP
    Office: LMS8.0.0 running on Raspberry Pi3; Raspberry Pi 3 player with touchscreen/piCorePlayer/IQaudIO DAC and Amp
    Portable: Raspberry Pi 3B/pCP7.0.1/LMS8.1.2/Material, files on Seagate portable drive, powered via power brick

    Comment

    • RobbH
      Senior Member
      • Jun 2017
      • 1291

      #17
      I've had a very similar experience to what Grumpy Bob reported. With piCorePlayer 4.1.0 on a Pi Zero W, bluetooth would connect once, and it would play for some time, on one occasion more than four hours. But at some point, it would fall silent, although LMS continued to show that it was playing. Sometimes the speaker's indicator would show that it had disconnected, sometimes not. Either way, pCP still reported that it was connected. Eventually, LMS would throw an error, apparently while attempting to adjust synchronization on another player, and the system would freeze. (This was usually with eight players synchronized.)

      pCP would not reconnect to the speaker. Power cycling the speaker made no difference, but everything would work again after rebooting pCP.

      I have now switched to 4.0.0 and so far it's working. It's been 23 hours with no issues.

      Unlike Grumpy Bob, I haven't yet worked up the courage to try an in situ update to 4.1.0.
      Usually running latest beta LMS nightly on Raspberry Pi OS with virtual players. Occasionally using SB Radio, Boom or Classic.

      Comment

      • RobbH
        Senior Member
        • Jun 2017
        • 1291

        #18
        Originally posted by RobbH
        ....Unlike Grumpy Bob, I haven't yet worked up the courage to try an in situ update to 4.1.0.
        Following up on my previous report, in case somebody stumbles across this thread, as I did, while looking for a solution.

        After months of hesitation, I finally tried an in situ update to pcp 4.1.0, but without success. The earlier problems returned, so I went back to 4.0.0. Even with the earlier version, things weren't perfect. The player would still sometimes fall silent, while LMS still showed it as playing, and the bluetooth speaker still indicated that it was connected. But, unlike the situation with 4.1.0, this never brought the entire synchronized system to a halt. I found that if I set a cron job to reboot the player every night, the problem only occurred about once a week.

        That was the situation until the recent release of pcp 5.0.0. With a clean install, the player is now performing nearly perfectly. Uptime is more than 42 hours and there have been no issues yet. Bluetooth latency seems much improved, too.

        Any further discussion of the issue should probably move to the appropriate release thread in the Linux forum.
        Usually running latest beta LMS nightly on Raspberry Pi OS with virtual players. Occasionally using SB Radio, Boom or Classic.

        Comment

        • edwin2006
          Senior Member
          • May 2017
          • 863

          #19
          Thanks for the update!
          SqueezeBoxes: 1x Transporter (Living room) 1x SB2 (shed), 1x Radio (Kitchen), 1x Boom (Dining room), 1x piCorePlayer (jacuzzi), 1x piCorePlayer (Garden) 1x OSMC + Squeezelite (Movie room), 1x Touch (Study 2), few spare unit's (SB2, SB3, Boom, Touch)
          Server: LMS on Pi3B+ 8.1.2 on PcP 7.0.1
          Network: Draytek, Netgear Smart Switch 24p, Ubiquiti PoE, 3x Ubiquity

          Comment

          • cpd73
            Senior Member
            • Mar 2017
            • 5131

            #20
            PiZeroW?

            Does this work with a PiZeroW and a USB bluetooth dongle? Because I'm really struggling to get this to work. I have pcp 5.0.0 installed (clean install), configured pcp for a bluetooth speaker. I can see the speaker/pcp in LMS, and can play music for about 1 minute. After that the audio gets very jittery, and after a few seconds just stops. If I'm ssh'ed into pcp at the time, then the connection is painstakingly slow. I guess something is hogging the CPU, but top updates so badly its hard to tell. During initial playback, squeezelite is only consuming 5-10% CPU.

            Am I doing something wrong? Or does USB bluetooth + inbuilt WiFi on a PiZeroW just not work?
            Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

            Comment

            • Greg Erskine
              Senior Member
              • Sep 2006
              • 2808

              #21
              hi cpd73,

              Unfortunately I don't have any blue tooth devices. Hopefully one of the other guys will jump in.

              But I was working on something else recently on a 512MB RPi and I just about ran out of RAM. Weird things started happening.

              regards
              Greg

              Comment

              • paul-
                Senior Member
                • Jan 2013
                • 5780

                #22
                I test bluetooth on a ZeroW all the time. But I'm using the onboard Bluetooth and wifi. What USB stick are you trying?

                The problem stems from Bluetooth are very close to the same frequencies. When you use the onboard Wifi and Bluetooth the chipset does broadcast sharing, meaning it does wifi traffic, and then does bluetooth, alternating back and forth. Since you are using different devices, they don't know they need to live together, what you can try is to put the bluetooth stick on an extension cable to get it away from the ZeroW. Also, make sure you have disabled the onboard bluetooth.
                Last edited by paul-; 2019-06-14, 22:35.
                piCorePlayer a small player for the Raspberry Pi in RAM.
                Homepage: https://www.picoreplayer.org

                Please donate if you like the piCorePlayer

                Comment

                • Grumpy Bob
                  Senior Member
                  • Dec 2010
                  • 1315

                  #23
                  Originally posted by cpd73
                  Does this work with a PiZeroW and a USB bluetooth dongle? Because I'm really struggling to get this to work. I have pcp 5.0.0 installed (clean install), configured pcp for a bluetooth speaker. I can see the speaker/pcp in LMS, and can play music for about 1 minute. After that the audio gets very jittery, and after a few seconds just stops. If I'm ssh'ed into pcp at the time, then the connection is painstakingly slow. I guess something is hogging the CPU, but top updates so badly its hard to tell. During initial playback, squeezelite is only consuming 5-10% CPU.

                  Am I doing something wrong? Or does USB bluetooth + inbuilt WiFi on a PiZeroW just not work?
                  As I write, I'm listening to music via a PiZeroW and a pair of Bowers & Wilkins PX bluetooth headphones and the built-in bluetooth - this is the same PiZero I mentioned earlier in this thread. I did an in situ update to PcP 5.0 a few days ago and it's behaving perfectly. I am connected to the server by WiFi.

                  I haven't tried a clean install of 5.0.0, but given my experience with the 4.1.0 clean install, I'd be reluctant.

                  Robert

                  Edit: I always use the standard PcP, not the experimental real-time kernel version.
                  Last edited by Grumpy Bob; 2019-06-15, 07:00. Reason: more info
                  Home: Raspberry Pi 4/pCP7.0/LMS8.1.2/Material with files on QNAP TS-251A
                  Touch > DacMagic 100 > Naim Audio Nait 3 > Mission 752 (plus Rega Planar 3 > Rega Fono Mini; Naim CD3)
                  2 x Squeezebox Radios, 1 X Squeezebox 3 (retired), 1 x SqueezeAMP
                  Office: LMS8.0.0 running on Raspberry Pi3; Raspberry Pi 3 player with touchscreen/piCorePlayer/IQaudIO DAC and Amp
                  Portable: Raspberry Pi 3B/pCP7.0.1/LMS8.1.2/Material, files on Seagate portable drive, powered via power brick

                  Comment

                  • cpd73
                    Senior Member
                    • Mar 2017
                    • 5131

                    #24
                    Originally posted by paul-
                    I test bluetooth on a ZeroW all the time. But I'm using the onboard Bluetooth and wifi.
                    I cannot get this combination to work. Using onboard Bluetooth and wifi; played for about 2 minutes, player went missing from LMS but continued to play for another 30 seconds before stopping. After a further 30 seconds, playback restarted, and player re-appeared in LMS. Whilst music stopped/not in LMS, top did not show high CPU but it also seemed to get stuck displaying only 2 or 3 processes. Played next song to completion, then did not play next. ssh session unresponsive. After a few minutes I could play another track, but ssh again was unresponsive.

                    Originally posted by paul-
                    What USB stick are you trying?
                    Just a cheap belkin dongle

                    Originally posted by paul-
                    The problem stems from Bluetooth are very close to the same frequencies. When you use the onboard Wifi and Bluetooth the chipset does broadcast sharing, meaning it does wifi traffic, and then does bluetooth, alternating back and forth. Since you are using different devices, they don't know they need to live together, what you can try is to put the bluetooth stick on an extension cable to get it away from the ZeroW. Also, make sure you have disabled the onboard bluetooth.
                    That seems to have done the trick. I've placed the dongle on a 1m extension cable, and its up to its 5th track with no dropouts.

                    Thanks for your help.
                    Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

                    Comment

                    • RobbH
                      Senior Member
                      • Jun 2017
                      • 1291

                      #25
                      Originally posted by cpd73
                      (Originally Posted by paul-: I test bluetooth on a ZeroW all the time. But I'm using the onboard Bluetooth and wifi.)

                      I cannot get this combination to work. Using onboard Bluetooth and wifi; played for about 2 minutes, player went missing from LMS but continued to play for another 30 seconds before stopping....
                      It's interesting that you had problems with this combination on 5.0.0 that are similar (but not quite identical) to the issues I had with the same combination on pcp 4.0.0 and 4.1.0, Bob had issues with 4.1.0, but not 4.0.0, and an in situ update to 4.1.0 worked for him, and it's still working after an in situ update to 5.0.0. In my case, it was a clean install of 5.0.0 that made this combination work.

                      Obviously, that are a lot of variables at play here, and many of them are not under the control of the pcp team. Manufacturing tolerances on the Zero W, perhaps?
                      Usually running latest beta LMS nightly on Raspberry Pi OS with virtual players. Occasionally using SB Radio, Boom or Classic.

                      Comment

                      • paul-
                        Senior Member
                        • Jan 2013
                        • 5780

                        #26
                        I would guess that channel selection/distance to WAP/enclosure/other wifi traffic has more to do with it.
                        piCorePlayer a small player for the Raspberry Pi in RAM.
                        Homepage: https://www.picoreplayer.org

                        Please donate if you like the piCorePlayer

                        Comment

                        • RobbH
                          Senior Member
                          • Jun 2017
                          • 1291

                          #27
                          Originally posted by paul-
                          I would guess that channel selection/distance to WAP/enclosure/other wifi traffic has more to do with it.
                          That makes sense, and is bound to be better than my uneducated guess. Just FWIW, my setup -- the one that's working with 5.0.0, but had issues with 4.0.0 and 4.1.0 -- uses channel 6 to connect to an access point about ten feet (approx. 3 meters) away, with a wall between. Distance to the speaker is about 4 feet, slightly more than 1 meter. Two other players, both using the Airplay bridge) are connected to the access point, but nothing else.

                          The Zero W is in the "official case": https://www.amazon.com/dp/B06XD18H6K..._w7sbDb0JHA009

                          The access point is a "mini travel router": https://www.amazon.com/dp/B01K6MHRJI..._xetbDbH5HQY7T
                          Usually running latest beta LMS nightly on Raspberry Pi OS with virtual players. Occasionally using SB Radio, Boom or Classic.

                          Comment

                          • cpd73
                            Senior Member
                            • Mar 2017
                            • 5131

                            #28
                            Speaker does not reconnect?

                            Whilst I've managed to get the speaker to connect and play, it does not always seem to reconnect when connection is lost. If i power off the speaker, LMS still seems to think something is playing - shouldn't the squeezelite instance be stopped? When I power the speaker back on it does not always reconnect - there is no connection beep, and no music is played. Is this a known issue? Or something strange with my setup?

                            What I'd ideally like is to leave my PiZeroW always switched on, and just turn the bluetooth speaker on when required. Then the music should continue from where it switched off. Is this possible with pCP? I have a python script that I tested on my main (non-pCP) Pi (where LMS is located) that will start squeezelite when a speaker is connected, and stop it when it disconnects - but this requires python and dbus (which I don't think are on pCP?). However, I can't use this as my main Pi is too far away from where I wish to use the bluetooth speaker. So, I was hoping that pCP could do something similar.
                            Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

                            Comment

                            • paul-
                              Senior Member
                              • Jan 2013
                              • 5780

                              #29
                              Originally posted by cpd73
                              What I'd ideally like is to leave my PiZeroW always switched on, and just turn the bluetooth speaker on when required.
                              I’ve not had luck doing this, as it normally causes BT to not allow new connections

                              Then the music should continue from where it switched off. Is this possible with pCP? I have a python script that I tested on my main (non-pCP) Pi (where LMS is located) that will start squeezelite when a speaker is connected, and stop it when it disconnects - but this requires python and dbus (which I don't think are on pCP?). However, I can't use this as my main Pi is too far away from where I wish to use the bluetooth speaker. So, I was hoping that pCP could do something similar.
                              Not using python, but am using dbus and scripts, but generally this is how it works. When squeezelite is disconnected for a while, LMS will not automatically restart either.
                              piCorePlayer a small player for the Raspberry Pi in RAM.
                              Homepage: https://www.picoreplayer.org

                              Please donate if you like the piCorePlayer

                              Comment

                              • cpd73
                                Senior Member
                                • Mar 2017
                                • 5131

                                #30
                                Originally posted by paul-
                                I’ve not had luck doing this, as it normally causes BT to not allow new connections
                                Ah, OK. Guess I'll try installing plain Raspbian on the Pi, and use my script.
                                Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

                                Comment

                                Working...