2021-04-09 13:37:54 -04:00
# OwnTone (previously forked-daapd)
2009-06-12 06:15:52 -04:00
2021-04-09 13:37:54 -04:00
OwnTone is a Linux/FreeBSD DAAP (iTunes), MPD (Music Player Daemon) and
2015-06-22 15:57:41 -04:00
RSP (Roku) media server.
2014-03-11 18:20:29 -04:00
2018-04-02 16:10:31 -04:00
It supports AirPlay devices/speakers, Apple Remote (and compatibles),
2016-02-11 16:30:48 -05:00
MPD clients, Chromecast, network streaming, internet radio, Spotify and LastFM.
2016-04-18 16:09:22 -04:00
It does not support streaming video by AirPlay nor Chromecast.
2009-06-12 06:15:52 -04:00
2018-04-02 16:10:31 -04:00
DAAP stands for Digital Audio Access Protocol which is the protocol used
2009-06-12 06:15:52 -04:00
by iTunes and friends to share/stream media libraries over the network.
2021-04-09 13:37:54 -04:00
OwnTone was previously called forked-daapd, which again was a rewrite of
2021-04-01 16:03:34 -04:00
mt-daapd (Firefly Media Server).
2009-06-12 06:15:52 -04:00
2017-12-17 17:28:58 -05:00
## Looking for help?
2021-04-01 16:03:34 -04:00
Before you continue, make sure you know what version of OwnTone you have,
2017-12-17 17:28:58 -05:00
and what features it was built with (e.g. Spotify support).
2021-04-09 13:37:54 -04:00
How to find out? Go to the [web interface ](http://owntone.local:3689 ) and
2021-04-01 16:03:34 -04:00
check. No web interface? Then check the top of the log file (usually
2021-04-09 13:37:54 -04:00
/var/log/owntone.log).
2017-12-17 17:28:58 -05:00
Note that you are viewing a snapshot of the instructions that may or may not
2021-04-01 16:03:34 -04:00
match the version that you are using. Go to [references ](#references ) to find
instructions for previous versions.
2017-12-17 17:28:58 -05:00
2021-04-01 16:03:34 -04:00
If you are looking for help on building OwnTone (not using it), then
2020-06-13 17:50:32 -04:00
please see the [INSTALL.md ](INSTALL.md ) file.
2017-12-17 17:28:58 -05:00
## Contents
2014-03-11 18:20:29 -04:00
2014-12-28 04:12:08 -05:00
- [Getting started ](#getting-started )
- [Supported clients ](#supported-clients )
2017-12-17 17:28:58 -05:00
- [Web interface ](#web-interface )
2014-12-28 04:12:08 -05:00
- [Using Remote ](#using-remote )
- [AirPlay devices/speakers ](#airplay-devicesspeakers )
2016-02-11 16:30:48 -05:00
- [Chromecast ](#chromecast )
2016-09-28 16:30:25 -04:00
- [Local audio through ALSA ](#local-audio-through-alsa )
2016-09-28 16:34:09 -04:00
- [Local audio, Bluetooth and more through Pulseaudio ](#local-audio-bluetooth-and-more-through-pulseaudio )
- [MP3 network streaming (streaming to iOS) ](#mp3-network-streaming-streaming-to-ios )
2017-10-09 14:14:31 -04:00
- [Remote access ](#remote-access )
2014-12-28 04:12:08 -05:00
- [Supported formats ](#supported-formats )
- [Playlists and internet radio ](#playlists-and-internet-radio )
- [Artwork ](#artwork )
- [Library ](#library )
2017-12-17 17:28:58 -05:00
- [Command line ](#command-line )
2014-12-28 04:12:08 -05:00
- [Spotify ](#spotify )
- [LastFM ](#lastfm )
2014-12-31 04:06:59 -05:00
- [MPD clients ](#mpd-clients )
2021-11-25 16:11:59 -05:00
- [Running Multiple Instances ](#running-multiple-instances )
2016-04-18 16:09:22 -04:00
- [References ](#references )
2014-03-11 18:20:29 -04:00
2017-12-17 17:28:58 -05:00
2014-12-28 04:12:08 -05:00
## Getting started
2014-10-08 03:28:51 -04:00
2020-06-13 17:50:32 -04:00
After installation (see [INSTALL.md ](INSTALL.md )) do the following:
2014-10-08 03:28:51 -04:00
2021-04-09 13:37:54 -04:00
1. Edit the configuration file (usually `/etc/owntone.conf` ) to suit your
2014-10-08 03:28:51 -04:00
needs
2021-04-09 13:37:54 -04:00
2. Start or restart the server (usually `/etc/init.d/owntone restart` )
3. Go to the web interface [http://owntone.local:3689 ](http://owntone.local:3689 ),
2017-12-17 17:28:58 -05:00
or, if that won't work, to [http://[your_server_address_here]:3689](http://[your_server_address_here]:3689)
4. Wait for the library scan to complete
5. If you will be using a remote, e.g. Apple Remote: Start the remote, go to
Settings, Add Library
6. Enter the pair code in the web interface (update the page with F5 if it does
not automatically pick up the pairing request)
2014-10-08 03:28:51 -04:00
2014-12-28 04:12:08 -05:00
## Supported clients
2009-06-12 06:15:52 -04:00
2021-04-01 16:03:34 -04:00
OwnTone supports these kinds of clients:
2014-02-07 16:10:40 -05:00
2014-03-12 05:48:53 -04:00
- DAAP clients, like iTunes or Rhythmbox
- Remote clients, like Apple Remote or compatibles for Android/Windows Phone
- AirPlay devices, like AirPort Express, Shairport and various AirPlay speakers
2016-02-11 16:30:48 -05:00
- Chromecast devices
2015-05-10 08:54:22 -04:00
- MPD clients, like mpc (see [mpd-clients ](#mpd-clients ))
2015-10-09 17:58:27 -04:00
- MP3 network stream clients, like VLC and almost any other music player
- RSP clients, like Roku Soundbridge
2014-02-07 16:10:40 -05:00
2021-04-01 16:03:34 -04:00
Like iTunes, you can control OwnTone with Remote and stream your music to
AirPlay devices.
2009-06-12 06:15:52 -04:00
2021-04-01 16:03:34 -04:00
A single OwnTone instance can handle several clients concurrently, regardless of
the protocol.
2009-06-12 06:15:52 -04:00
2017-12-17 17:28:58 -05:00
By default all clients on 192.168.* (and the ipv6 equivalent) are allowed to
connect without authentication. You can change that in the configuration file.
2014-03-12 05:48:53 -04:00
Here is a list of working and non-working DAAP and Remote clients. The list is
probably obsolete when you read it :-)
2018-06-17 16:57:03 -04:00
| Client | Developer | Type | Platform | Working (vers.) |
| ------------------------ | ----------- | ------ | ------------- | --------------- |
2019-10-20 08:53:22 -04:00
| iTunes | Apple | DAAP | Win | Yes (12.10.1) |
2019-11-01 18:51:05 -04:00
| Apple Music | Apple | DAAP | MacOS | Yes |
2018-06-17 16:57:03 -04:00
| Rhythmbox | Gnome | DAAP | Linux | Yes |
| Diapente | diapente | DAAP | Android | Yes |
| WinAmp DAAPClient | WardFamily | DAAP | WinAmp | Yes |
| Amarok w/DAAP plugin | KDE | DAAP | Linux/Win | Yes (2.8.0) |
| Banshee | | DAAP | Linux/Win/OSX | No (2.6.2) |
| jtunes4 | | DAAP | Java | No |
| Firefly Client | | (DAAP) | Java | No |
| Remote | Apple | Remote | iOS | Yes (4.3) |
| Retune | SquallyDoc | Remote | Android | Yes (3.5.23) |
| TunesRemote+ | Melloware | Remote | Android | Yes (2.5.3) |
| Remote for iTunes | Hyperfine | Remote | Android | Yes |
| Remote for Windows Phone | Komodex | Remote | Windows Phone | Yes (2.2.1.0) |
| TunesRemote SE | | Remote | Java | Yes (r108) |
| rtRemote for Windows | bizmodeller | Remote | Windows | Yes (1.2.0.67) |
2014-03-12 05:48:53 -04:00
2017-12-17 17:28:58 -05:00
## Web interface
2009-06-12 06:15:52 -04:00
2021-04-09 13:37:54 -04:00
You can find the web interface at [http://owntone.local:3689 ](http://owntone.local:3689 )
2017-12-17 17:28:58 -05:00
or alternatively at [http://[your_server_address_here]:3689](http://[your_server_address_here]:3689).
2010-01-17 05:16:17 -05:00
2018-06-05 17:04:34 -04:00
Use the web interface to control playback, trigger manual library rescans, pair
with remotes, select speakers, authenticate with Spotify, etc.
2017-07-21 13:19:16 -04:00
2021-03-29 10:14:22 -04:00
You can find some screenshots and build instructions in [README_PLAYER_WEBINTERFACE.md ](https://github.com/owntone/owntone-server/blob/master/README_PLAYER_WEBINTERFACE.md ).
2016-01-11 15:02:12 -05:00
2017-12-17 17:28:58 -05:00
## Using Remote
2016-01-11 15:02:12 -05:00
2017-12-17 17:28:58 -05:00
Remote gets a list of output devices from the server; this list includes any
and all devices on the network we know of that advertise AirPlay: AirPort
Express, Apple TV, ... It also includes the local audio output, that is, the
sound card on the server (even if there is no soundcard).
2016-01-11 15:02:12 -05:00
2021-04-01 16:03:34 -04:00
OwnTone remembers your selection and the individual volume for each
2017-12-17 17:28:58 -05:00
output device; selected devices will be automatically re-selected, except if
they return online during playback.
2017-03-25 06:25:30 -04:00
2017-12-17 17:28:58 -05:00
### Pairing
2013-12-21 12:24:48 -05:00
2021-04-09 13:37:54 -04:00
1. Open the [web interface ](http://owntone.local:3689 )
2014-01-09 16:58:58 -05:00
2. Start Remote, go to Settings, Add Library
2017-12-17 17:28:58 -05:00
3. Enter the pair code in the web interface (update the page with F5 if it does
not automatically pick up the pairing request)
2021-04-01 16:03:34 -04:00
If Remote doesn't connect to OwnTone after you entered the pairing code
2017-12-17 17:28:58 -05:00
something went wrong. Check the log file to see the error message. Here are
some common reasons:
2015-03-06 16:02:56 -05:00
2017-06-14 17:59:10 -04:00
#### You did not enter the correct pairing code
2015-03-06 16:02:56 -05:00
You will see an error in the log about pairing failure with a HTTP response code
2015-10-09 17:58:27 -04:00
that is *not* 0.
2017-12-17 17:28:58 -05:00
Solution: Try again.
2015-03-06 16:02:56 -05:00
#### No response from Remote, possibly a network issue
2015-05-19 16:02:45 -04:00
If you see an error in the log with either:
- a HTTP response code that is 0
- "Empty pairing request callback"
2021-04-01 16:03:34 -04:00
it means that OwnTone could not establish a connection to Remote. This
2017-04-22 17:52:22 -04:00
might be a network issue, your router may not be allowing multicast between the
2021-04-01 16:03:34 -04:00
Remote device and the host OwnTone is running on.
2017-04-22 17:52:22 -04:00
Solution 1: Sometimes it resolves the issue if you force Remote to quit, restart
2015-10-09 17:58:27 -04:00
it and do the pairing proces again. Another trick is to establish some other
connection (eg SSH) from the iPod/iPhone/iPad to the host.
2017-04-22 17:52:22 -04:00
Solution 2: Check your router settings if you can whitelist multicast addresses
under IGMP settings. For Apple Bonjour, setting a multicast address of
224.0.0.251 and a netmask of 255.255.255.255 should work.
2015-10-09 17:58:27 -04:00
Otherwise try using avahi-browse for troubleshooting:
2014-12-28 04:12:08 -05:00
- in a terminal, run `avahi-browse -r -k _touch-remote._tcp`
2013-12-21 12:24:48 -05:00
- start Remote, goto Settings, Add Library
2010-01-17 05:16:17 -05:00
- after a couple seconds at most, you should get something similar to this:
2014-12-28 04:12:08 -05:00
```
2010-01-17 05:16:17 -05:00
+ ath0 IPv4 59eff13ea2f98dbbef6c162f9df71b784a3ef9a3 _touch-remote._tcp local
= ath0 IPv4 59eff13ea2f98dbbef6c162f9df71b784a3ef9a3 _touch-remote._tcp local
hostname = [Foobar.local]
address = [192.168.1.1]
port = [49160]
txt = ["DvTy=iPod touch" "RemN=Remote" "txtvers=1" "RemV=10000" "Pair=FAEA410630AEC05E" "DvNm=Foobar"]
2014-12-28 04:12:08 -05:00
```
2010-01-17 05:16:17 -05:00
Hit Ctrl-C to terminate avahi-browse.
2017-06-14 17:59:10 -04:00
To check for network issues you can try to connect to address and port with
telnet.
2015-03-06 16:02:56 -05:00
2010-01-17 05:16:17 -05:00
2014-12-28 04:12:08 -05:00
## AirPlay devices/speakers
2010-05-02 09:48:53 -04:00
2021-04-01 16:03:34 -04:00
OwnTone will discover the AirPlay devices available on your network. For
2014-02-07 16:10:40 -05:00
devices that are password-protected, the device's AirPlay name and password
2010-05-02 09:48:53 -04:00
must be given in the configuration file. See the sample configuration file
for the syntax.
2017-06-19 16:15:48 -04:00
If your Apple TV requires device verification (always required by Apple TV4 with
2020-11-18 14:11:07 -05:00
tvOS 10.2) then you can do that through Settings > Remotes & Outputs in the web
interface: Select the device and then enter the PIN that the Apple TV displays.
2017-06-19 16:15:48 -04:00
2020-05-11 10:25:13 -04:00
If your speaker is silent when you start playback, and there is no obvious error
message in the log, you can try disabling ipv6 in the config. Some speakers
announce that they support ipv6, but in fact don't (at least not with forked-
daapd).
2020-11-18 14:11:07 -05:00
If the speaker becomes unselected when you start playback, and you in the log
see "ANNOUNCE request failed in session startup: 400 Bad Request", then try
the Apple Home app > Allow Speakers & TV Access > Anyone On the Same Network
(or Everyone).
2010-05-02 09:48:53 -04:00
2016-02-11 16:30:48 -05:00
## Chromecast
2021-04-01 16:03:34 -04:00
OwnTone will discover Chromecast devices available on your network, and you
2019-07-10 08:57:40 -04:00
can then select the device as a speaker. There is no configuration required.
2016-02-11 16:30:48 -05:00
2016-09-28 16:30:25 -04:00
## Local audio through ALSA
In the config file, you can select ALSA for local audio. This is the default.
When using ALSA, the server will try to syncronize playback with AirPlay. You
can adjust the syncronization in the config file.
2016-02-11 16:30:48 -05:00
2020-01-03 04:06:58 -05:00
For most setups the default values in the config file should work. If they
2021-03-29 10:14:22 -04:00
don't, there is help here: [README_ALSA.md ](https://github.com/owntone/owntone-server/blob/master/README_ALSA.md )
2020-01-03 04:06:58 -05:00
2010-05-02 09:48:53 -04:00
2016-09-28 16:30:25 -04:00
## Local audio, Bluetooth and more through Pulseaudio
2016-08-25 16:44:28 -04:00
2016-09-28 16:30:25 -04:00
In the config file, you can select Pulseaudio for local audio. In addition to
local audio, Pulseaudio also supports an array of other targets, e.g. Bluetooth
or DLNA. However, Pulseaudio does require some setup, so here is a separate page
2021-03-29 10:14:22 -04:00
with some help on that: [README_PULSE.md ](https://github.com/owntone/owntone-server/blob/master/README_PULSE.md )
2010-05-02 09:48:53 -04:00
2016-09-28 16:30:25 -04:00
Note that if you select Pulseaudio the "card" setting in the config file has
no effect. Instead all soundcards detected by Pulseaudio will be listed as
2021-04-01 16:03:34 -04:00
speakers by OwnTone.
2016-09-02 16:41:52 -04:00
2016-10-07 16:35:04 -04:00
You can adjust the latency of Pulseaudio playback in the config file.
2010-05-02 09:48:53 -04:00
2015-10-09 17:58:27 -04:00
## MP3 network streaming (streaming to iOS)
2021-04-01 16:03:34 -04:00
You can listen to audio being played by OwnTone by opening this network
2015-10-09 17:58:27 -04:00
stream address in pretty much any music player:
http://[your hostname/ip address]:3689/stream.mp3
This is currently the only way of listening to your audio on iOS devices, since
Apple does not allow AirPlay receiver apps, and because Apple Home Sharing
2021-04-01 16:03:34 -04:00
cannot be supported by OwnTone. So what you can do instead is install a
2015-10-09 17:58:27 -04:00
music player app like VLC, connect to the stream and control playback with
2020-05-28 11:29:38 -04:00
Remote.
2015-10-09 17:58:27 -04:00
Note that MP3 encoding must be supported by ffmpeg/libav for this to work. If
it is not available you will see a message in the log file. In Debian/Ubuntu you
get MP3 encoding support by installing the package "libavcodec-extra".
2017-12-17 17:28:58 -05:00
2017-10-09 14:14:31 -04:00
## Remote access
2017-12-17 17:28:58 -05:00
It is possible to access a shared library over the internet from a DAAP client
like iTunes. You must have remote access to the host machine.
2017-10-09 14:14:31 -04:00
2017-12-17 17:28:58 -05:00
First log in to the host and forward port 3689 to your local machine. You now
need to broadcast the daap service to iTunes on your local machine. On macOS the
command is:
2017-10-09 14:14:31 -04:00
```
dns-sd -P iTunesServer _daap._tcp local 3689 localhost.local 127.0.0.1 "ffid=12345"
```
The `ffid` key is required but its value does not matter.
Your library will now appear as 'iTunesServer' in iTunes.
2015-10-09 17:58:27 -04:00
2021-06-06 16:51:57 -04:00
You can also access your library remotely using something like Zerotier. See [this
guide](https://github.com/owntone/owntone-server/wiki/Accessing-Owntone-remotely-through-iTunes-Music-with-Zerotier)
for details.
2017-12-17 17:28:58 -05:00
2014-12-28 04:12:08 -05:00
## Supported formats
2009-06-12 06:15:52 -04:00
2021-04-01 16:03:34 -04:00
OwnTone should support pretty much all audio formats. It relies on libav
2015-10-09 17:58:27 -04:00
(or ffmpeg) to extract metadata and decode the files on the fly when the client
2011-06-02 15:07:53 -04:00
doesn't support the format.
2009-06-12 06:15:52 -04:00
Formats are attributed a code, so any new format will need to be explicitely
added. Currently supported:
- MPEG4: mp4a, mp4v
- AAC: alac
- MP3 (and friends): mpeg
- FLAC: flac
- OGG VORBIS: ogg
- Musepack: mpc
- WMA: wma (WMA Pro), wmal (WMA Lossless), wmav (WMA video)
- AIFF: aif
- WAV: wav
2016-05-09 14:40:47 -04:00
- Monkey's audio: ape
2009-06-12 06:15:52 -04:00
2014-12-28 04:12:08 -05:00
## Playlists and internet radio
2009-06-12 06:15:52 -04:00
2021-04-01 16:03:34 -04:00
OwnTone supports M3U and PLS playlists. Just drop your playlist somewhere
2014-08-27 15:57:16 -04:00
in your library with an .m3u or .pls extension and it will pick it up.
2009-06-12 06:15:52 -04:00
2014-08-27 15:57:16 -04:00
If the playlist contains an http URL it will be added as an internet radio
2015-04-12 11:27:19 -04:00
station, and the URL will be probed for Shoutcast (ICY) metadata. If the radio
2021-04-01 16:03:34 -04:00
station provides artwork, OwnTone will download it during playback and send
2015-04-12 11:27:19 -04:00
it to any remotes or AirPlay devices requesting it.
2014-08-27 15:57:16 -04:00
2015-04-12 11:27:19 -04:00
Instead of downloading M3U's from your radio stations, you can also make an
empty M3U file and in it insert links to the M3U's of your radio stations.
2014-03-11 18:20:29 -04:00
2021-04-01 16:03:34 -04:00
Radio streams can only be played by OwnTone, so that means they will not be
2020-04-12 14:04:44 -04:00
available to play in DAAP clients like iTunes.
2009-11-28 05:01:22 -05:00
Support for iTunes Music Library XML format is available as a compile-time
option. By default, metadata from our parsers is preferred over what's in
the iTunes DB; use itunes_overrides = true if you prefer iTunes' metadata.
2021-04-01 16:03:34 -04:00
OwnTone has support for smart playlists. How to create a smart playlist is
2015-10-19 14:56:35 -04:00
documented in
2021-03-29 10:14:22 -04:00
[README_SMARTPL.md ](https://github.com/owntone/owntone-server/blob/master/README_SMARTPL.md ).
2009-06-12 06:15:52 -04:00
2021-04-01 16:03:34 -04:00
If you're not satisfied with internet radio metadata that OwnTone shows,
2020-05-17 17:51:02 -04:00
then you can read about tweaking it in
2021-03-29 10:14:22 -04:00
[README_RADIO_STREAMS.md ](https://github.com/owntone/owntone-server/blob/master/README_RADIO_STREAMS.md ).
2020-05-17 17:51:02 -04:00
2009-06-12 06:15:52 -04:00
2014-12-28 04:12:08 -05:00
## Artwork
2010-03-07 10:10:04 -05:00
2021-04-01 16:03:34 -04:00
OwnTone has support for PNG and JPEG artwork which is either:
2015-10-19 14:56:35 -04:00
- embedded in the media files
- placed as separate image files in the library
- made available online by the radio station
2010-03-07 10:10:04 -05:00
2021-04-01 16:03:34 -04:00
For media in your library, OwnTone will try to locate album and artist
2015-10-19 14:56:35 -04:00
artwork (group artwork) by the following procedure:
2013-10-22 15:19:11 -04:00
- if a file {artwork,cover,Folder}.{png,jpg} is found in one of the directories
2010-10-24 12:48:55 -04:00
containing files that are part of the group, it is used as the artwork. The
first file found is used, ordering is not guaranteed;
2013-07-14 14:54:23 -04:00
- failing that, if [directory name].{png,jpg} is found in one of the
directories containing files that are part of the group, it is used as the
artwork. The first file found is used, ordering is not guaranteed;
2014-12-14 02:37:30 -05:00
- failing that, individual files are examined and the first file found
with an embedded artwork is used. Here again, ordering is not guaranteed.
2013-10-22 15:19:11 -04:00
{artwork,cover,Folder} are the default, you can add other base names in the
2015-10-19 14:56:35 -04:00
configuration file. Here you can also enable/disable support for individual
file artwork (instead of using the same artwork for all tracks in an entire
album).
2013-07-14 14:54:23 -04:00
2017-01-06 13:49:09 -05:00
For playlists in your library, say /foo/bar.m3u, then for any http streams in
2021-04-01 16:03:34 -04:00
the list, OwnTone will look for /foo/bar.{jpg,png}.
2017-01-06 13:49:09 -05:00
2016-04-18 16:09:22 -04:00
You can use symlinks for the artwork files.
2010-03-07 10:10:04 -05:00
2021-04-01 16:03:34 -04:00
OwnTone caches artwork in a separate cache file. The default path is
2021-04-09 13:37:54 -04:00
`/var/cache/owntone/cache.db` and can be configured in the configuration
2014-12-14 02:37:30 -05:00
file. The cache.db file can be deleted without losing the library and pairing
informations.
2010-03-07 10:10:04 -05:00
2017-12-17 17:28:58 -05:00
2014-12-28 04:12:08 -05:00
## Library
2009-06-12 06:15:52 -04:00
2014-05-13 16:01:58 -04:00
The library is scanned in bulk mode at startup, but the server will be available
even while this scan is in progress. You can follow the progress of the scan in
2017-12-17 17:28:58 -05:00
the log file or via the web interface. When the scan is complete you will see
the log message: "Bulk library scan completed in X sec".
2009-06-12 06:15:52 -04:00
2016-01-11 15:02:12 -05:00
The very first scan will take longer than subsequent startup scans, since every
file gets analyzed. At the following startups the server looks for changed files
and only analyzis those.
2013-11-29 16:48:53 -05:00
2017-12-17 17:28:58 -05:00
Updates to the library are reflected in real time after the initial scan, so you
do not need to manually start rescans. The directories are monitored for changes
and rescanned on the fly. Note that if you have your library on a network mount
then real time updating may not work. Read below about what to do in that case.
2013-12-21 12:24:48 -05:00
If you change any of the directory settings in the library section of the
configuration file a rescan is required before the new setting will take effect.
2017-12-17 17:28:58 -05:00
You can do this by using "Update library" from the web interface.
2013-12-21 12:24:48 -05:00
2017-01-29 16:09:28 -05:00
Symlinks are supported and dereferenced, but it is best to use them for
directories only.
2015-10-09 17:58:27 -04:00
2017-01-29 16:09:28 -05:00
### Pipes (for e.g. multiroom with Shairport-sync)
2009-06-12 06:15:52 -04:00
2017-01-29 16:09:28 -05:00
Some programs, like for instance Shairport-sync, can be configured to output
2021-04-01 16:03:34 -04:00
audio to a named pipe. If this pipe is placed in the library, OwnTone will
2017-01-29 16:09:28 -05:00
automatically detect that it is there, and when there is audio being written to
it, playback of the audio will be autostarted (and stopped).
2009-06-12 06:15:52 -04:00
2021-04-01 16:03:34 -04:00
Using this feature, OwnTone can act as an AirPlay multiroom "router": You can
have an AirPlay source (e.g. your iPhone) send audio Shairport-sync, which
forwards it to OwnTone through the pipe, which then plays it on whatever
2017-01-29 16:09:28 -05:00
speakers you have selected (through Remote).
2014-03-11 18:20:29 -04:00
2017-01-29 16:09:28 -05:00
The format of the audio being written to the pipe must be PCM16.
2014-04-01 18:02:48 -04:00
2017-01-29 16:09:28 -05:00
You can also start playback of pipes manually. You will find them in remotes
listed under "Unknown artist" and "Unknown album". The track title will be the
name of the pipe.
2021-04-01 16:03:34 -04:00
Shairport-sync can write metadata to a pipe, and OwnTone can read this.
2017-01-29 16:09:28 -05:00
This requires that the metadata pipe has the same filename as the audio pipe
plus a ".metadata" suffix. Say Shairport-sync is configured to write audio to
"/foo/bar/pipe", then the metadata pipe should be "/foo/bar/pipe.metadata".
2014-04-01 18:02:48 -04:00
2014-12-28 04:12:08 -05:00
### Libraries on network mounts
2014-05-13 16:01:58 -04:00
Most network filesharing protocols do not offer notifications when the library
2021-04-01 16:03:34 -04:00
is changed. So that means OwnTone cannot update its database in real time.
2014-05-13 16:01:58 -04:00
Instead you can schedule a cron job to update the database.
The first step in doing this is to add two entries to the 'directories'
2021-04-09 13:37:54 -04:00
configuration item in owntone.conf:
2014-05-13 16:01:58 -04:00
2014-12-28 04:12:08 -05:00
```
2014-05-15 18:02:33 -04:00
directories = { "/some/local/dir", "/your/network/mount/library" }
2014-12-28 04:12:08 -05:00
```
2014-05-13 16:01:58 -04:00
Now you can make a cron job that runs this command:
2014-12-28 04:12:08 -05:00
```
2014-05-13 16:01:58 -04:00
touch /some/local/dir/trigger.init-rescan
2014-12-28 04:12:08 -05:00
```
2014-05-13 16:01:58 -04:00
2021-04-01 16:03:34 -04:00
When OwnTone detects a file with filename ending .init-rescan it will
2014-05-13 16:01:58 -04:00
perform a bulk scan similar to the startup scan.
2019-06-08 10:10:55 -04:00
Alternatively, you can force a metadata scan of the library even if the
files have not changed by creating a filename ending `.meta-rescan` .
2014-05-13 16:01:58 -04:00
2014-12-28 04:12:08 -05:00
### Troubleshooting library issues
2014-05-13 16:01:58 -04:00
If you place a file with the filename ending .full-rescan in your library,
you can trigger a full rescan of your library. This will clear all music and
2021-04-01 16:03:34 -04:00
playlists from OwnTone's database and initiate a fresh bulk scan. Pairing
2014-05-13 16:01:58 -04:00
and speaker information will be kept. Only use this for troubleshooting, it is
not necessary during normal operation.
2017-12-17 17:28:58 -05:00
## Command line
You can choose between:
2014-05-13 16:01:58 -04:00
2017-12-17 17:28:58 -05:00
- a [MPD command line client ](#mpd-clients ) (easiest) like `mpc`
2021-04-01 16:03:34 -04:00
- curl with OwnTone's JSON API (see [README_JSON_API.md ](https://github.com/owntone/owntone-server/blob/master/README_JSON_API.md ))
2017-12-17 17:28:58 -05:00
- curl with DAAP/DACP commands (hardest)
2014-04-01 18:02:48 -04:00
2017-12-17 17:28:58 -05:00
Here is an example of how to use curl with DAAP/DACP. Say you have a playlist
with a radio station, and you want to make a script that starts playback of that
station:
2014-04-01 18:02:48 -04:00
2021-04-01 16:03:34 -04:00
1. Run `sqlite3 [your OwnTone db]` . Use `select id,title from files` to get
2017-12-17 17:28:58 -05:00
the id of the radio station, and use `select id,title from playlists` to get
2015-10-09 17:58:27 -04:00
the id of the playlist.
2014-04-01 18:02:48 -04:00
2. Convert the two ids to hex.
3. Put the following lines in the script with the relevant ids inserted (also
2014-12-28 04:12:08 -05:00
observe that you must use a session-id < 100 , and that you must login and
logout):
2014-04-01 18:02:48 -04:00
2014-12-28 04:12:08 -05:00
```
2014-04-01 18:02:48 -04:00
curl "http://localhost:3689/login?pairing-guid=0x1& request-session-id=50"
curl "http://localhost:3689/ctrl-int/1/playspec?database-spec='dmap.persistentid:0x1'& container-spec='dmap.persistentid:0x[PLAYLIST-ID]'& container-item-spec='dmap.containeritemid:0x[FILE ID]'& session-id=50"
curl "http://localhost:3689/logout?session-id=50"
2014-12-28 04:12:08 -05:00
```
2014-04-01 18:02:48 -04:00
2014-03-11 18:20:29 -04:00
2014-12-28 04:12:08 -05:00
## Spotify
2014-03-11 18:20:29 -04:00
2021-05-31 17:25:12 -04:00
OwnTone has built-in support for playback of the tracks in your Spotify library.
You must have a Spotify premium account. If you normally log into Spotify with
your Facebook account you must first go to Spotify's web site where you can get
the Spotify username and password that matches your account.
You must also make sure that your browser can reach OwnTone's web interface via
the address [http://owntone.local:3689 ](http://owntone.local:3689 ). Try it right
now! That is where Spotify's OAuth page will redirect your browser with the
token that OwnTone needs, so it must work. The address is announced by the
server via mDNS, but if that for some reason doesn't work then configure it via
router or .hosts file. You can remove it again after completing the login.
To authorize OwnTone, open the web interface, locate Settings > Online Services
and then click the Authorize button. You will then be sent to Spotify's
authorization service, which will send you back to the web interface after
you have given the authorization.
2021-03-07 09:54:47 -05:00
2021-05-31 17:25:12 -04:00
Spotify no longer automatically notifies clients about library updates, so you
2020-02-08 04:42:12 -05:00
have to trigger updates manually. You can for instance set up a cron job that
runs `/usr/bin/curl http://localhost:3689/api/update`
2014-03-11 18:20:29 -04:00
2021-05-31 17:25:12 -04:00
To logout and remove Spotify tracks + credentials make a request to
[http://[your_server_address_here]:3689/api/spotify-logout](http://[your_server_address_here]:3689/api/spotify-logout).
2016-09-07 13:19:28 -04:00
2016-11-27 14:21:56 -05:00
Limitations:
2021-04-01 16:03:34 -04:00
You will not be able to do any playlist management through OwnTone - use
2014-03-11 18:20:29 -04:00
a Spotify client for that. You also can only listen to your music by letting
2021-04-01 16:03:34 -04:00
OwnTone do the playback - so that means you can't stream to DAAP clients (e.g.
iTunes) and RSP clients.
2014-08-15 17:36:54 -04:00
2021-03-07 09:54:47 -05:00
### Via librespot/spocon
2021-04-01 16:03:34 -04:00
You can also use OwnTone with one of the various incarnations of
2021-03-07 09:54:47 -05:00
[librespot ](https://github.com/librespot-org/librespot ). This adds librespot as
a selectable metaspeaker in Spotify's client, and when you start playback,
librespot can be configured to start writing audio to a pipe that you have added
2021-04-01 16:03:34 -04:00
to your library. This will be detected by OwnTone that then starts playback.
You can also have a pipe for metadata and playback events, e.g. volume changes.
2021-03-07 09:54:47 -05:00
The easiest way of accomplishing this may be with [Spocon ](https://github.com/spocon/spocon ),
since it requires minimal configuration. After installing, create two pipes
(with mkfifo) and set the configuration in the player section:
```
# Audio output device (MIXER, PIPE, STDOUT)
output = "PIPE"
# Output raw (signed) PCM to this file (`player.output` must be PIPE)
pipe = "/srv/music/spotify"
# Output metadata in Shairport Sync format (https://github.com/mikebrady/shairport-sync-metadata-reader)
metadataPipe = "/srv/music/spotify.metadata"
```
2021-05-31 17:25:12 -04:00
### Via libspotify
This method is being deprecated, but is still available if the server was built
with it, libspotify is installed and `use_libspotify` is enabled in the config
file. Please consult [previous README versions ](#references ) for details on
using libspotify.
2014-08-15 17:36:54 -04:00
2014-12-28 04:12:08 -05:00
## LastFM
2014-08-15 17:36:54 -04:00
2021-04-01 16:03:34 -04:00
You can have OwnTone scrobble the music you listen to. To set up scrobbling
go to the web interface and authorize OwnTone with your LastFM credentials.
2014-08-15 17:36:54 -04:00
2021-04-01 16:03:34 -04:00
OwnTone will not store your LastFM username/password, only the session key.
2017-12-17 17:28:58 -05:00
The session key does not expire.
2014-12-31 04:06:59 -05:00
2016-04-18 16:09:22 -04:00
2014-12-31 04:06:59 -05:00
## MPD clients
2016-04-18 16:09:22 -04:00
2021-04-01 16:03:34 -04:00
You can - to some extent - use clients for MPD to control OwnTone.
2017-12-17 17:28:58 -05:00
2021-04-01 16:03:34 -04:00
By default OwnTone listens on port 6600 for MPD clients. You can change
2015-10-19 14:56:35 -04:00
this in the configuration file.
2014-12-31 04:06:59 -05:00
Currently only a subset of the commands offered by MPD (see [MPD protocol documentation ](http://www.musicpd.org/doc/protocol/ ))
2021-04-01 16:03:34 -04:00
are supported.
2014-12-31 04:06:59 -05:00
2021-04-01 16:03:34 -04:00
Due to some differences between OwnTone and MPD not all commands will act the
same way they would running MPD:
2014-12-31 04:06:59 -05:00
2017-06-21 15:49:39 -04:00
- crossfade, mixrampdb, mixrampdelay and replaygain will have no effect
2021-04-01 16:03:34 -04:00
- single, repeat: unlike MPD, OwnTone does not support setting single and repeat separately
2014-12-31 04:06:59 -05:00
on/off, instead repeat off, repeat all and repeat single are supported. Thus setting single on
will result in repeat single, repeat on results in repeat all.
2017-12-17 17:28:58 -05:00
The following table shows what is working for a selection of MPD clients:
2014-12-31 04:06:59 -05:00
| Client | Type | Status |
| --------------------------------------------- | ------ | --------------- |
2015-04-24 23:40:04 -04:00
| [mpc ](http://www.musicpd.org/clients/mpc/ ) | CLI | Working commands: mpc, add, crop, current, del (ranges are not yet supported), play, next, prev (behaves like cdprev), pause, toggle, cdprev, seek, clear, outputs, enable, disable, playlist, ls, load, volume, repeat, random, single, search, find, list, update (initiates an init-rescan, the path argument is not supported) |
| [ympd ](http://www.ympd.org/ ) | Web | Everything except "add stream" should work |
2014-12-31 04:06:59 -05:00
2021-11-25 16:11:59 -05:00
## Running Multiple Instances
To run multiple instances of owntone on a server, you should copy
`/etc/owntone.conf` to `/etc/owntone-zone.conf` (for each `zone` ) and
modify the following to be unique across all instances:
* the three port settings (`general` -> `websocket_port` ,
`library` -> `port` , and `mpd` -> `port` )
* the database paths (`general` -> `db_path` , `db_backup_path` , and `db_cache_path` )
* the service name (`library` -> `name` ).
* you probably also want to disable local output (set `audio` -> `type =
"disabled"`).
Then run `owntone -c /etc/owntone-zone.conf` to run owntone with the new
zone configuration.
Owntone has a `systemd` template which lets you run this automatically
on systems that use systemd. You can start or enable the service for
a `zone` by `sudo systemctl start owntone@zone` and check that it is
running with `sudo systemctl status owntone@zone` . Use `sudo
systemctl enable ownton@zone` to get the service to start on reboot.
2014-12-31 04:06:59 -05:00
2016-04-18 16:09:22 -04:00
## References
2021-04-01 16:03:34 -04:00
The source for this version of OwnTone can be found here:
2014-12-31 04:06:59 -05:00
2021-03-29 10:14:22 -04:00
[https://github.com/owntone/owntone-server.git ](https://github.com/owntone/owntone-server.git )
2014-12-31 04:06:59 -05:00
2021-05-21 12:53:53 -04:00
README's for current and previous versions of OwnTone:
2021-09-02 14:11:56 -04:00
[OwnTone version 28.2 ](https://github.com/owntone/owntone-server/blob/28.2/README.md )
2021-05-21 17:44:44 -04:00
[OwnTone version 28.1 ](https://github.com/owntone/owntone-server/blob/28.1/README.md )
2021-05-21 12:53:53 -04:00
Older versions from when OwnTone was forked-daapd:
2017-12-17 17:28:58 -05:00
2021-03-29 10:14:22 -04:00
[forked-daapd version 27.4 ](https://github.com/owntone/owntone-server/blob/27.4/README.md )
2021-03-12 13:51:22 -05:00
2021-03-29 10:14:22 -04:00
[forked-daapd version 27.2 ](https://github.com/owntone/owntone-server/blob/27.2/README.md )
2020-07-23 18:48:05 -04:00
2021-03-29 10:14:22 -04:00
[forked-daapd version 27.1 ](https://github.com/owntone/owntone-server/blob/27.1/README.md )
2020-01-29 15:08:21 -05:00
2021-03-29 10:14:22 -04:00
[forked-daapd version 27.0 ](https://github.com/owntone/owntone-server/blob/27.0/README.md )
2019-11-20 14:32:26 -05:00
2021-03-29 10:14:22 -04:00
[forked-daapd version 26.5 ](https://github.com/owntone/owntone-server/blob/26.5/README.md )
2019-03-17 17:52:06 -04:00
2021-03-29 10:14:22 -04:00
[forked-daapd version 26.4 ](https://github.com/owntone/owntone-server/blob/26.4/README.md )
2018-09-30 17:13:18 -04:00
2021-03-29 10:14:22 -04:00
[forked-daapd version 26.3 ](https://github.com/owntone/owntone-server/blob/26.3/README.md )
2018-09-08 10:50:33 -04:00
2021-03-29 10:14:22 -04:00
[forked-daapd version 26.2 ](https://github.com/owntone/owntone-server/blob/26.2/README.md )
2018-06-16 15:56:10 -04:00
2021-03-29 10:14:22 -04:00
[forked-daapd version 26.1 ](https://github.com/owntone/owntone-server/blob/26.1/README.md )
2018-06-08 18:22:10 -04:00
2021-03-29 10:14:22 -04:00
[forked-daapd version 26.0 ](https://github.com/owntone/owntone-server/blob/26.0/README.md )
2018-02-24 10:45:05 -05:00
2021-03-29 10:14:22 -04:00
[forked-daapd version 25.0 ](https://github.com/owntone/owntone-server/blob/25.0/README.md )
2017-12-17 17:28:58 -05:00
2021-03-29 10:14:22 -04:00
[forked-daapd version 24.2 ](https://github.com/owntone/owntone-server/blob/24.2/README.md )
2017-12-17 17:28:58 -05:00
2021-03-29 10:14:22 -04:00
[forked-daapd version 24.1 ](https://github.com/owntone/owntone-server/blob/24.1/README.md )