Play music from a turntable with Kodi
It is possible to play the audio from a USB turntable by setting up a vlc server that streams the audio in a format that is supported by Kodi. It is not a very efficient approach but it is easy and works ok. The main downside is that it adds a significant delay in the sound.
To setup this configuration on OSMC proceed as follows:
First install vlc:
apt-get install vlc
Then create a streaming configuration file in /home/osmc/.vlm.conf
:
This file declares a source called lp
that is reading from the ALSA
snooping device connected to soundcard 1 (the card id has to be adapted to
the environment). The dsnoop
device is used instead of hw
because when
kodi closes the stream VLC doesn’t release immediately the soundcard, so
if one does play/stop/play quickly vlc would not be able to re-open the
soundcard at the second play.
Once the config file is in place setup vlc to start on system start by adding
the line below to /etc/rc.local
:
With this configuration anyone can connect to the vlc server so one can listen the turntable from a phone or laptop if they want. After changing this file the device must be rebooted.
The last step is to create a strm
file in a location accessible by Kodi.
For instance in /home/osmc/Music/Turntable.strm
put the following:
Now one can browse from the Kodi UI to the file and play it as if it was a normal media file. In the background vlc will start sending the data in 48khz raw PCM format the user presses stop in the UI.