SOLVED LMS Logitech Media Server installation (TrueNAS Core 13.x)

sonyhome

Dabbler
Joined
Mar 23, 2023
Messages
14
[EDIT] See post #8 for full recipe, posts #1~#7 might have more details on questions you may have if you hit issues.

I am a noob to TrueNAS.

I tried to install LMS as a plugin and it failed with the following error messages flashing in popup windows, telling me either the tar file couldn't be fetched anymore or it's not a tar file being fetched, but the scripts are broken:
downloading the latest stable version of LMS
tar: error opening archive: unrecognized archive type
Error: slimserver had a failure Exception: RuntimeError Message: Last 10 lines: tar: Error opening archive: Unrecognized archive format Partial plugin destroyed
CLOSE
Then saw some posts saying I should avoid plugins.

So plan B: A more manual install using a recipe that works. I had to dig around and follow a few dead ends so my contribution is to say this works in 2023:

Follow these old instructions from a FreeNAS 2018 post response from alwu:
  1. create a lms jail via the gui.
  2. add your music dataset as storage
  3. ssh into the freenas server.
  4. use jls to find the jail number for logitechmediaserver_1.
  5. jexec <lms jail number> tcsh
  6. pkg update
  7. pkg upgrade
  8. pkg install portmaster
  9. portsnap fetch extract
  10. setenv ALLOW_UNSUPPORTED_SYSTEM 1
  11. portmaster audio/logitechmediaserver
  12. selected flac and lame support on the first screen and disabled tests. kept the defaults for the remaining screens.
  13. echo 'logitechmediaserver_enable="YES"' >> /etc/rc.conf
  14. service logitechmediaserver start

Details:
1- I created it via the web UI jail menu, add button.
2- Mount your dataset to /media for example
3- I just used the web UI jail's shell to run the commands, instead of step 3,4,5 and it works
13- I used vi to do this but just make sure there's no spaces around = and double quotes for YES.
11- Note that this method is pretty long. Portmaster fetches all dependencies and compiles LMS. It did however build the latest LMS for me! The install is interactive with menus at the beginning, and at the end before exiting. I think most menus you can press enter and go. I disabled a bunch of unecessary builds like documentation.
14- I had to reboot the jail to see the LMS web UI appear (on port 9000). This step triggered an error about a missing input parameter deep in a CPAN/YAML method. When it works this step only prints a 3-4 line message.

LMS ports are:
TCP 9000 web UI (can be 9001 on QNAS, may conflict with Twonky)
TCP 9090 command line interface (used by some apps, I think you can telnet to it)
TCP 3484 on squeezebox clients
TCP 31337 squeezebox firmware updates from logitech (obsolete)

The LMS service is installed in
/usr/local/etc/rc.d/logitechmediaserver

15- Go onto the LMS web page on port 9000, for example if your TrueNAS server IP is *123, in your web browser just go to: 16- Go to the Settings/Basic Setting menu and set the media folder (/media for example) and apply.

Where I got stuck:

For me LMS refused to see my mp3's and directories, because of file access rights, so you need to do some admin work.

Solution A:
The media in my storage pool is owner by me (uid 1000) and in the wheel group, and no read rights for others. My account being in wheel is likely a bad idea but it's too late, and not the point here. Notice the "---": I gave no read rights to other users hence my troubles.
ls -l /media
drwxrwx---+ 12 me wheel 12 Mar 22 11:09 Classical
drwxrwx---+ 11 me wheel 11 Mar 22 11:43 EDM
I found out LMS runs as user slimserv (uid 104):
ps aux
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
root 31315 2.8 0.0 14044 3996 9 SJ 23:29 0:00.01 -csh (csh)
slimserv 29594 0.0 0.8 170268 141004 - SsJ 21:41 0:02.90 /usr/local/bin/
It is in its own group and that's not wheel so it accesses my files with"other" privileges.
pw user show slimserv
slimserv:*:104:104::0:0:Slim Devices SlimServer pseudo-user:/nonexistent:/usr/sbin/nologin
So I add slimserv to the wheel group:
pw groupmod wheel -m slimserv
pw group show wheel

