Press "Enter" to skip to content

Categoria: LMS

Logitech Media Server

SqueezeCore: a minimal audio OS running Squeezelite.

The purpose of this project:

I built SqueezeCore because I needed a lightweight, minimal, plug&play OS to use it as a squeezelite player. The whole OS is 17MB and when running it occupies around 60MB of RAM; SqueezeCore must be installed on a USB drive and will run completely in RAM. Perfect to be installed on a thin client!

Requirements

  • RAM: 128MB
  • CPU: 32bit or 64bit, every CPU is ok, it can run on a toaster too
  • USB flash drive: 32MB
  • An ethernet port
  • A monitor for first setup (optional)
  • A keyboard for first setup (optional)
  • A computer running Logitech Media Server

Installation:

Download SqueezeCore .IMG from here: SqueezeCore
Flash the .IMG using Etcher or a similar software

Which version should I download?

1st rule: if you are unsure download the generic .img. It is usually more stable, and has less specific hardware requirements.
If you want to try the RT version please read all the FAQs before.

Changelog

v0.1-ALPHA: initial release
v0.2-BETA: fixed a bug that caused squeezelite not being able to lock on the specified output device
v0.3-BETA: minor fixes
v0.1-RT-BETA: initial release

First Setup:

Using monitor and keyboard (recommended):

Plug into your computer the USB flash drive with SqueezeCore, an ethernet cable (wifi not supported at the moment), a keyboard and a monitor.
Power on and boot from USB.
Now you will have to enter some squeezelite settings like: what audio device use as output, buffer settings and so on; if you have any doubts leave all settings as default and just select your audio output device. (Important: read carefully the options during the setup)
From now on every time you power on your computer squeezelite will start at boot with the defined settings.

Headless setup:

Plug the SqueezeCore USB drive to your computer. Create a file named squeeze.conf inside the “/config” directory. Open squeeze.conf with Notepad++ (or a similar editor that allows you to set the UNIX(LF) newline) and insert the squeezelite options following this example:

hw:CARD=UD501,DEV=0    #1st line: output device
SqueezeCore                     #2nd line: Player Name
SqueezeCore                     #3rd line: Model Name
auto                                    #4th line: [server_address:port], auto to autodiscover
40:4::0                             #5th line: ALSA parameters [buffer:period_count:sample_format:mmap]
4096:3072                         #6th line: [stream_buffer:output_buffer]
45                                        #7th line: process priority [1-99]
                                               #8th line: [OPTIONAL] additional commands

Save, plug your SqueezeCore USB flash drive to your PC, power on, profit!

F.A.Q.

I want bit-perfect audio but in the output device list my dac does not appear as “hw:CARD=card_name” but only “default:CARD=card_name”
You can try to type 0 during output selection to not choose any option, then, in additional options (last question) type “-o hw:CARD=card_name,DEV=0”

I want to reset my configuration! How can I do it?
Directly on SqueezeCore: “rm -f /squeezecore/config/squeeze.conf && sync”
From Windows: delete /config/squeeze.conf

But, what about the RT version?
It is a specific build with a custom Real Time kernel; the hardware requirements are different from the generic version:
Minimal Hardware Requirements for RT:
CPU: Only Intel, Only Core2Duo and newer (Xeon, Core i3 i5 i7, new Pentium and Celeron). 2 core 4 thread (recommended 4 physical cores).
The Other requirements are the same of the generic one.

In the RT version the difference is not only in the kernel but there are other tweaks under the hood like:
The player runs on a isolated core with round robin scheduler.
All the DAC USB interrupts are isolated on one core.
The remaining core are for kernel and the remaining interrupts and software running.

Since the RT version has more strict hardware requirements do you have any suggestion for the hardware setup?
I really like mini-ITX and thin-ITX motherboards with Pentium and Celeron N-series (like N3160) or J-series (like j4105 j3455). Those models have 4 cores and very low power consuption.
About bios settings you can try to disable multi-threading and C-states (but I really don’t know if this can affect the sound performance, you can try and come back here to write your feedback)

Thanks to:

  • Marco Curti for Squeezelite-R2
  • TinyCoreLinux team for their awesome distro. Squeezecore is based on Tinycorelinux.

If you are using SqueezeCore and you like it consider to buy me a coffee: paypal.me

Logitech Media Server and FreeBSD/FreeNAS

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

Package built by me (beta)

Ports are not constantly updated so I decided to create an installer which is easy to maintain for my personal use.

This will allow you to 1- Install Logitech Media Server, 2- Uninstall Logitech Media Server, 3- Update LMS whenever I’ll publish an updated version (works only if you have installed LMS with this software)

It will install Logitechmediaserver 7.9.3 updated at the latest commit (refer to the date written in the changelog) with these included binaries:

  • SoX with DSD support
  • Flac 1.3.3
  • Faad2 2.8.8
  • Wavpack 4.80.0

Instructions (must be executed as root!)
pkg install curl
curl -o /usr/local/bin/lms_installer https://audiodigitale.eu/repo/freebsd/lms_installer
chmod +x /usr/local/bin/lms_installer
lms_installer

Please, this software is still in beta, I really do need some feedback from you all! If something is not working as expected leave a comment below!

Using this software you are agreeing to its EULA.

For those of you who installed lms_installer when it was in ALPHA please delete it and reinstall it.

Changelog ALPHA

(ALPHA) 18/10/2019. slimserver commit 8a9e9fb, vendor commit 8b05092. First release of installer software, tested on FreeBSD/FreeNAS >= 11	 	 
(ALPHA) 22/10/2019. installer update to fix some bugs
(ALPHA) 14/12/2019. installer update to support FreeBSD 12.1-RELEASE

Changelog Installer

(BETA) 09/01/2020. First beta released. Installer can now auto-update itself
(BETA) 24/01/2020. Software completely rewritten in c++. Added option to choose what version of lms install.

Changelog LMS

(BETA) 09/01/2020. slimserver-vendor commit 8b05092. slimserver commit 8d85ddd
(BETA) 21/01/2020 updated to LMS 7.9.3 slimserver commit 4f7c9f49
(STABLE-7.9.3) 24/01/2020. updated to version 1579448956
(BETA-8.0.0) 24/01/2020. added version 1579786032
(STABLE-7.9.3) 20/03/2020. updated to version 1582867832
(BETA-8.0.0) 20/03/2020. updated to version 1584422335

Installing LMS from my installer script means that you are accepting Logitechmediaserver license -> License_eng

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.

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