Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1. #1

    Bluetooth headphone disconnected from zero w causes a serious problem

    Hello everybody. As I mention that before I wanted to build a scenario that LMS play mp3 for many users.
    I used picoreplayer. I read a lot about it. thank to developers.
    I decided to use Bluetooth headphone instead of dac.
    everything went well.
    but there is a problem. when bluetooth headphone is disconnected from zero w other clients are disturbed. lms wants to being synced every client. I figured out latency of this zero w went high about 2000 ms when bluetooth disconnected.
    I search for a solution. I think about useful script.

    when the bluetooth headphone is going to be disconnected reboot RP zero w.
    is it impossible?
    i'm not familiar with bash scripting.
    can you guide me please?
    or other scenario that you think works.

  2. #2
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,329
    I would have thought it would be sufficient to power off the Bluetooth player (in LMS), rather than rebooting the RPi, before physically powering down the headphones, since players that LEAVE a synced group don't affect the other players in the group. I think you mentioned that this is in a 'language lab' environment. Do the users of the headphones have computers in front of them - could you install Squeezeplay to give them control and the ability to power down the device.

    If they have computers with Squeezeplay then you wouldn't need the RPis, so I guess that's not the case. If it was, then wired headphones connected to those Squeezeplay instances might be easier to manage. Or you could even use an RPi that has a built in 3.5mm socket (e.g. a 3A+ rather than a Zero), so that you could use cheaper and simpler wired headphones.

    However they connect, there will always be a momentary glitch while a synced player starts up. There is a SyncOptions plugin that seems to offer an option to 'wait for next track', so that this momentary glitch doesn't affect the others - not sure if it works with Squeezelite. But I suspect your 'language lab' MP3 is one long track, so this probably isn't appropriate.

    Is it important that all the players are accurately synced, or do they just need to play the same track at about the same time? One option would be to somehow 'stream' your MP3 file (think of a digital radio broadcast), then leave the players unsynced. They will all play the stream at roughly the same time (apart from any pausing, rewinding etc), but they won't affect each other because they're not synced.

  3. #3
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,329
    Can you say a little more about the physical layout of your lab? Will the RPis all be in a bank close to the teacher (you?), or will they be close to each user? It would be possible to add one or more physical buttons to each RPi to handle some specific actions. If they're accessible by the users it might make sense to add a single button to each one, whose only function is to power OFF the player. I don't know for sure that such a function exists (I have a button that calls the 'power' function, which toggles the power on/off) but maybe an Off-only function exists. This would mean they could only be powered up again by someone with access to LMS, so interruptions to the other players could be controlled by the teacher.

    Will you be sitting in front of a PC with access to the LMS web interface? If so, physical buttons would not be necessary, and you could control the power status of each player remotely. If you're set on Bluetooth headphones, they will probably power down automatically after a certain period of silence, so powering down the player should be sufficient.

  4. #4
    Quote Originally Posted by chill View Post
    Can you say a little more about the physical layout of your lab? Will the RPis all be in a bank close to the teacher (you?), or will they be close to each user? It would be possible to add one or more physical buttons to each RPi to handle some specific actions. If they're accessible by the users it might make sense to add a single button to each one, whose only function is to power OFF the player. I don't know for sure that such a function exists (I have a button that calls the 'power' function, which toggles the power on/off) but maybe an Off-only function exists. This would mean they could only be powered up again by someone with access to LMS, so interruptions to the other players could be controlled by the teacher.

    Will you be sitting in front of a PC with access to the LMS web interface? If so, physical buttons would not be necessary, and you could control the power status of each player remotely. If you're set on Bluetooth headphones, they will probably power down automatically after a certain period of silence, so powering down the player should be sufficient.
    sorry for my english writing.
    thank a lot for your concern.
    actually there is english lab.
    we must run a system for their needs. I must use raspberry pi zero w for their price. in my country everything was going to be more expensive from 2 months ago.
    pi zero w does not have dac. I bought pcm5102 and don't know exactly working in picoreplayer or not. as i mention bluetooth headphones and dac 5102 have same price.I suggest using bluetooth.
    how ever there is no pc or powerful computer.
    As you said internet radio streaming is another way. I worked with mixxx software and esp32 2 months ago.
    esp32 does not have relaible harware and memory buffer.I left all of them.
    about teacher and student.
    teacher and student are end users. you idea is good but i supposed they are noob in IT field.

    yesterday I was going to test my pc as a lms server and squeezelite client (together) (cmd command line enter squeezelite -s ip address)
    and one zero w as another client with picoreplayer. when bluetooth headphones off pc client is going to be destroyed.
    today i tested with two zero w bluetooth headphone. when one disconnected the other play well. but lms seekbar time player went backward and forward.

    unfortunetly in this app and scenario there is one way to sync and start together.

    I want to use streaming for maximum 50 clients.I think if one client battery of bluetooth headphones will be empty during the test ,not effect to others.
    as well as i'm not sure it is working or not with a good pc server lms and High price access point for 50 clients. maybe use 2 server for them. or it is not reasonable.
    Today I tested udp and rtp protocol with vlc on pc windows and android phone as a server and clients.
    both of them have rupture between music sound.
    I haven't tested tcp internet radio like mixxx software and icecast app server in raspberry.
    i don't know it is tested in raspberry zero w or not. and do you know it is better that Squeezelite? is it an app or os for client in raspberry? I have heard about mpd in raspberry. do you know that supported bluetooth headphone or change audio output?
    I don't need be synced exaclty , just start together. a few seconds delay not a problem.
    just listen and not effect to others.
    if bluetooth headphones can be used is perfect.

  5. #5
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,329
    I'm sure others can provide more authoritative comments, but I do suspect that using LMS to run 50 clients could be a problem. I've never tried that many, so can't say for sure.

    To clarify some other points though:

    My understanding of the Bluetooth issue you've experienced (when one set of headphones is turned off there is disruption to the other synced players) is that LMS thinks the 'player' is still 'on', it can't sync to it properly because the Bluetooth communication to that player is broken, so all the players are affected. As I see it there are two possible ways to avoid this.

    1) Make sure the 'player' (in LMS) is turned off before the Bluetooth headphones are turned off. Turning off a player in a synced group does NOT disrupt the others. Once the player is off, the headphones can then be switched off - in fact they will probably turn themselves off automatically once they stop playing.

    2) Don't sync the players. Set up a streaming source (e.g. in VLC), and get all players to play this stream via LMS. They won't be perfectly synced, but they'll be playing the same thing at the same time, like a radio station. I've never managed to get VLC streaming to work (from VLC on my Mac), but I believe this approach is possible. I suspect that a side-effect of this approach is that the load on the server *might* be reduced, because it's not trying to keep all 50 players synced. Not sure about that though.

    The PC that you use to control the players (e.g. turn them on/off) does not have to be the same one that runs LMS. It just needs to open the LMS web page. So maybe you could have a powerful desktop running LMS (Would that help with running 50 players? Not sure), but a less powerful laptop to control the players.

  6. #6
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,329
    Thinking about this further, I can't help feeling that managing 50 identical sets of Bluetooth headphones is going to be a headache. They'll all show up with the same Bluetooth name, so associating a specific set with a specific RPi, and keeping them correctly associated, might be confusing.

    I wonder if the money you could save by buying cheap wired headphones instead could be put towards using the Pi 3A+ instead of the Pi Zero w (approx 2x the price). I think wired headphones would be more robust, would not need charging, pairing, connecting each time. So you'd save a lot of staff time and effort too.

    On the question of using more than one LMS installation to service 50 players, the streaming approach would mean that you could indeed split the players between different LMS installations - just connect every player to the same stream. Just a hunch - maybe 5x RPi 3B+, each handling 10 players, would work. Or 10x RPi with 5 players each. Costwise: 10x 3B+ = ~ú300, plus 50x 2B+ =~ú1200 = ú1500 total.

  7. #7
    Quote Originally Posted by chill View Post
    I'm sure others can provide more authoritative comments, but I do suspect that using LMS to run 50 clients could be a problem. I've never tried that many, so can't say for sure.

    To clarify some other points though:

    My understanding of the Bluetooth issue you've experienced (when one set of headphones is turned off there is disruption to the other synced players) is that LMS thinks the 'player' is still 'on', it can't sync to it properly because the Bluetooth communication to that player is broken, so all the players are affected. As I see it there are two possible ways to avoid this.

    1) Make sure the 'player' (in LMS) is turned off before the Bluetooth headphones are turned off. Turning off a player in a synced group does NOT disrupt the others. Once the player is off, the headphones can then be switched off - in fact they will probably turn themselves off automatically once they stop playing.

    2) Don't sync the players. Set up a streaming source (e.g. in VLC), and get all players to play this stream via LMS. They won't be perfectly synced, but they'll be playing the same thing at the same time, like a radio station. I've never managed to get VLC streaming to work (from VLC on my Mac), but I believe this approach is possible. I suspect that a side-effect of this approach is that the load on the server *might* be reduced, because it's not trying to keep all 50 players synced. Not sure about that though.

    The PC that you use to control the players (e.g. turn them on/off) does not have to be the same one that runs LMS. It just needs to open the LMS web page. So maybe you could have a powerful desktop running LMS (Would that help with running 50 players? Not sure), but a less powerful laptop to control the players.
    thank you for your information.
    about limitation i think nobody tested it for 50 clients. I asked before but nobody was sure.

    about number 1 you said,
    It is supposed that the battery of bluetooth headphone is low and powered off Suddenly.
    and actually we dont want a teacher and student do something during disconnecting.

    number 2 : Yes you right, I think I have to test it. once i tested vlc as server and vlc player as clients in windows with udp protocol.
    or before that i have worked with mixxx and icecast.
    I did not know that lms can be used like internet radio streaming. where is that option?
    for this purpos what application or os do i use in client side?

    As well as i dont have info about what you said.it is a little strange.
    run lms server in one server and run webpage of lms in other pc. I don't think it is related for managing.supporting many clients like 50 i think it is supported by The developers and socket programming that they use .

    Tomorrow i tested 3 and 4 raspberry pi with just bluetooth headphone. and I disconnected one or two.
    or I will use one RPi 3 B+ with dac as a client that others to be synced with.maybe it makes differce.

    if they are not work using streaming method.
    if you know tell me where the streaming setting is in lms ?

  8. #8
    Quote Originally Posted by chill View Post
    Thinking about this further, I can't help feeling that managing 50 identical sets of Bluetooth headphones is going to be a headache. They'll all show up with the same Bluetooth name, so associating a specific set with a specific RPi, and keeping them correctly associated, might be confusing.

    I wonder if the money you could save by buying cheap wired headphones instead could be put towards using the Pi 3A+ instead of the Pi Zero w (approx 2x the price). I think wired headphones would be more robust, would not need charging, pairing, connecting each time. So you'd save a lot of staff time and effort too.

    On the question of using more than one LMS installation to service 50 players, the streaming approach would mean that you could indeed split the players between different LMS installations - just connect every player to the same stream. Just a hunch - maybe 5x RPi 3B+, each handling 10 players, would work. Or 10x RPi with 5 players each. Costwise: 10x 3B+ = ~ú300, plus 50x 2B+ =~ú1200 = ú1500 total.
    thank you again.about using dac i know there is a straight way. but i can figure out how to be recognized it to picoreplayer.
    my dac is pcm5102 3$ module .

    connection wiring was ok but i will try it again.
    about using rp3 for client. unfortunately the price is double in my country and in my situtation it is not reasonable.
    in other country it is the better way than using zero w.

    about using RPi 3B+ , is it possible using as server?
    for play music and sync client , what os should be used? raspberrian or picoreplayer has server side? I think I saw something but never test it.
    fortunately we can use with hdmi output to monitor. but I have not known that which scenario is relaible? it is or streaming internet radio.
    thank you again.

  9. #9
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,329
    Quote Originally Posted by nimaazx View Post
    number 2 : Yes you right, I think I have to test it. once i tested vlc as server and vlc player as clients in windows with udp protocol.
    or before that i have worked with mixxx and icecast.
    I did not know that lms can be used like internet radio streaming. where is that option?
    for this purpos what application or os do i use in client side?
    I've never used this option myself, but I believe the 'Tune in URL' option, in the 'Radio' menu of LMS, is where you would connect a player to a local stream. Maybe others who've used this option could comment. And clearly, if you're going to use this option on the LMS server side, then the clients would be LMS 'players'.

    Quote Originally Posted by nimaazx View Post
    As well as i dont have info about what you said.it is a little strange.
    run lms server in one server and run webpage of lms in other pc.
    Yes, that's how LMS works - use a browser on any device to access <server IP address>:9000

    Quote Originally Posted by nimaazx View Post
    about using RPi 3B+ , is it possible using as server?
    for play music and sync client , what os should be used?
    Use piCorePlayer to set up the 3B+. Use the web interface of pCP to setup and configure LMS as the server (you can also configure a Squeezelite 'player' on the same unit if you wish).
    Use piCorePlayer to set up the Zero W. Use the web interface of pCP to configure Squeezelite so that the Zero W can act as a client 'player'. In this scenario, you would not configure LMS on the Zero W.

    So my thoughts would be to:
    - Get 'a number' of RPi3B+ units, and use pCP to install LMS on each one to act as servers.
    - On your 50 Zero W units use pCP to configure Squeezelite, so that you have 50 players.
    - Connect each player to one of the servers. The number of RPi3B+ units that you'd need would depend on the maximum number of players that work reliably on each server.
    - Point each player to the locally streamed MP3 file. Don't attempt to synchronise the players, but rely on the fact that the stream will be like a radio station. This should prevent Bluetooth issues on one player from disrupting the playback on other players.

    This is all speculation on my part - what do others think of this approach?

  10. #10
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,329
    Quote Originally Posted by nimaazx View Post
    thank you again.about using dac i know there is a straight way. but i can figure out how to be recognized it to picoreplayer.
    my dac is pcm5102 3$ module .
    If you don't mind a little soldering (x50) there is another (cheap) way to add a 3.5mm audio jack to a Pi Zero W - see here. I might try this out myself.

    If it was me, I'd do anything to avoid having to manage 50 sets of Bluetooth headphones.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •