Press "Enter" to skip to content

Logitech Media Server and FreeBSD

There are 3 ways to install Logitech Media Server on you FreeBSD computer: ports, packages and DIY (yes … you have to compile everything)

Ports

Just type:

pkg install portmaster
portmaster audio/logitechmediaserver

IMPORTANT: while configuring the options of all softwares you are going to install, when logitechmediaserver options will be prompted make sure that “TEST” will NOT be ticked.

Note that the last update of this port was at the 11th July 2017.

Packages

I have personally built packages from the ports because an LMS package is not available; due to this you have to add my repository to the package manager configuration file:

ee /etc/pkg/FreeBSD.conf

and add

audiodigitale: {
url: "http://audiodigitale.eu/repo/freebsd/pkgs",
mirror_type: "http",
enabled: yes
}

then you can:

pkg update
pkg install logitechmediaserver

Note that the last update was at the 6th January 2018. Installing LMS from packages means that you are accepting Logitechmediaserver license -> License_eng

DIY, aka: compile everything from source

Before starting this is what you need:

  • libtime.a
  • libpatience.a
  • Knowledges about what are jails (I will use CBSD to manage them)

Let’s start creating a jail that we will use to build everything:

cbsd jconstruct-tui

In “pkglist” insert manually:

unzip bash gmake rsync nasm wget libgd gcc perl5-5.24.1 automake libtool

Enter in the jail:

cbsd jstart build
cbsd jlogin build

I’m going to use /tmp to download everything and build lms:

cd /tmp
wget http://downloads.slimdevices.com/nightly/7.9/sc/3adb1b4/logitechmediaserver-7.9.1-1489743085.tgz
wget https://github.com/Logitech/slimserver-vendor/archive/public/7.9.zip
unzip 7*
tar xjf l*

Let’s start compiling:

cd slimserver-vendor-public-7.9/CPAN
./buildme.sh -t | tee /tmp/build.log
cd /tmp/logitechmediaserver-7.9.1-1489743085/CPAN/arch/5.24
rm -rf 5.1* && rm -rf 5.8 && rm -rf 5.22 && rm -rf 5.20
cp -Rp /tmp/slimserver-vendor-public-7.9/CPAN/build/arch/5.24/amd64-freebsd-thread-multi .
rm -rf x*

cd /tmp
tar cf FreeBSD-lms-7.9.1.tar logitechmediaserver-7.9.1-1489743085

wget http://downloads.xiph.org/releases/flac/flac-1.3.2.tar.xz
tar xf f*
cd flac-1.3.2
autoreconf -i
./configure --enable-static --disable-shared
make

cd /tmp
wget http://downloads.sourceforge.net/faac/faad2-2.7.zip
unzip faad2-2.7.zip
cd faad2-2.7
./configure --enable-static --disable-shared
make

cd /tmp
wget http://www.wavpack.com/wavpack-5.1.0.tar.bz2
tar xf wavpack-5.1.0.tar.bz2
cd wavpack-5.1.0
autoreconf -i
./configure --enable-static --disable-shared
make

Now we have to exit from this jail and move everything we have just compiled to a new jail when logitechmediaserver will run.

First of all exit from the build jail:

exit

Create a new jail like we did before including the following packages:

wget perl5-5.24.1 libiconv

cbsd jstart lms
mv /usr/jails/jails-data/build-data/tmp/FreeBSD-lms-7.9.1.tar /usr/jails/jails-data/lms-data/tmp
cbsd jlogin lms

Now I’m going to copy lms and the binaries we have compile above in the “lms” jail. I will include the modified version of SoX able to convert in DSD; for further info: Logitechmediaserver, C-3PO and PCM to DSD conversion

