High-end Vinyl Streaming to Squeezebox

High end vinyl streaming

High end vinyl streaming

Finally I found time to optimise my wireless vinyl streaming Raspberry Pi project. It uses now Liquidsoap and lossless FLAC streaming at 44100 kHz, 16 bit sampling for high end quality.

I am using the same raspberry pi setup as in my previous post. In that post I also explain how to tune your Squeezebox players to the stream, so I am not repeating it here again. Very important: only Logitech Media Servers 7.8 and higher support FLAC streaming in a OGG/Vorbis container. So, make sure that you are using the community edition and not one of the last official releases, or you wont be able to listen to the stream.

If you are running LMS 7.8, here are the step-by-step instructions how to set up liquidsoap on Raspbian Wheezy under the default user “pi”.

First, you need to update apt-get

$ sudo apt-get update

$ sudo apt-get upgrade

Then, you can install liquidsoap with all plugins including Ogg/Flac

$ sudo apt-get install liquidsoap

$ sudo apt-get install liquidsoap-plugin-all

Create a liquidsoap script, called “phono.liq”

$ sudo nano /etc/liquidsoap/phono.liq

Copy this script, replace [IP-ADDRESS] with your actual raspi’s IP address. Make sure that your DHCP server does not change it occasionally.


# set the path and permissions for the logfile




#input from soundcard

phono = input.alsa(bufferize=true,fallible=false,device=”hw:1″)

#stream it to local icecast, default port and password

output.icecast(%ogg(%flac(samplerate=44100,channels=2,compression=5,bits_per_sample=16)), mount=”/phono”, name=”Phono”, format=”audio/ogg”, description=”Turntable FLAC”, url=”http://IP-ADDRESS”, genre = “Misc”, phono)

Save the script with CTRl-x, y ,

then make it executable

$ sudo chmod +x /etc/liquidsoap/phono.liq

Liquidsoap is extremely fragile, when it comes to owners and user rights. So, let’s make sure that we are ok here, otherwise it will not start.

$ sudo chmod 666 /etc/logrotate.d/liquidsoap

$ sudo chmod 777 /var/log/liquidsoap

$ sudo chmod 666 /var/log/liquidsoap/phono.log

$ sudo chmod 777 /run/liquidsoap

$ sudo chown liquidsoap /etc/logrotate.d/liquidsoap

$ sudo chgrp liquidsoap /etc/logrotate.d/liquidsoap

$ sudo chown root /var/log/liquidsoap

$ sudo chgrp root /var/log/liquidsoap

$ sudo chown liquidsoap /var/log/liquidsoap/phono.log

$ sudo chgrp liquidsoap /var/log/liquidsoap/phono.log

$ sudo chown liquidsoap /var/run/liquidsoap

$ sudo chgrp liquidsoap /var/run/liquidsoap

Let’s test the script

$ /etc/liquidsoap/phono.liq

If everything went well, you should see a long list of prompts. Check with your browser, if Icecast is running properly “http://IP-ADDRESS:8000/phono

Now press CTRL-c to stop liquidsoap. This is what you have to do to start your script automatically.

Open rc.local:

$ sudo nano /etc/rc.local

Add the following before “exit 0”

chmod 777 /run/liquidsoap

/etc/init.d/liquidsoap start

Save the changes with CTRl-x, y

We are not completely done. Have to change the user to run liquidsoap properly as a daemon.

$ sudo nano /etc/init.d/liquidsoap

#change user and group to default Raspberry Pi user “pi” and group “pi”

user = pi

group = pi

Save changes with CTRl-x, y

Now enable autostart and reboot

$ sudo update-rc.d liquidsoap enable

$ sudo reboot

You should now be able to listen to your turntable Flac stream. Enjoy!

Some useful Internet sources

# Liquidsoap home


# Raspberry Pi + Liquidsoap + Icecast (in French)


# good step-by-step instructions


# how-to autostart programs on raspberry-pi (German)




  1. Pingback: Wireless Vinyl Streaming to Squeezebox | IOT-Solutions
  2. Denis · December 4, 2016

    Hi, thanks for your guide. I’ve been trying to reproduce your steps without success. Any chance you’ll be providing image of your raspberry pi card soon? I’m struggling to get liquidsoap to install on raspbian jessie.


  3. fontalamh · January 10, 2017

    Hi, thanks for this it is exactly what I’m looking for. I there any chance you could upload a text file of the script. WordPress has mangled it so cut and pastes won’t work. I’ve tried replicating it but it still doesn’t work but I’m not convinced all the characters are showing correctly.


    • IOT-Solutions · January 10, 2017

      I actually want to provide the full image for download sometime. Getting liquidsoap to work is tricky, the daemon is pretentious. Check the scripts again, but especially make sure that the ownership and access rights are all correct.


  4. fontalamh · January 10, 2017

    Thanks, it’s not to do with ownership nor access rights.
    I’ve decided just to try from scratch but for the sake of others for the script to work anyone using it will need to at least sort out the quotation marks which above show as left quotation marks, right quotation marks and the unicode description of a left quotation mark, ie:
    replace ” with ”
    replace “ with ”
    change url=”http://IP-ADDRESS”, to url=”http://IP-ADDRESS”,
    Of course wordpress might just stuff this up…


  5. fontalamh · January 10, 2017

    WordPress stuffed it up, interestingly correcting the characters after IP-ADDRESS itself!


  6. Martin · October 24

    Great! Thanks a lot for this How-to. I‘m far away from being a Linux nerd, but got it to work on a Raspi Zero with a 10 Euro USB sound card (with stereo line-in). As it grab the sound from a Wega Concept 51k headphone-out, I didn‘t need a pre-amp for the phono part.
    A hint for those that are despairing when testing the stream from the browser. Before every test, reload the page with Strg+F5 (I‘ve tested with Firefox). Failing to do so, at least in my case played „old“ sound fragments (songs that were played hours before) for some minutes.


  7. Jim Gooch · November 22

    Thanks for your howto. I got a Pi3 with USB sound card up and running using this as a means to stream output from my turntable to LMS. Works great.
    I wanted to also to record the output at the same time to WAV and have worked out how to modify your Liquidsoap script to do just this BUT as it stands output is recorded constantly even if nothing is playing.
    Ideally I’d like Liquidsoap to only output to WAV when there is something actually playing which looking at the Savonet documentation might be possible using the on_blank status but for the life of me I cannot get the syntax right. There is no example in the Cookbook that really tells me how to use it.
    Ideas anyone ?


  8. Ronnie · December 9

    Jim, would it be possible if you shared your configuration for WAV capture? I simply cannot get it to work right…



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s