wheel:*:0:root,slimserv
Then I trigger a scan of my mp3's in LMS

Solution B:
Change the service script file uid:gid:
service logitechmediaserver stop
vi /usr/local/etc/rc.d/logitechmediaserver
service logitechmediaserver start
Edit the u and a g entries set to slimserv. I changed that to be u=me and g=wheel. Don't use vi if you don't know that editor!

Solution C:
(I didn't try that)
Go to Jails, your LMS jail, mount points, your music dataset, edit ACL.
Change the ACL for the dataset containing all your music so that the everyone@ rights to allow read, and in Advanced click "Apply permissions recursively" which will I believe modify all the directory rights in the dataset. That means a lot of writes to disk, not just a TrueNAS config change, and not just the access rights of the mount point of the dataset.


So... I kinda had to help myself solve my own issues, and that's why this post is here. :) Hopefully it's mostly correct. I have been using TrueNAS for 3 days mostly banging my head to figure out how things work. It's far from plug and play.

Next one will be an Apache server, and the FAMP plugin doesn't work because it tries to install a package that's obsolete in 2023. :) Like/Watch/Comment if you liked this post... Oh wait it's not Youtube!
 
Last edited:

sonyhome

Dabbler
Joined
Mar 23, 2023
Messages
14
Does anyone has any jail network advice?


I'm having issues I can't see my slim devices on the network NOR connect to mysqueezebox.com

I wonder if the port forwarding is not enough to allow LMS to monitor my local network and it's stuck in the jail's network layer.

Jail properties:
[ ] DHCP autoconfigure
[v] NAT
[v] VNET
[v] Autostart
[v] NAT Port Forwarding
tcp jail:9000 host:9000
tcp jail:9090 host:9090

LMS information
Logitech Media Server Version: 8.2.1 - TRUNK @ UNKNOWN
Hostname: lms
Server IP Address: 172.16.0.2
Server HTTP Port Number: 9000
Operating system: FreeBSD - EN - utf8
Platform Architecture: amd64-freebsd
Perl Version: 5.32.1 - amd64-freebsd-thread-multi
Audio::Scan: 1.02
IO::Socket::SSL: 2.081
Database Version: DBD::SQLite 1.58 (sqlite 3.22.0)
Total Players Recognized: 0
Turns out portmaster did not get me the latest version (8.3.x).
LMS IP address ins 172.* which is not the 192.* address of the TrueNAS server. Maybe there's a network config issue preventing LMS from scanning devices on 192.* ?
 

sonyhome

Dabbler
Joined
Mar 23, 2023
Messages
14
Update...

On step 12:
* Disable dtrace for Perl
* Disable install documentation and tests on all packages
* DO NOT enable any of the statically linked binaries

I noticed on a reinstall some of these will break the build (especially dtrace).

Still broken:

I still have not figured out how to make the jail appear in the local 192.* network of the TrueNAS server without going through its own jail 172.* local network.
 

sonyhome

Dabbler
Joined
Mar 23, 2023
Messages
14
Well I fixed the local IP thing

Some source paths:

The rc script that launches LMS automatically at boot:
/usr/local/etc/rc.d/logitechmediaserver
LMS source code/program:
/usr/local/share/logitechmediaserver/slimserver.pl
What looks like portmaster makefiles and such. The makefile has a 8.2.0.g2021.11.13 ID, maybe I can change that to the latest version as step 10.5 and it would work to install the latest LMS?
/usr/ports/audio/logitechmediaserver

This is becoming stream of consciousness verbiage at this point as I RCA my install.
 

sonyhome

Dabbler
Joined
Mar 23, 2023
Messages
14
The jail should just be configured as:
[v] DHCP
[ ] NAT
[v] VNET
[v] Berkeley Packet Filter
Once the jail is running click on it and look for its IP address (different than the TrueNAS server)
Use that address:9000 as your music server. It will have the name of your jail on your slim device.
 

sonyhome