cd /tmp
tar xf F*
pw groupadd -n lms -g 20000
pw useradd -n lms -u 20000 -g lms -s /usr/sbin/nologin -c "Logitech Media Server" -d /nonexistent
mkdir /usr/local/lms
mv logitechmediaserver-7.9.1-1489743085 /usr/local/lms/
cd /usr/local/lms
mv logitechmediaserver-7.9.1-1489743085/* /usr/local/lms
rmdir logitechmediaserver-7.9.1-1489743085
rm -rf Bin/a* && rm -rf Bin/i* && rm -rf Bin/p* && rm -rf Bin/s* && rm -rf Bin/x*
cd Bin
wget https://audiodigitale.eu/repo/sox/sox-FreeBSD
mv sox-FreeBSD sox

exit

Move flac, faad, wavpack binaries into the Bin folder of LMS:

mv /usr/jails/jails-data/build-data/tmp/flac-1.3.2/src/flac/flac /usr/jails/jails-data/lms-data/usr/local/lms/Bin/
mv /usr/jails/jails-data/build-data/tmp/faad2-2.7/frontend/faad /usr/jails/jails-data/lms-data/usr/local/lms/Bin/
mv /usr/jails/jails-data/build-data/tmp/wavpack-5.1.0/cli/wvunpack /usr/jails/jails-data/lms-data/usr/local/lms/Bin/

Back into lms jail:

cbsd jlogin lms
chown -R lms:lms /usr/local/lms
chmod -R 755 /usr/local/lms/Bin
mkdir /var/log/lms
mkdir /var/db/lms
mkdir /var/db/lms/cache
mkdir /var/db/lms/prefs
mkdir /var/db/lms/playlists
chown -R lms:lms /var/db/lms
chown -R lms:lms /var/log/lms
cd /etc/rc.d
wget https://audiodigitale.eu/repo/freebsd/lms
chmod 555 lms
echo 'lms_enable="YES"' >> /etc/rc.conf && echo 'lms_logdir="/var/log/lms"' >> /etc/rc.conf && echo 'lms_cachedir="/var/db/lms/cache"' >> /etc/rc.conf && echo 'lms_prefsdir="/var/db/lms/prefs"' >> /etc/rc.conf && echo 'lms_playlistdir="/var/db/lms/playlists"' >> /etc/rc.conf

exit

Now restart the jail and Logitech Media Server will start at boot (if you are lucky 😉 )

cbsd jstop lms
cbsd jstart lms

19 Comments

  1. Wayne Wayne 6 gennaio 2018

    Many thanks for this!

    I couldn’t get the port to install no matter what, so your pkg has been a big help!

    Any chance we can have an update to the latest 7.9.1 please?

    Thanks!

    • Simone Simone 6 gennaio 2018

      Hi Wayne! At the moment I am quite busy but I think that within the end of January I can update the packages, be patient and thanks again!

      • Wayne Wayne 6 gennaio 2018

        No worries there is no rush. 7.9.0 is working very nicely at the moment. Again thanks very much for doing this! Much appreciated 🙂

        • Simone Simone 6 gennaio 2018

          Well, it seems that you are quite lucky! Try to pkg update and pkg upgrade and tell me if logitechmediaserver will upgrade to 7.9.1. I tried on my VM and it works!

          • Wayne Wayne 6 gennaio 2018

            Yes pkg upgrade is done quick and easy. I’ll do some proper testing tomorrow and I find anything strange I’ll report back.

            Thanks a lot!!

  2. Aljosa Aljosa 11 febbraio 2018

    Hi, I am gettin error when try to LMS from ports

    fetch: https://codeload.github.com/Logitech/slimserver/tar.gz/c835a1f?dummy=/Logitech-slimserver-7.9.0.g2016.09.30-c835a1f_GH0.tar.gz: size of remote file is not known

    Logitech-slimserver-7.9.0.g2016.09.30-c835a1f_ 179 MB 6178 kBps 00m30s

    => Fetched file size mismatch (expected 187923230, actual 187921541)

    => Trying next site

    => Attempting to fetch http://distcache.FreeBSD.org/ports-distfiles/Logitech-slimserver-7.9.0.g2016.09.30-c835a1f_GH0.tar.gz

    fetch: http://distcache.FreeBSD.org/ports-distfiles/Logitech-slimserver-7.9.0.g2016.09.30-c835a1f_GH0.tar.gz: Not Found

    => Couldn’t fetch it – please try to retrieve this

    => port manually into /usr/ports/distfiles// and try again.

    *** Error code 1

    Stop.

    make[1]: stopped in /usr/ports/audio/logitechmediaserver

    *** Error code 1

    Stop.

    make: stopped in /usr/ports/audio/logitechmediaserver

    ===>>> make build failed for audio/logitechmediaserver

    ===>>> Aborting update

    ===>>> You can restart from the point of failure with this command line:

    portmaster audio/logitechmediaserver audio/faad audio/mac devel/yasm audio/sox audio/flac audio/libogg audio/gsm audio/lame audio/libao audio/libid3tag audio/libmad audio/libsndfile audio/libvorbis audio/opusfile audio/opus devel/libltdl

    This command has been saved to /tmp/portmasterfail.txt

    root@LMS:/ #

    any idea how to solve this?

    I did try to do pkg upgrade.

    • Simone Simone 11 febbraio 2018

      It seems that your port list is not updated. You are using the port for lms 7.9.0 but there is already a port for 7.9.1 Try to First update the ports list.

  3. dwhacks dwhacks 28 febbraio 2018

    I used your repository to install in a FreeNAS jail. I had to do:
    echo ‘logitechmediaserver_enable=”YES”‘ >> /etc/rc.conf
    service logitechmediaserver start

    To get it to start, and it seems to be working now.

  4. Giorgio Giorgio 15 marzo 2018

    Many thanks for this!
    is it possible to install it on version 10.3.0.3 – Pilingitam (revisione 4374) ?

    • Simone Simone 15 marzo 2018

      I think you are using NAS4Free. I’ve never tested on this s.o. but as long it uses pkg (like FreeBSD) as package manager you should be able to install everything. Just try and let me know!

  5. Giorgio Giorgio 15 marzo 2018

    Sorry for my English
    I’ve tried but it gives me a version error (use version 11)
    I tried with a virtual Nas4free version 11 and it works but I installed the 10 on my nas.
    If you want, I can send you the error. I install a virtual Nas4free with the same version of my real

  6. Giorgio Giorgio 15 marzo 2018

    This is the error

    pkg: wrong architecture: freebsd:11:x86:64 instead of FreeBSD:10:amd64
    pkg: repository audiodigitale contains packages with wrong ABI: freebsd:11:x86:64

  7. Giorgio Giorgio 15 marzo 2018

    Resolved
    setenv ABI freebsd:11:x86:64

    • Simone Simone 15 marzo 2018

      Perfect 😉 Is everything working?

  8. AA AA 26 marzo 2018

    Thanks for the great tips and instructions!

    Just a note that you can make your life easier if you build against a static Perl installation that is not dependent on ports changes. Just download Perl sources from CPAN (http://www.cpan.org/src/5.0/perl-5.24.3.tar.gz) and install into alternate location, e.g.:
    cd perl-5.24.3
    ./Configure -des -Dprefix=/usr/home/squeezeboxserver/perl-5.24.3-LMS -Dusethreads
    make
    make test
    make install-strip

    Now you can build LMS using this alternate version of Perl with “./buildme.sh -t -p /home/squeezeboxserver/perl-5.24.3-LMS/bin/perl”, and next time you upgrade FreeBSD release, you just need to re-build Perl 5.23.4 as above, and you are good to go! Remember to update the interpreter command in the start-up script and the perl executable in slimserver.pl to /home/squeezeboxserver/perl-5.24.3-LMS/bin/perl.

    BTW, I had a problem building latest CPAN modules, and had to make a change to the buildme.sh script (comment out one patch line:
    #patch -p0 < ../../icu58_patches/digitlst.cpp.patch). You might want to uncomment build IO::Socket::SSL as well if you are planning to ever use Spotty plugin.

    • Simone Simone 26 marzo 2018

      Thanks for the tips, really useful!

  9. ERIK ERIK 17 agosto 2018

    Thanks for all of the information. I installed via pkg but run into an error when I try to start the service:
    Starting logitechmediaserver
    The following modules failed to load: DBI EV XML::Parser::Expat JSON::XS Digest::SHA1 YAML::XS Sub::Name

    Any assistance would be greatly appreciated!

    Thanks.

    • Simone Simone 18 agosto 2018

      Mmm, I have an idea. When you install a package pkg tries to find the dependencies from all the mirrors, if you have multiple mirrors he will choose the one with the last version ofc. Maybe (?) the compiled version of LMS in my repo has some problem with the last version of perl. You can try to uninstall the packages and dependencies that you have installed, comment the link to the official repository and leave only my repository, try to install LMS and only after that restore the the FreeBSD.conf file.
      I will recompile and update every package as soon as possibl, but for the moment try to do this and let me know.

      • ERIK L HOPFENSPERGER ERIK L HOPFENSPERGER 20 agosto 2018

        I completely removed the FreeBSD repository from the file. I then installed LMS and it is running. I did receive an error when I started the service but I forgot to capture the error before deploying the unit. I will try to grab it next time I am connected to that machine and post it back here. I believe it was a SSL error but am not 100% positive. Thanks for the info on the repo solution!

Rispondi

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.

%d blogger hanno fatto clic su Mi Piace per questo: