Announcement

Collapse
No announcement yet.

LMS on Old Desktop with lubuntu 18.04

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    LMS on Old Desktop with lubuntu 18.04

    When I found that Synology no longer supported LMS I decided to revert to Plan A: use a desktop computer. My chosen computer is an Acer Revo, but my model has a poorly specced Intel Atom. It claims to be X64, but chokes on a 64bit Linux distribution. I installed lubuntu 18.04 (the most recent 32bit distribution I could find). Lubuntu requires very little of the computer resources and still manages a useful performance.

    I wanted to have the choice of running it as a full desktop system with a monitor mouse and keyboard or running it 'headless' just to have LMS running.
    Full desktop mode is important for adding new music files, LMS modules and general system updates.

    Even the Synology NAS, consumes about 8 Watts at idle. The tiny Revo consumes about 28 Watts at idle. For this reason, I only wanted it running when it was in use, I wanted to be able to push the Power button and go straight into running the LMS. When I had finished, I wanted to push the Power button and have it shut down.

    Problem No. 1 is that Lubuntu 18.04 requires a password to boot. Problem No. 2 is that it still brings up a login requester even when set to passwordless login.

    Setting lubuntu 18.04 to Passwordless, Auto-login.


    Change /etc/lightdm/lightdm.conf so that it looks like this,

    [SeatDefaults]
    autologin-user=<your-user-name>
    autologin-user-timeout=0
    user-session=Lubuntu
    greeter-session=lightdm-gtk-greeter
    <blank line>
    If there is no lightdm.conf file, create one (sudo leafpad - because you need root permissions). If there is no last blank line, your system might freeze.

    Starting Up LMS without a Password.

    This requires a change to the sudo system. You should consider using visudo to do the text editing as this will check the syntax.

    visudo -f /etc/sudoers.d/logitech
    If you are careful, you can still use sudo leafpad. Make sure there is a blank line at the end of the file.

    File Name: /etc/sudoers.d/logitech

    <your-user-name> ALL=(ALL) NOPASSWD: /usr/sbin/service logitechmediaserver *
    <blank line>
    This file uses the * character to match all of the LMS commands such as start, stop and restart.
    Leaving the /etc/sudoers file alone and putting the entries in /etc/sudoers.d should mean that updates will not delete the configuration.

    Try,

    sudo service logitechmediaserver start
    It should run without a password being necessary. You shouldn't need to reboot.

    Run LMS at startup

    If you do your own research, you may find solutions based on rc.d. During a lubuntu update I saw the line,

    update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
    When I tried one of these methods, LMS started passwordless, but with user=Root. Nothing I could find would make it revert to user =.

    I reinstalled lubuntu and LMS.

    The official Ubuntu method is very easy (and safe). You could just create a file with leafpad (/home/roy/.config/autostart/logitechmediaserver), but I suggest,

    sudo apt install gnome-startup-applications

    gnome-session-properties
    Click Add and enter the command to be executed at login (name and comment are optional). For example, to make Firefox start automatically, it's sufficient to type 'firefox' in the Command field and confirm with Add. In our case, type 'sh ' (you need the space as the third character) and browse to the startup file.

    I created the file ~/home/<your user name>/Startup/logitechmediaserver.sh

    sudo service logitechmediaserver start
    sleep 3s
    <blank line>
    Change the file permissions to make it executable. The line 'sleep 3s' allows time for any text that may be sent to stdio. It works without, but best to be safe.

    If you reboot, you should be able to type the URL 127.0.0.1:9000 into Firefox or another browser and it should load up the LMS user interface.

    I also use this method to get the screen resolution higher to make the menus in apps like Libreoffice-writer larger: 'xrandr --dpi 130' in file, xrandr.sh.

    Xfce Power Manager

    Lubuntu defaults to 'Ask' when the power button is pressed: it brings up the logout menu.

    Change 'When Power Button Is Pressed' from 'ask' to 'Shutdown'
    Reboot.

    Oh dear, does it still bring up the logout menu? There appears to be a bug in Xfce Power Manager.

    ~/.config/xfce4/xfconf/xfce-perchannel-xml /xfce4-power-manager.xml
    has the correct line,

    <property name="power-button-action" type="uint" value="4"/>
    but it is ineffective.

    There is a possible work around. If you do not have an /etc/acpi folder,

    sudo apt-get install acpid
    Check /etc/acpi/powerbtn.sh

    delete all but the last line,
    /sbin/shutdown -h now "Power button pressed"
    <blank line>
    If the file does not exist, create it.

    Reboot

    If you still get the logout menu, try pushing the Power button for a moment and then pressing 'Enter' on the keyboard. If this closes the system, then this is your only way of doing it in 'headless' mode.

    Restore powerbin.sh to its previous contents, or delete it altogether if you added it. If you installed acpid, then uninstall it.

    #2
    Linux Mint has a 32 bit distro

    https://linuxmint.com/edition.php?id=297


    and headless is possible on a basic Debian install ( a bit more work)

    One has to build the binaries for LMS on 32 bit

    and there is also

    https://www.raspberrypi.com/software...ry-pi-desktop/

    again, a 32 bit install.

    I have an old shuttle with an Intel Atom that runs Linux Mint 64 bit fine, if a little slowly

    ronnie

    Comment


      #3
      Originally posted by

      [URL="https://www.raspberrypi.com/software/raspberry-pi-desktop/"
      https://www.raspberrypi.com/software/raspberry-pi-desktop/[/URL]

      again, a 32 bit install.
      The snag with the Raspberry Pi is that there is no power button. One can be added to close the operating system, but it leaves the board powered up. I have not checked to see what the power consumption is on shutdown.

      Linux Mint is very interesting. I might do it all over again to see how the minty dist works.

      Comment


        #4
        update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
        This probably means that the OS uses the systemd init system rather than openrc. The correct command to run the service at startup in this case is

        Code:
        systemctl enable logitechmediaserver

        Comment


          #5
          @ Man in a van,

          Mint is excellent, comes in 32bit and the distribution is still being upgraded. I tried it many years ago instead of Kubuntu, but it was not very good. Now it is a worthy competitor. The File Manager (nemo) can do split panes like Dolphin, can run as root, unlike Dolphin which has security issues, but nemo is not as configurable as Dolphin.

          To use Mint as a headless LMS, make LMS passwordless using the method given for Lubuntu, above. The Ubuntu/Gnome Power Manager has been implemented as a config utility: make Power Button = Shutdown. Autostart is also implemented as a config utility. It all works very well, if slightly slower than Ubuntu. The features make it well worth while.

          I am using a Raspberry Pi, instead.

          I installed 32bit Arm LMS on Raspberry Pi OS (which still identifies as 'Raspbian') on a Raspberry Pi Zero W with a 64GB SDXC card. It is amazingly slow to set up. I found that it was easier to transfer the SDXC card to a Raspberry Pi 2B and set it up, there. To manage LMS, one has to use the Chromium browser. Dillo is installed by default, but will not render the LMS web pages. Firefox used to be a little faster, but is currently broken. For both Raspis, add the CPU occupancy app to the task bar and wait until the CPU returns to idle after each action.

          Raspberry Pi Zero W on standby consumes 1Watt. When running LMS it consumes 2W. That is 8.76/ 17.52 kWH per annum.
          Raspberry Pi 2B on standby consumes 1Watt. When running LMS it consumes 3W. That is 8.76/ 26.28 kWH per annum.

          In the UK, that is capped at about £3/£6 per annum for the Zero and £3/£9 for the 2B. I don't suppose it will be more than that in dollars around the world. As Scrooge-like as I am, I am going to leave the Zero running 24/365.

          I could save £3 per annum. LMS starts passwordless on the Pi. Autostart is achieved by adding a .desktop file in a .config subdirectory. A power button can be added to pins 5&6. A dab on the momentary make button will boot from standby and will shut-down to standby once the line,

          dtoverlay=gpio=shutdown

          is added to /boot/config.txt.

          The Zero is the lowest powered Pi that I have. When it is being used by my Transporter, digital amps and floor mounted monitor speakers, the CPU occupancy can hardly be detected. The sound is magnificent.

          I think Pi Zero Ws are still on sale. If not, go for the more powerful Pi Zero2 W.

          If anyone wants more detail, just submit a post.

          Just one more thing about using a low power Pi: install quodlibet for its powerful and quick search functions. It only works on file names and mp3 metadata (and comes with the excellent exfalso metadata editor), but will make metadata searches much easier on the Pi.

          One thing I wanted was an alternative to the Duet remote. I could not find such a thing that did not come with a player or LMS. I have added Squeezer to my Android tablet and that seems to work well.

          Comment


            #6
            A Postscript,

            I arranged to ssh from Terminal in my main desktop to the LMS Pi. This makes it possible to run sudo apt-get update and (dist-)upgrade without plugging screen, keyboard and mouse into the Pi. With key upgrades this can be followed with a sudo reboot.

            Alternatively, I can push the 'Power' button to shut down and move the Pi nearer to the peripherals.

            I set up passwordless ssh.

            Two gottchas: I had to use the router to associate the Pi MAC with a static address and the usual method of starting ssh on the Pi at startup did not work. Instead, use Preferences/RaspberryPi Config and set the ssh config to 'ON'. SSH is installed, by default.

            Comment

            Working...
            X