Dabbler
Joined
Mar 23, 2023
Messages
14
SOLVED!

I reran the installation today step 6-14, and "portmaster audio/logitechmediaserver" picked up version 8.3 of LMS. This fixed my ability to log into mysqueezebox.com, so now the installation is complete. I did not have to deal with step 12 selections again.

I believe someone updated the package, and who knows, it may also have fixed the LMS plugin supported by SimoneF, the from discussions in the LMS plugin support thread.

The freeBSD portmaster logitechmediaserver port details indicates trueos@norwegianrockcat.com updated the package on 04/25/23, how convenient! Thank you stranger :)
 
Last edited:

sonyhome

Dabbler
Joined
Mar 23, 2023
Messages
14
Final version
  1. create a lms jail (web UI Jail menu, click add button)
    1. The jail must have its own DHCP assigned address from your router by setting these properties:
      [v] DHCP
      [ ] NAT
      [v] VNET
      [v] Berkeley Packet Filter
    2. The name of the jail you pick will be the name of the LMS server to connect to in your slim devices.
  2. mount your music dataset as storage to /mnt/.../iocage/jails/slimserver/root/media (in lms jail menu, click mount points, you may need to click ">" to see that menu)
    1. Verify the group/user ownership of that dataset, and the access rights, so that /usr/local/etc/rc.d/logitechmediaserver can have access to the directories and music files. If there's issues, see Solution B above, it might be the easiest to run LMS as an existing user/group that has access to the files.
  3. Launch a lms jail shell window and type the following commands (in lms jail menu, click shell)
    1. pkg update
    2. pkg upgrade
    3. pkg install portmaster
    4. portsnap fetch extract
    5. setenv ALLOW_UNSUPPORTED_SYSTEM 1
    6. portmaster audio/logitechmediaserver
    7. selected flac and lame support on the first screen. Disable dtrace (for Perl) an all tests, documentation in following screens. kept the defaults for the rest. This build is slow! At the end you will have a ":" prompt, type "q".
    8. echo 'logitechmediaserver_enable="YES"' >> /etc/rc.conf
    9. service logitechmediaserver start
  4. Reboot the LMS jail (in lms jail menu, click restart)
  5. Find the IPv4 address of LMS, and connect to its port 9000 (http://192.168.0.???:9000)
  6. In the LMS interface click settings.
    1. In basic settings set the media folders as /media, click rescan.
    2. In mysqueezebox settings enter your login information, if it works, the button will change to "signout of mysqueezebox"
    3. In information, check library Total Tracks is ok, and monitor Total Players Recognized count
  7. Connect your squeezebox devices to your LMS server and stream music!
 
Last edited:

whywork

Cadet
Joined
Mar 30, 2023
Messages
4
Hi,

Tried to use this jail setup. (See my prior post about failure with LMS plugin)

Deleted LMS jail I had created that would run LMS find my 10K songs, but die after about three days (said running but no squeezebox devices would connect).

So today tried fresh LMS jail creation using instructions listed immediately above on Core 13.1

Had some confusion related to "selected flac and lame support on the first screen. Disable dtrace an all tests, documentation in following screens. kept the defaults for the rest. This build is slow! At the end you will have a ":" prompt, type "q".

Select flac and lame - must AAC and others be unselected?

Ran with "disable tests" and and aborted with dtrace errors. Tried to run again but never given setup/config screens.

Found dtrace disable - NOTE disable dtrace is only available on Perl settings screen about three screen/pages in.

Took nearly an hour to fully complete on Intel(R) Core(TM) i3-4160 CPU @ 3.60GHz

Finally LMS started but only found 52 songs in my Music Folder.

Still fiddling with permissions. Hoping LMS server stays running more than three days.
 

sonyhome

Dabbler
Joined
Mar 23, 2023
Messages
14
Select flac and lame - must AAC and others be unselected?

Ran with "disable tests" and and aborted with dtrace errors. Tried to run again but never given setup/config screens.

Found dtrace disable - NOTE disable dtrace is only available on Perl settings screen about three screen/pages in.

Took nearly an hour to fully complete on Intel(R) Core(TM) i3-4160 CPU @ 3.60GHz


Still fiddling with permissions. Hoping LMS server stays running more than three days.
Don't unselect the other audio encoders.
You must unselect "DTrace" for Perl, yes, as it seems to break the build with missing packages. Also you don't need it since it's a performance analysis tool.

For file permissions look at Solutions A / B / C above. That gave me the most trouble as I wasn't sure if I wanted to modify the permissions on my files and folders. Look at your ACL configuration, and figure out who are the owners of the music files. If the owner UID/GID are just numbers create users/groups in the jail with those numbers and you could use solution A, adding slimserv to the group(s) that own the file, assuming the group has read access in the ACL and on all the files and directories.
All that is file administration issues however, not LMS issues.

I'm glad this worked for you! :)

For others: If it does not see post #7 and you can try the LMS plugin. Maybe it works by the time you need it, and it is less tedious.
 
Last edited:

B34N

Dabbler
Joined
Jul 6, 2014
Messages
32
Thank you for the instructions. I never used LMS before and wanted to try out the plugin but that failed so I found your instructions. They worked for me except for using the Web UI shell command. When I attempted to run the portmaster I was shown the following menu:
Screenshot from 2023-12-31 11-48-12.png


When I would choose "OK" the entire shell shell turned blue. I let it stay that way for a few hours because I knew it took some time for the build. I eventually checked my CPU usage and realized that nothing was happening. I decided to just ssh into the jail. I executed portmaster again and this time I was shown many more menu options which I guess were dependencies for LMS. My piCorePlayer was found right away. At first only a few albums showed up but after a rescan I think everything is there.

Thanks again!
 
Joined
Jan 26, 2019
Messages
9
I want to report another successfull TrueNas Core 13 install, pretty much following the steps from SonyHome's post from back in March 2023.

Portmaster's recursive config drives me crazy, I always go into automatic mode taking defaults and click past Perl before I realize I need to disable Dtrace. I also didn't need so set ALLOW_UNSUPPORTED_SYSTEM, but you might....
Here's my middle bit, just calling make from within the port instead of using portmaster:
  • pkg update
  • pkg upgrade
  • portsnap fetch extract
  • Configure the ports by adding the following lines to /etc/make.conf (you can adjust the transcoders you use by moving APE, SOX, FAAD, FLAC, and/or LAME between the SET and UNSET variables).
Code:
audio_logitechmediaserver_UNSET=APE DOCS SOX TEST​
audio_logitechmediaserver_SET=FAAD FLAC LAME​
lang_perl5.36_UNSET=DTRACE​
LICENSES_ACCEPTED=SDL​
BATCH=yes​
  • cd /usr/ports/audio/logitechmediaserver
  • make install clean
  • echo 'logitechmediaserver_enable="YES"' >> /etc/rc.conf
  • service logitechmediaserver start
Setting port configuration via /etc/make.conf is a bit of a code-smell, but for a dedicated setup like this it's not going to come back and bite you.
 

make-nz

Dabbler
Joined
Apr 5, 2016
Messages
20
FYI

Very good news!
logitechmediaserver Audio streaming server that powers Squeezebox players from Logitech
8.4.0 audio
Maintainer: trueos@norwegianrockcat.com
Last Update: 2024-03-13 17:16:59

FreshPorts -- audio/logitechmediaserver: Audio streaming server that powers Squeezebox players from Logitech

An audio streaming server with many features including: - Web Interface--control the player and manage MP3 Internet radio - MP3 Internet radio - Alarm clock - Automatically imports ID3 tags - Browse and search by title, artist, album or genre - Shuffle and repeat albums or songs - Create, save...
www.freshports.org

I contacted the maintainer and he was already working on it and waiting for the commit.

@All
If you feel like saying a little thank you to the maintainer Trenton Schulz, please do!

He is using LMS for himself everyday, which is why became the maintainer, but I think he'd be happy to know there are more users.
Plus, it will make it easier/quicker to get changes commited.
 
Top