Press "Enter" to skip to content

Logitechmediaserver, C-3PO and PCM to DSD conversion

In this tutorial I’m going to illustrate how to implement and enable PCM->DSD conversion on-the-fly on Logitech Media Server. This is possible thanks to the plugin C-3PO and a modified version of SoX and Squeezelite-R2.

For a complete introduction and description of what is Logitech Media Server and how to install and use it you can read this Marco Curti’s guide -> Introduction to Squeezebox Server (translation in English will be available soon)

SOX

First of all we have to substitute the original SoX binary package in LMS with the modified one; go to the directory that contains LMS binaries:

Linux:

cd /usr/share/squeezeboxserver/Bin/ARCH

Where “ARCH” is the architecture of your operative system.

FreeBSD:

cd /usr/local/share/logitechmediaserver/Bin

macOS:

cd /Library/PreferencePanes/Squeezebox.prefPane/Contents/server/Bin/darwin

Windows:

cd C:\Program Files\Squeezebox\server\Bin\MSWin32-x86-multi-thread

Then remove the “old” sox, download the modified one and rename it in “sox”.

*nix O.S.

rm sox && wget https://audiodigitale/repo/sox-VERSION

You can find all the versions of SoX for different O.S. here -> Download SoX

The binaries in the download area are statically linked, so you don’t have to install any dependencies!

If you want to compile SoX by yourself in the download area there is the .tar.gz archive of the same version of SoX used to compile the binaries; otherwise you can also clone this github repository
-> mansr/sox

If you have any doubt follow this guide -> How to compile SoX

C-3PO

To install C-3PO please insert this repository in the lms plugin page :
http://www.marcoc1712.it/downloads/repository.xml

If you want to read more documentation about C-3PO follow this link -> C-3PO Transcoding Helper (translation in English will be available soon)

Project with source code on github -> marcoc1712/C-3PO

Particular instruction for FreeBSD: in this O.S. the directory that contains the binary of perl is different from linux, so you have to modify this file:

/var/db/logitechmediaserver/cache/InstalledPlugins/Plugins/C3PO/Bin/C-3PO

and replace #!/usr/bin/perl with #!/usr/local/bin/perl

Squeezelite-R2

Now your server should be ready to trascode PCM files to DSD, we just need to setup the client:

Please download the correct version for you O.S. here -> Squeezelite-R2

If you don’t know how to use it please read this guide -> Squeezelite-R2 Guide (translation in English will be available soon)

If you want to compile Squeezelite-R2 by yourself in the download area there is the .tar.gz archive of the same version of squeezelite-R2 used to compile the binaries; otherwise you can also clone this github repository -> marcoc1712/squeezelite-R2

If you have any doubt follow this guide -> How to compile Squeezelite-R2

Do you want to install and setup every single option of squeezelite easily? You can do it with Falcon, a practical and user-friendly web interface to manage every aspect of squeezelite! (Only for linux, beta)

Do you already know how to use squeezelite and you just want to start it at boot time?

Init Script (Linux)

sudo nano /etc/init.d/squeezelite

#!/bin/sh
### BEGIN INIT INFO
# Provides: squeezelite
# Required-Start: $syslog
# Required-Stop: $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Script per l'avvio di squeezelite
# Description: ---
### END INIT INFO


#VARIABLES

USER=root
OUTPUT= # Specify output device, default -> default, - = output to stdout
NAME= # Set the player name
LMS= # <server>[:<port>] ALSA= # -a <b>:<p>:<f>:<m> Specify ALSA params to open output device, b = buffer time in ms or size in bytes, p = period count or size in bytes, f sample format (16|24|24_3|32), m = use mmap (0|1)
BUFFER= # <stream>:<output> Specify internal Stream and Output buffer sizes in Kbytes
SCHEDULER= # <scheduler>:<rt priority> Scheduler: other, fifo, rr. Priority: 1-99 -> 1 min priority 99 max priority
NICENESS= # nice level -20 max priority 19 min priority

#CODE

case "$1" in
start)
echo "Starting Squeezelite"
start-stop-daemon -S --chuid $USER -N $NICENESS -P $SCHEDULER --exec /squeezelite -- -z -o $OUTPUT -n $NAME -s $LMS -a $ALSA -b $BUFFER -D
;;
stop)
echo "Stopping Squeezelite"
start-stop-daemon -K --name squeezelite
;;
*)
echo "Usage: /etc/init.d/squeezelite {start|stop}"
exit 1
;;
esac
exit

Save the file and:

sudo chmod +x /etc/init.d/squeezelite
sudo chown root:root /etc/init.d/squeezelite
sudo update-rc.d squeezelite defaults
sudo update-rc.d squeezelite enable

P.S. Please pay attention when you set the scheduler and the niceness; if you don’t know what are you doing remove “-N $NICENESS -P $SCHEDULER” from the script. If you have any question about this init script ask your questions in the comments below.

Automator (macOS)

Coming soon …

Batch script (Windows)

Coming soon …

4 Comments

  1. Kim Kruse Kim Kruse 20 Luglio 2017

    Hi,

    I cannot get the SOX working when runnning on Redynas Ultra 6 with x86 architecture. I have tried the linux version.

    No problems issued when running on windows 10 server.

    Please advise.

    Kr
    Kim

    • Simone Simone 25 Agosto 2017

      Ehy Kim thanks for your message, a friend of mine has compiled the SoX versions for Linux, while I have compiled the versions for other O.Ss. I will report this problem to him so we can fix this issue.

      Thanks,
      Simone

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: