Home of the Squeezebox™ & Transporter® network music players.
Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13
  1. #11
    Junior Member
    Join Date
    Mar 2018
    Posts
    7
    Hi DJanGo,

    Quote Originally Posted by DJanGo View Post
    using one Variable with the exact value of an already existing variable istnt that smart as it looks.
    eg.
    Code:
    printf "$$HOSTNAME stop\nexit\n" | nc $LMS_NAME $LMS_PORT > /dev/null
    piping the printf to > /dev/null is the same - not a good idea.
    First, yes it may be smart.
    What if I wanted to set $LMS_NAME differently per user? Or set it via the -N option according to a file's content (that may live in the users' homedir)?
    What if I wanted to expand the script to do other stuff as well?
    In my script I would have to change only one assignment and that's it.
    To some it might seem like a waste of memory, to me it's just better style to define an extra variable to contain what it says to contain - whatever that may be.

    Second, I don't pipe printf to /dev/null. Printf is piped to nc ... whose output is redirected to /dev/null, because I don't need it.
    I couldn't imagine for what? Debugging maybe? If I intended to do that, then I would...

    Quote Originally Posted by DJanGo View Post
    Just "stop" a player thats maybe online or not - maybe stopped or not - is a even better idea.
    I suppose you're being sarcastic? Please keep in mind that this may not be a good idea, when communicating with non native speakers.
    If you think, that's a bad idea, would you mind telling me why? The scripts in fact do work as expected.

    Quote Originally Posted by DJanGo View Post
    You should use something and only that something - not something here (autostartscript) and some autoplaysettings.
    Yes, I totally agree with you that preferably one should use only ONE kind of setting that's intended to do something.
    As it doesn't work as expected, I tried to find another solution that obviously works.
    I'm sure you can tell me, where I failed to get it working the "normal" way.


    Oh, by the way... I think I didn't mention where I found the method to printf cli commands and send them to LMS via nc.
    I had a look at the daemon-start-stop scripts that are supplied with the debian distro package (outdated or not - doesn't matter, this has been approved to be correct at some time).
    In that script, the setting $SL_AUTO_PLAY is evaluated. This setting can be made in /etc/default/squeezelite as central configuration file for squeezelite. If $SL_AUTO_PLAY is true, then a "play" command is sent to LMS. So in that official package, they're doing exactly the same as I do (just the other way round) and use a method (cli commands via nc), where another method (settings in LMS) should be used according to you. Why is that?

    Cheers
    W69

  2. #12
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    2,878
    As long as you don't kill -9 the squeezelite program the signal handler sends the slimprotocol STOP command to the server before it quits.

    I should mention that as soon as you run more than one instance of squeezelite on the same system you MUST add the -m parameter with a unique MAC address or set the UTMAC environment variable and squeezelite will use that MAC to annouce itself to LMS. This again must be per user not global.

    Two or more players using the same MAC causes LMS to be unable to control any of the players with the same MAC reliably.
    Ralphy

    1-Touch, 5-Classics, 3-Booms, 2-UE Radio
    Squeezebox client builds donations always appreciated.

  3. #13
    Junior Member
    Join Date
    Dec 2020
    Posts
    1

    session output selection

    I set up a headless server using the following config:

    loginctl enable-linger kodi # kodi is the userid I used for all multimedia
    mkdir .config/systemd

    file .config/systemd/squeezelite.service:
    [Unit]
    Description=Squeezelite
    Wants=dbus.socket
    After=dbus.socket

    [Service]
    ExecPre=xset s off
    ExecStart=/usr/bin/squeezelite -s server.homenet
    Restart=always

    [Install]
    WantedBy=default.target
    --------
    There is a similar control file for kodi.
    nodm is set to autologin to the kodi user.


    systemctl --user enable squeezelite
    systemctl --user start squeezelite

    I used pavucontrol to initially set pulse to use the correct output (hdmi in my case).

Posting Permissions

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