owntone-server/search/search_index.json

1 line
195 KiB
JSON

{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"OwnTone","text":"<p>OwnTone is an open source (audio) media server for GNU/Linux, FreeBSD and macOS.</p> <p>It allows sharing and streaming your media library to iTunes (DAAP<sup>1</sup>), Roku (RSP), AirPlay devices (multi-room), Chromecast and also supports local playback.</p> <p>You can control OwnTone via its web interface, Apple Remote (and compatible DAAP/DACP clients), MPD clients or via its JSON API.</p> <p>Besides serving your local music, podcast and audiobook media files, OwnTone supports internet radios and Spotify (requires Spotify premium account).</p> <p>Prior to version 28, OwnTone was called forked-daapd, which again was a rewrite of mt-daapd (Firefly Media Server).</p> <p>OwnTone is written in C with a web interface written in Vue.js.</p>"},{"location":"#features","title":"Features","text":"<ul> <li>Stream to AirPlay (synchronized multiroom) and Chromecast devices</li> <li> Share local library with iTunes and Roku</li> <li> Local audio playback with ALSA or PulseAudio</li> <li> <p>Supports multiple different clients:</p> </li> <li> <p> Remote apps like Apple Remote (iOS) or Retune (Android)</p> </li> <li> Integrated mobile friendly web interface</li> <li> <p> MPD clients</p> </li> <li> <p>Supports music and audiobook files, podcast files and RSS and internet radio</p> </li> <li> Supports audio files in most formats</li> <li> Supports playing your Spotify library (requires Spotify premium account)</li> <li> Runs on low power devices like the Raspberry Pi</li> </ul> <p> </p> <p>(You can find more screenshots from OwnTone's web interface here)</p>"},{"location":"#looking-for-help","title":"Looking for help?","text":"<p>Before you continue, make sure you know what version of OwnTone you have, and what features it was built with (e.g. Spotify support).</p> <p>How to find out? Go to the web interface and check. No web interface? Then check the top of OwnTone's log file (usually <code>/var/log/owntone.log</code>).</p> <p>Note that you are viewing a snapshot of the instructions that may or may not match the version of OwnTone that you are using.</p> <p>If you are looking for help on building OwnTone (not using it), then please see the documentation on Building from Source.</p>"},{"location":"#references","title":"References","text":"<p>You can find source and documentation, also for older versions, here:</p> <ul> <li>Source Code</li> </ul> <ol> <li> <p>DAAP stands for Digital Audio Access Protocol which is the protocol used by iTunes and friends to share/stream media libraries over the network.\u00a0\u21a9</p> </li> </ol>"},{"location":"artwork/","title":"Artwork","text":"<p>OwnTone has support for PNG and JPEG artwork which is either:</p> <ul> <li>embedded in the media files</li> <li>placed as separate image files in the library</li> <li>made available online by the radio station</li> </ul> <p>For media in your library, OwnTone will try to locate album and artist artwork (group artwork) by the following procedure:</p> <ul> <li>if a file {artwork,cover,Folder}.{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;</li> <li>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;</li> <li>failing that, individual files are examined and the first file found with an embedded artwork is used. Here again, ordering is not guaranteed.</li> </ul> <p>{artwork,cover,Folder} are the default, you can add other base names in the 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).</p> <p>For playlists in your library, say /foo/bar.m3u, then for any http streams in the list, OwnTone will look for /foo/bar.{jpg,png}.</p> <p>You can use symlinks for the artwork files.</p> <p>OwnTone caches artwork in a separate cache file. The default path is <code>/var/cache/owntone/cache.db</code> and can be configured in the configuration file. The cache.db file can be deleted without losing the library and pairing informations.</p>"},{"location":"building/","title":"Build Instructions","text":"<p>This document contains instructions for building OwnTone from the git tree. If you just want to build from a release tarball, you don't need the build tools (git, autotools, autoconf, automake, gawk, gperf, gettext, bison and flex), and you can skip the autoreconf step.</p>"},{"location":"building/#quick-version-for-debianubuntu","title":"Quick Version for Debian/Ubuntu","text":"<p>If you are the lucky kind, this should get you all the required tools and libraries:</p> <pre><code>sudo apt-get install \\\n build-essential git autotools-dev autoconf automake libtool gettext gawk \\\n gperf bison flex libconfuse-dev libunistring-dev libsqlite3-dev \\\n libavcodec-dev libavformat-dev libavfilter-dev libswscale-dev libavutil-dev \\\n libasound2-dev libmxml-dev libgcrypt20-dev libavahi-client-dev zlib1g-dev \\\n libevent-dev libplist-dev libsodium-dev libjson-c-dev libwebsockets-dev \\\n libcurl4-openssl-dev libprotobuf-c-dev\n</code></pre> <p>Note that OwnTone will also work with other versions and flavours of libgcrypt and libcurl, so the above are just suggestions.</p> <p>The following features require extra packages, and that you add a configure argument when you run ./configure:</p> Feature Configure argument Packages Chromecast <code>--enable-chromecast</code> libgnutls*-dev PulseAudio <code>--with-pulseaudio</code> libpulse-dev <p>These features can be disabled saving you package dependencies:</p> Feature Configure argument Packages Spotify (built-in) <code>--disable-spotify</code> libprotobuf-c-dev Player web UI <code>--disable-webinterface</code> libwebsockets-dev Live web UI <code>--without-libwebsockets</code> libwebsockets-dev <p>Then run the following (adding configure arguments for optional features):</p> <pre><code>git clone https://github.com/owntone/owntone-server.git\ncd owntone-server\nautoreconf -i\n./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-install-user\nmake\nsudo make install\n</code></pre> <p>Using <code>--enable-install-user</code> means that <code>make install</code> will also add system user and group for owntone.</p> <p>With the above configure arguments, a systemd service file will be installed to <code>/etc/systemd/system/owntone.service</code> so that the server will start on boot. Use <code>--disable-install-systemd</code> if you don't want that.</p> <p>Now edit <code>/etc/owntone.conf</code>. Note the guide at the top highlighting which settings that normally require modification.</p> <p>Start the server with <code>sudo systemctl start owntone</code> and check that it is running with <code>sudo systemctl status owntone</code>.</p> <p>See the Documentation for usage information.</p>"},{"location":"building/#quick-version-for-fedora","title":"Quick version for Fedora","text":"<p>If you haven't already enabled the free RPM fusion packages do that, since you will need ffmpeg. You can google how to do that. Then run:</p> <pre><code>sudo dnf install \\\n git automake autoconf gettext-devel gperf gawk libtool bison flex \\\n sqlite-devel libconfuse-devel libunistring-devel mxml-devel libevent-devel \\\n avahi-devel libgcrypt-devel zlib-devel alsa-lib-devel ffmpeg-devel \\\n libplist-devel libsodium-devel json-c-devel libwebsockets-devel \\\n libcurl-devel protobuf-c-devel\n</code></pre> <p>Clone the OwnTone repo:</p> <pre><code>git clone https://github.com/owntone/owntone-server.git\ncd owntone-server\n</code></pre> <p>Then run the following:</p> <pre><code>autoreconf -i\n./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-install-user\nmake\nsudo make install\n</code></pre> <p>Using <code>--enable-install-user</code> means that <code>make install</code> will also add system user and group for owntone.</p> <p>With the above configure arguments, a systemd service file will be installed to <code>/etc/systemd/system/owntone.service</code> so that the server will start on boot. Use <code>--disable-install-systemd</code> if you don't want that.</p> <p>Now edit <code>/etc/owntone.conf</code>. Note the guide at the top highlighting which settings that normally require modification.</p> <p>Start the server with <code>sudo systemctl start owntone</code> and check that it is running with <code>sudo systemctl status owntone</code>.</p> <p>See the Documentation for usage information.</p>"},{"location":"building/#quick-version-for-freebsd","title":"Quick Version for FreeBSD","text":"<p>There is a script in the 'scripts' folder that will at least attempt to do all the work for you. And should the script not work for you, you can still look through it and use it as an installation guide.</p>"},{"location":"building/#quick-version-for-macos-using-homebrew","title":"Quick Version for macOS Using Homebrew","text":"<p>This workflow file used for building OwnTone via Github actions includes all the steps that you need to execute: .github/workflows/macos.yml</p>"},{"location":"building/#quick-version-for-macos-using-macports","title":"\"Quick\" Version for macOS Using MacPorts","text":"<p>Caution:</p> <p>1) this approach may be out of date, consider using the Homebrew method above since it is continuously tested. 2) MacPorts requires many downloads and lots of time to install (and sometimes build) ports. You will need a decent network connection and some patience!</p> <p>Install MacPorts (which requires Xcode): https://www.macports.org/install.php</p> <pre><code>sudo port install \\\n autoconf automake libtool pkgconfig git gperf bison flex libgcrypt \\\n libunistring libconfuse ffmpeg libevent json-c libwebsockets curl \\\n libplist libsodium protobuf-c\n</code></pre> <p>Download, configure, build, and install the Mini-XML library</p> <p>Download, configure, build and install the libinotify-kqueue library</p> <p>Add the following to <code>.bashrc</code>:</p> <pre><code># add /usr/local to pkg-config path\nexport PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/local/lib/pkgconfig\n# libunistring doesn't support pkg-config, set overrides\nexport LIBUNISTRING_CFLAGS=-I/opt/local/include\nexport LIBUNISTRING_LIBS=\"-L/opt/local/lib -lunistring\"\n</code></pre> <p>Optional features require the following additional ports:</p> Feature Configure argument Ports Chromecast <code>--enable-chromecast</code> gnutls PulseAudio <code>--with-pulseaudio</code> pulseaudio <p>Clone the OwnTone repository:</p> <pre><code>git clone https://github.com/owntone/owntone-server.git\ncd owntone-server\n</code></pre> <p>Finally, configure, build, install, and add configuration arguments for optional features:</p> <pre><code>autoreconf -i\n./configure\nmake\nsudo make install\n</code></pre> <p>Note: if for some reason you've installed the <code>avahi</code> port, you need to add <code>--without-avahi</code> to configure above.</p> <p>Edit <code>/usr/local/etc/owntone.conf</code> and change the <code>uid</code> to a proper system daemon (eg: unknown), and run the following commands:</p> <pre><code>sudo mkdir -p /usr/local/var/run\nsudo mkdir -p /usr/local/var/log # or change logfile in conf\nsudo chown unknown /usr/local/var/cache/owntone # or change conf\n</code></pre> <p>Run OwnTone:</p> <pre><code>sudo /usr/local/sbin/owntone\n</code></pre> <p>Verify it is running (you need to Ctrl+C to stop dns-sd):</p> <pre><code>dns-sd -B _daap._tcp\n</code></pre>"},{"location":"building/#long-version-requirements","title":"Long Version - Requirements","text":"<p>Required tools:</p> <ul> <li>autotools: autoconf 2.63+, automake 1.10+, libtool 2.2. Run <code>autoreconf -i</code> at the top of the source tree to generate the build system.</li> <li>gettext: libunistring requires iconv and gettext provides the autotools macro definitions for iconv.</li> <li>gperf</li> <li>bison 3.0+ (yacc is not sufficient)</li> <li>flex (lex is not sufficient)</li> </ul> <p>Libraries:</p> <ul> <li>Avahi client libraries (avahi-client) 0.6.24+</li> <li>SQLite 3.5.0+ with the unlock notify API enabled. SQLite needs to be built with the support for the unlock notify API; this is not always the case in binary packages, so you may need to rebuild SQLite to enable the unlock notify API. You can check for the presence of the <code>sqlite3_unlock_notify</code> symbol in the sqlite library. Refer to the <code>SQLITE_ENABLE_UNLOCK_NOTIFY</code> in the SQLlite documentation.</li> <li>FFmpeg</li> <li>libconfuse </li> <li>libevent 2.1.4+</li> <li>Mini-XML (aka mxml or libmxml) </li> <li>Libgcrypt 1.2.0+ </li> <li>zlib</li> <li>libunistring 0.9.3+</li> <li>json-c</li> <li>libcurl</li> <li>libplist 0.16+</li> <li>libsodium</li> <li>protobuf-c</li> <li>alsa-lib (optional - ALSA local audio) often already installed as part of your distro</li> <li>PulseAudio (optional - PulseAudio local audio)</li> <li>GnuTLS (optional - Chromecast support)</li> <li>Libwebsockets 2.0.2+ (optional - websocket support)</li> </ul> <p>Note: If using binary packages, remember that you need the development packages to build OwnTone (usually suffixed with -dev or -devel).</p>"},{"location":"building/#long-version-building-and-installing","title":"Long Version - Building and Installing","text":"<p>Start by generating the build system by running <code>autoreconf -i</code>. This will generate the configure script and <code>Makefile.in</code>.</p> <p>To display the configure options <code>run ./configure --help</code>.</p> <p>Support for Spotify is optional. Use <code>--disable-spotify</code> to disable this feature.</p> <p>Support for LastFM scrobbling is optional. Use <code>--enable-lastfm</code> to enable this feature.</p> <p>Support for the MPD protocol is optional. Use <code>--disable-mpd</code> to disable this feature.</p> <p>Support for Chromecast devices is optional. Use <code>--enable-chromecast</code> to enable this feature.</p> <p>The player web interface is optional. Use <code>--disable-webinterface</code> to disable this feature. If enabled, <code>sudo make install</code> will install the prebuild html, js, css files. The prebuild files are:</p> <ul> <li><code>htdocs/index.html</code></li> <li><code>htdocs/player/*</code></li> </ul> <p>The source for the player web interface is located under the <code>web-src</code> folder and requires nodejs &gt;= 6.0 to be built. In the <code>web-src</code> folder run <code>npm install</code> to install all dependencies for the player web interface. After that run <code>npm run build</code>. This will build the web interface and update the <code>htdocs</code> folder. (See Web interface for more informations)</p> <p>Building with libwebsockets is required if you want the web interface. It will be enabled if the library is present (with headers). Use <code>--without-libwebsockets</code> to disable.</p> <p>Building with PulseAudio is optional. It will be enabled if the library is present (with headers). Use <code>--without-pulseaudio</code> to disable.</p> <p>Recommended build settings:</p> <pre><code>./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-install-user\n</code></pre> <p>After configure run the usual make, and if that went well, <code>sudo make install</code>.</p> <p>With the above configure arguments, a systemd service file will be installed to <code>/etc/systemd/system/owntone.service</code> so that the server will start on boot. Use <code>--disable-install-systemd</code> if you don't want that.</p> <p>Using <code>--enable-install-user</code> means that <code>make install</code> will also add a system user and group for owntone.</p> <p>After installation:</p> <ul> <li>edit the configuration file, <code>/etc/owntone.conf</code></li> <li>make sure the Avahi daemon is installed and running (Debian: <code>apt install avahi-daemon</code>)</li> </ul> <p>OwnTone will drop privileges to any user you specify in the configuration file if it's started as root.</p> <p>This user must have read permission to your library and read/write permissions to the database location (<code>$localstatedir/cache/owntone</code> by default).</p>"},{"location":"building/#non-priviliged-user-version-for-development","title":"Non-Priviliged User Version for Development","text":"<p>OwnTone is meant to be run as system wide daemon, but for development purposes you may want to run it isolated to your regular user.</p> <p>The following description assumes that you want all runtime data stored in <code>$HOME/owntone_data</code> and the source in <code>$HOME/projects/owntone-server</code>.</p> <p>Prepare directories for runtime data:</p> <pre><code>mkdir -p $HOME/owntone_data/etc\nmkdir -p $HOME/owntone_data/media\n</code></pre> <p>Copy one or more mp3 file to test with to <code>owntone_data/media</code>.</p> <p>Checkout OwnTone and configure build:</p> <pre><code>cd $HOME/projects\ngit clone https://github.com/owntone/owntone-server.git\ncd owntone-server\nautoreconf -vi\n./configure --prefix=$HOME/owntone_data/usr --sysconfdir=$HOME/owntone_data/etc --localstatedir=$HOME/owntone_data/var\n</code></pre> <p>Build and install runtime:</p> <pre><code>make install\n</code></pre> <p>Edit <code>owntone_data/etc/owntone.conf</code>, find the following configuration settings and set them to these values:</p> <pre><code> uid = ${USER}\n loglevel = \"debug\"\n directories = { \"${HOME}/owntone_data/media\" }\n</code></pre> <p>Run the server:</p> <pre><code>./src/owntone -f\n</code></pre> <p>Note: You can also use the copy of the binary located in <code>$HOME/owntone_data/usr/sbin</code></p>"},{"location":"configuration/","title":"Configuration","text":"<p>The configuration of OwnTone - usually located in <code>/etc/owntone.conf</code> - is split into multiple sections:</p> <ul> <li><code>general</code> - Main settings of OwnTone.</li> <li><code>library</code> - Settings of local library.</li> <li><code>audio</code> - Settings for the local audio.</li> <li><code>alsa</code> - Settings for ALSA devices.</li> <li><code>fifo</code> - Settings for named pipe.</li> <li><code>airplay_shared</code> - Settings shared across AirPlay devices.</li> <li><code>airplay</code> - Settings for a specific AirPlay device.</li> <li><code>chromecast</code> - Settings for a specific Chromecast device.</li> <li><code>spotify</code> - Settings for the Spotify playback.</li> <li><code>rcp</code> - Settings for RCP / Roku Soundbridge devices.</li> <li><code>mpd</code> - Settings for MPD clients.</li> <li><code>sqlite</code> - Settings for SQLite operation.</li> <li><code>streaming</code> - Settings for the streaming.</li> </ul>"},{"location":"configuration/#format","title":"Format","text":"<p>Each section consists of a name enclosing settings within parentheses.</p> <p>Each setting consists of a name and a value. There are different types of settings: string, integer, boolean, and list.</p> <p>Comments are preceded by a hash sign.</p> <p>The format is as follow:</p> <pre><code># Section\nsection {\n # String value\n setting = \"&lt;string-value&gt;\"\n # Integer value\n setting = &lt;integer-value&gt;\n # Boolean\n setting = &lt;true|false&gt;\n # List\n setting = { \"value a\", \"value b\", \"value n\"}\n}\n</code></pre> <p>Note: For a regular use, the most important settings are:</p> <ul> <li>the <code>directories</code> (see <code>library</code> section), which should be the location of your media, and</li> <li>the <code>uid</code> (see <code>general</code> section), which must have read access to those directories.</li> </ul>"},{"location":"configuration/#general-settings","title":"General Settings","text":"<pre><code>general {\n \u2026\n}\n</code></pre> <p>The <code>general</code> section accepts the settings below.</p>"},{"location":"configuration/#uid","title":"uid","text":"<p>Identifier of the user running OwnTone.</p> <p>Notes:</p> <ul> <li>Make sure that this user has read access to the <code>directories</code> (<code>library</code> section) section and write access to the database (<code>db_path</code>), log file (<code>logfile</code>) and local audio (<code>audio</code> section).</li> <li>This setting is mandatory.</li> </ul> <p>Default: <code>\"nobody\"</code></p> <pre><code>uid = \"&lt;user-identifier&gt;\"\n</code></pre>"},{"location":"configuration/#db_path","title":"db_path","text":"<p>Full path to the database file.</p> <p>Note: This setting is mandatory.</p> <p>Default: <code>\"/var/cache/owntone/songs3.db\"</code></p> <pre><code>db_path = \"&lt;path-to-database-file&gt;\"\n</code></pre>"},{"location":"configuration/#db_backup_path","title":"db_backup_path","text":"<p>Full path to the database file backup.</p> <p>Note: Backups are triggered from an API endpoint.</p> <p>Default: unset</p> <pre><code>db_backup_path = \"&lt;path-to-database-backup-file&gt;\"\n</code></pre>"},{"location":"configuration/#logfile","title":"logfile","text":"<p>Full path to the log file.</p> <p>Default: <code>\"/var/log/owntone.log\"</code></p> <pre><code>logfile = \"&lt;path-to-log-file&gt;\"\n</code></pre>"},{"location":"configuration/#loglevel","title":"loglevel","text":"<p>Level of verbosity of the logging.</p> <p>Note: There are 6 levels of verbosity (hereunder from the less verbose to the most verbose). The level <code>log</code> is recommended for regular usage.</p> <p>Valid values: <code>fatal</code>, <code>log</code>, <code>warning</code>, <code>info</code>, <code>debug</code>, <code>spam</code></p> <p>Default: <code>\"log\"</code></p> <pre><code>loglevel = \"&lt;fatal|log|warning|info|debug|spam&gt;\"\n</code></pre>"},{"location":"configuration/#admin_password","title":"admin_password","text":"<p>Password for the web interface.</p> <p>Note: If a user is accessing the web interface from a device located in one of the <code>trusted_networks</code>, no password is required.</p> <p>Default: unset</p> <pre><code>admin_password = \"&lt;password&gt;\"\n</code></pre>"},{"location":"configuration/#websocket_port","title":"websocket_port","text":"<p>Port number used to answer requests from the web interface.</p> <p>Default: <code>3688</code></p> <pre><code>websocket_port = &lt;port-number&gt;\n</code></pre>"},{"location":"configuration/#websocket_interface","title":"websocket_interface","text":"<p>Network interface on which the web socket is listening: e.g., eth0, en0.</p> <p>Note: When this setting is unset, it means that the web socket listens on all available interfaces.</p> <p>Default: unset</p> <pre><code>websocket_interface = \"&lt;interface&gt;\"\n</code></pre>"},{"location":"configuration/#trusted_networks","title":"trusted_networks","text":"<p>List of networks considered safe to access OwnTone without authorisation (see also <code>admin_password</code>).</p> <p>Note: This applies to these client types: remotes, DAAP clients (e.g., Apple Music, iTunes) and the web interface.</p> <p>Valid values: <code>any</code>, <code>localhost</code>, or the prefix to one or more IP networks.</p> <p>Default: <code>{ \"localhost\", \"192.168\", \"fd\" }</code></p> <pre><code>trusted_networks = { &lt;\"any\"|\"localhost\"|\"ip-range-prefix\"&gt;, &lt;...&gt; }\n</code></pre>"},{"location":"configuration/#ipv6","title":"ipv6","text":"<p>Flag to indicate whether or not IPv6 must used.</p> <p>Default: <code>true</code></p> <pre><code>ipv6 = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#bind_address","title":"bind_address","text":"<p>Specific IP address to which the server is bound.</p> <p>Note: It can be an IPv4 or IPv6 address and by default the server listens on all IP addresses.</p> <p>Default: unset</p> <pre><code>bind_address = \"&lt;ip-address&gt;\"\n</code></pre>"},{"location":"configuration/#cache_path","title":"cache_path","text":"<p>Full path to the cache database file.</p> <p>Default: unset</p> <pre><code>cache_path = \"&lt;path-to-database-cache-file&gt;\"\n</code></pre>"},{"location":"configuration/#cache_daap_threshold","title":"cache_daap_threshold","text":"<p>Threshold in milliseconds for DAAP requests.</p> <p>Note: Set to <code>0</code> to disable caching.</p> <p>Default: <code>1000</code></p> <pre><code>cache_daap_threshold = &lt;threshold&gt;\n</code></pre>"},{"location":"configuration/#speaker_autoselect","title":"speaker_autoselect","text":"<p>Flag to automatically select the speaker when starting the playback if none of the previously selected speakers / outputs are available.</p> <p>Default: <code>false</code></p> <pre><code>speaker_autoselect = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#high_resolution_clock","title":"high_resolution_clock","text":"<p>Flag to indicate whether or not the high-resolution clock must be set.</p> <p>Note: Most modern operating systems have a high-resolution clock, but if OwnTone is running on an unusual platform and drop-outs are experienced, this setting set to <code>true</code>.</p> <p>Default: <code>false</code> on FreeBSD-based operating systems, <code>true</code> otherwise</p> <pre><code>high_resolution_clock = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#library-settings","title":"Library Settings","text":"<pre><code>library {\n \u2026\n}\n</code></pre> <p>The <code>library</code> section accepts the settings below.</p>"},{"location":"configuration/#name","title":"name","text":"<p>Name of the library as displayed by the clients.</p> <p>Notes:</p> <ul> <li>If you change the name after pairing with Remote you may have to redo the pairing.</li> <li>The place holder <code>%h</code> can be used to display the hostname.</li> </ul> <p>Default: <code>\"My Music on %h\"</code></p> <pre><code>name = \"&lt;library-name&gt;\"\n</code></pre>"},{"location":"configuration/#port","title":"port","text":"<p>TCP port to listen on.</p> <p>Default: <code>3689</code></p> <pre><code>port = 3689\n</code></pre>"},{"location":"configuration/#password","title":"password","text":"<p>Password for the library.</p> <p>Default: unset</p> <pre><code>password = \"&lt;password&gt;\"\n</code></pre>"},{"location":"configuration/#directories","title":"directories","text":"<p>Path to the directories containing the media to index.</p> <p>Default: unset</p> <pre><code>directories = { \"&lt;path-to-media&gt;\", \"&lt;...&gt;\" }\n</code></pre>"},{"location":"configuration/#follow_symlinks","title":"follow_symlinks","text":"<p>Flag to indicate whether or not symbolic links must be followed.</p> <p>Default: <code>true</code>.</p> <pre><code>follow_symlinks = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#podcasts","title":"podcasts","text":"<p>List of directories containing podcasts.</p> <p>Note: For each directory that is indexed, the path is matched against these names. If there is a match, all items in the directory are marked as podcasts. If you index <code>/srv/music</code>, and your podcasts are in <code>/srv/music/Podcasts</code>, then you can set this to <code>{ \"/Podcasts\" }</code>. Changing this setting only takes effect after a rescan.</p> <p>Default: unset</p> <pre><code>podcasts = { \"&lt;podcast-directory&gt;\", \"&lt;...&gt;\" }\n</code></pre>"},{"location":"configuration/#audiobooks","title":"audiobooks","text":"<p>List of directories containing audiobooks.</p> <p>Note: For each directory that is indexed, the path is matched against these names. If there is a match, all items in the directory are marked as audiobooks. If you index <code>/srv/music</code>, and your podcasts are in <code>/srv/music/Audiobooks</code>, then you can set this to <code>{ \"/Audiobooks\" }</code>.Changing this setting only takes effect after a rescan.</p> <p>Default: unset</p> <pre><code>audiobooks = { \"/Audiobooks\" }\n</code></pre>"},{"location":"configuration/#compilations","title":"compilations","text":"<p>List of directories containing compilations: e.g., greatest hits, best of, soundtracks.</p> <p>Note: For each directory that is indexed, the path is matched against these names. If there is a match, all items in the directory are marked as compilations.Changing this setting only takes effect after a rescan.</p> <p>Default: unset</p> <pre><code>compilations = { \"/Compilations\" }\n</code></pre>"},{"location":"configuration/#compilation_artist","title":"compilation_artist","text":"<p>Artist name of compilation albums.</p> <p>Note: Compilations usually have multiple artists, and sometimes may have no album artist. If you don't want every artist to be listed, you can set a single name which will be used for all compilation tracks without an album artist, and for all tracks in the compilation directories. Changing this setting only takes effect after a rescan.</p> <p>Default: unset</p> <pre><code>compilation_artist = \"&lt;various-artists&gt;\"\n</code></pre>"},{"location":"configuration/#hide_singles","title":"hide_singles","text":"<p>Flag to indicate whether or not single albums must be hidden.</p> <p>Note: If your album and artist lists are cluttered, you can choose to hide albums and artists with only one track. The tracks will still be visible in other lists, e.g., tracks and playlists. This setting currently only works with some remotes.</p> <p>Default: <code>false</code></p> <pre><code>hide_singles = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#radio_playlists","title":"radio_playlists","text":"<p>Flag to show internet streams in normal playlists.</p> <p>Note: By default the internet streams are shown in the \"Radio\" library, like iTunes does. However, some clients (like TunesRemote+) won't show the \"Radio\" library.</p> <p>Default: <code>false</code></p> <pre><code>radio_playlists = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#name_library","title":"name_library","text":"<p>Name of the default playlist Library.</p> <p>Note: This is a default playlist, which can be renamed with this setting.</p> <p>Default: <code>\"Library\"</code></p> <pre><code>name_library = \"&lt;library-playlist-name&gt;\"\n</code></pre>"},{"location":"configuration/#name_music","title":"name_music","text":"<p>Name of the default playlist Music.</p> <p>Note: This is a default playlist, which can be renamed with this setting.</p> <p>Default: <code>\"Music\"</code></p> <pre><code>name_music = \"&lt;music-playlist-name&gt;\"\n</code></pre>"},{"location":"configuration/#name_movies","title":"name_movies","text":"<p>Name of the default playlist Movies.</p> <p>Note: This is a default playlist, which can be renamed with this setting.</p> <p>Default: <code>\"Movies\"</code></p> <pre><code>name_movies = \"&lt;movies-playlist-name&gt;\"\n</code></pre>"},{"location":"configuration/#name_tvshows","title":"name_tvshows","text":"<p>Name of the default playlist TV Shows.</p> <p>Note: This is a default playlist, which can be renamed with this setting.</p> <p>Default: <code>\"TV Shows\"</code></p> <pre><code>name_tvshows = \"&lt;tv-shows-playlist-name&gt;\"\n</code></pre>"},{"location":"configuration/#name_podcasts","title":"name_podcasts","text":"<p>Name of the default playlist Podcasts.</p> <p>Note: This is a default playlist, which can be renamed with this setting.</p> <p>Default: <code>\"Podcasts\"</code></p> <pre><code>name_podcasts = \"&lt;podcasts-playlist-name&gt;\"\n</code></pre>"},{"location":"configuration/#name_audiobooks","title":"name_audiobooks","text":"<p>Name of the default playlist Audiobooks.</p> <p>Note: This is a default playlist, which can be renamed with this setting.</p> <p>Default: <code>\"Audiobooks\"</code></p> <pre><code>name_audiobooks = \"&lt;audiobooks-playlist-name&gt;\"\n</code></pre>"},{"location":"configuration/#name_radio","title":"name_radio","text":"<p>Name of the default playlist Radio.</p> <p>Note: This is a default playlist, which can be renamed with this setting.</p> <p>Default: <code>\"Radio\"</code></p> <pre><code>name_radio = \"&lt;radio-playlist-name&gt;\"\n</code></pre>"},{"location":"configuration/#name_unknown_title","title":"name_unknown_title","text":"<p>Name of tracks having an undefined title.</p> <p>Default: <code>\"Unknown title\"</code></p> <pre><code>name_unknown_title = \"&lt;unknown-title-name&gt;\"\n</code></pre>"},{"location":"configuration/#name_unknown_artist","title":"name_unknown_artist","text":"<p>Name of artist having an undefined name.</p> <p>Default: <code>\"Unknown artist\"</code></p> <pre><code>name_unknown_artist = \"&lt;unknown-artist-name&gt;\"\n</code></pre>"},{"location":"configuration/#name_unknown_album","title":"name_unknown_album","text":"<p>Name of album having an undefined title.</p> <p>Default: <code>\"Unknown album\"</code></p> <pre><code>name_unknown_album = \"&lt;unknown-album-name&gt;\"\n</code></pre>"},{"location":"configuration/#name_unknown_genre","title":"name_unknown_genre","text":"<p>Name of genre having an undefined name.</p> <p>Default: <code>\"Unknown genre\"</code></p> <pre><code>name_unknown_genre = \"&lt;unknown-genre-name&gt;\"\n</code></pre>"},{"location":"configuration/#name_unknown_composer","title":"name_unknown_composer","text":"<p>Name of composer having an undefined name.</p> <p>Default: <code>\"Unknown composer\"</code></p> <pre><code>name_unknown_composer = \"&lt;unknown-composer-name&gt;\"\n</code></pre>"},{"location":"configuration/#artwork_basenames","title":"artwork_basenames","text":"<p>List of base names for artwork files (file names without extension).</p> <p>Note:</p> <ul> <li>OwnTone searches for JPEG and PNG files with these base names.</li> <li>More information regarding artwork can be found here.</li> </ul> <p>Default: <code>{ \"artwork\", \"cover\", \"Folder\" }</code></p> <pre><code>artwork_basenames = { \"&lt;file-name&gt;\", \"&lt;...&gt;\" }\n</code></pre>"},{"location":"configuration/#artwork_individual","title":"artwork_individual","text":"<p>Flag to indicate whether or not the search for artwork corresponding to each individual media file must be done instead of only looking for the album artwork.</p> <p>Notes:</p> <ul> <li>Disable this setting to reduce cache size.</li> <li>More information regarding artwork can be found here.</li> </ul> <p>Default: <code>false</code></p> <pre><code>artwork_individual = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#artwork_online_sources","title":"artwork_online_sources","text":"<p>List of online resources for artwork.</p> <p>Notes:</p> <ul> <li>More information regarding artwork can be found here.</li> </ul> <p>Default: unset</p> <pre><code>artwork_online_sources = { \"&lt;link-to-source&gt;\", \"&lt;...&gt;\"}\n</code></pre>"},{"location":"configuration/#filetypes_ignore","title":"filetypes_ignore","text":"<p>List of file types ignored by the scanner.</p> <p>Note: Non-audio files will never be added to the database, but here you can prevent the scanner from even probing them. This might reduce scan time.</p> <p>Default: <code>{ \".db\", \".ini\", \".db-journal\", \".pdf\", \".metadata\" }</code></p> <pre><code>filetypes_ignore = { \"&lt;extension&gt;\", \"&lt;...&gt;\" }\n</code></pre>"},{"location":"configuration/#filepath_ignore","title":"filepath_ignore","text":"<p>List of paths ignored by the scanner.</p> <p>Note: If you want to exclude files on a more advanced basis you can enter one or more POSIX regular expressions, and any file with a matching path will be ignored.</p> <p>Default: unset</p> <pre><code>filepath_ignore = { \"&lt;path|regular-expression&gt;\" }\n</code></pre>"},{"location":"configuration/#filescan_disable","title":"filescan_disable","text":"<p>Flag to indicate whether or not the startup file scanning must be disabled.</p> <p>Note: When OwnTone starts it will do an initial file scan of the library and then watch it for changes. If you are sure your library never changes while OwnTone is not running, you can disable the initial file scan and save some system ressources. Disabling this scan may lead to OwnTone's database coming out of sync with the library. If that happens read the instructions in the README on how to trigger a rescan.</p> <p>Default: <code>false</code></p> <pre><code>filescan_disable = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#only_first_genre","title":"only_first_genre","text":"<p>Flag to indicate whether or not the first genre only found in metadata must be displayed.</p> <p>Note: Some tracks have multiple genres separated by semicolon in the same tag, e.g., 'Pop;Rock'. If you don't want them listed like this, you can enable this setting and only the first genre will be used (i.e. 'Pop').</p> <p>Default: <code>false</code></p> <pre><code>only_first_genre = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#m3u_overrides","title":"m3u_overrides","text":"<p>Flag to indicate whether or not the metadata provided by radio streams must be overridden by metadata from m3u playlists, e.g., artist and title in EXTINF.</p> <p>Default: <code>false</code></p> <pre><code>m3u_overrides = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#itunes_overrides","title":"itunes_overrides","text":"<p>Flag to indicate whether or not the library metadata must be overridden by iTunes metadata.</p> <p>Default: <code>false</code></p> <pre><code>itunes_overrides = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#itunes_smartpl","title":"itunes_smartpl","text":"<p>Flag to import Should we import the content of iTunes smart playlists.</p> <p>Default: <code>false</code></p> <pre><code>itunes_smartpl = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#no_decode","title":"no_decode","text":"<p>List of formats that are never decoded.</p> <p>Note: Decoding options for DAAP and RSP clients. Since iTunes has native support for mpeg, mp4a, mp4v, alac and wav, such files will be sent as they are. Any other formats will be decoded to raw wav. If OwnTone detects a non-iTunes DAAP client, it is assumed to only support mpeg and wav, other formats will be decoded. Here you can change when to decode. Note that these settings only affect serving media to DAAP and RSP clients, they have no effect on direct AirPlay, Chromecast and local audio playback</p> <p>Valid values: <code>mp4a</code>, <code>mp4v</code>, <code>mpeg</code>, <code>alac</code>, <code>flac</code>, <code>mpc</code>, <code>ogg</code>, <code>wma</code>, <code>wmal</code>, <code>wmav</code>, <code>aif</code>, <code>wav</code>.</p> <p>Default: unset</p> <pre><code>no_decode = { \"&lt;format&gt;\", \"&lt;...&gt;\" }\n</code></pre>"},{"location":"configuration/#force_decode","title":"force_decode","text":"<p>List of formats that are always decoded.</p> <p>Note: See note for <code>no_decode</code> setting.</p> <p>Valid values: <code>mp4a</code>, <code>mp4v</code>, <code>mpeg</code>, <code>alac</code>, <code>flac</code>, <code>mpc</code>, <code>ogg</code>, <code>wma</code>, <code>wmal</code>, <code>wmav</code>, <code>aif</code>, <code>wav</code>.</p> <p>Default: unset</p> <pre><code>force_decode = { \"&lt;format&gt;\", \"&lt;...&gt;\" }\n</code></pre>"},{"location":"configuration/#prefer_format","title":"prefer_format","text":"<p>Preferred format to be used.</p> <p>Default: unset</p> <pre><code>prefer_format = \"&lt;format&gt;\"\n</code></pre>"},{"location":"configuration/#decode_audio_filters","title":"decode_audio_filters","text":"<p>List of audio filters used at decoding time.</p> <p>Note: These filters are ffmpeg filters: i.e. similar to those specified on the command line <code>ffmpeg -af &lt;filter&gt;</code>. Examples: <code>\"volume=replaygain=track\"</code> to use replay gain of the track metadata, or <code>loudnorm=I=-16:LRA=11:TP=-1.5</code> to normalise volume.</p> <p>Default: unset</p> <pre><code>decode_audio_filters = { \"&lt;filter&gt;\" }\n</code></pre>"},{"location":"configuration/#decode_video_filters","title":"decode_video_filters","text":"<p>List of video filters used at decoding time.</p> <p>Note: These filters are ffmpeg filters: i.e. similar to those specified on the command line <code>ffmpeg -vf &lt;filter&gt;</code>.</p> <p>Default: unset</p> <pre><code>decode_video_filters = { \"&lt;filter&gt;\" }\n</code></pre>"},{"location":"configuration/#pipe_autostart","title":"pipe_autostart","text":"<p>Flag to indicate whether or not named pipes must start automatically when data is provided.</p> <p>Note: To exclude specific pipes from watching, consider using the <code>filepath_ignore</code> setting.</p> <pre><code>pipe_autostart = true\n</code></pre>"},{"location":"configuration/#pipe_sample_rate","title":"pipe_sample_rate","text":"<p>Sampling rate of the pipe.</p> <p>Default: <code>44100</code>.</p> <pre><code>pipe_sample_rate = &lt;integer&gt;\n</code></pre>"},{"location":"configuration/#pipe_bits_per_sample","title":"pipe_bits_per_sample","text":"<p>Bits per sample of the pipe.</p> <p>Default: <code>16</code></p> <pre><code>pipe_bits_per_sample = &lt;integer&gt;\n</code></pre>"},{"location":"configuration/#rating_updates","title":"rating_updates","text":"<p>Flag to indicate whether or not ratings are automatically updated.</p> <p>Note: When enabled, the rating is automatically updated after a song has either been played or skipped (only skipping to the next song is taken into account). The calculation is taken from the beets plugin \"mpdstats\" (see here). It consists of calculating a stable rating based only on the play and skip count and a rolling rating based on the current rating and the action (played or skipped). Both results are combined with a mix factor of 0.75. Formula: new rating = 0.75 \u00d7 stable rating + 0.25 \u00d7 rolling rating</p> <p>Default: <code>false</code></p> <pre><code>rating_updates = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#read_rating","title":"read_rating","text":"<p>Flag to indicate whether or not the rating is read from media file metadata.</p> <p>Default: <code>false</code></p> <pre><code>read_rating = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#write_rating","title":"write_rating","text":"<p>Flag to indicate whether or not the rating is written back to the file metadata.</p> <p>Note: By default, ratings are only saved in the database. To avoid excessive writing to the library, automatic rating updates are not written, even with the write_rating setting enabled.</p> <p>Default: <code>false</code></p> <pre><code>write_rating = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#max_rating","title":"max_rating","text":"<p>Scale used when reading and writing ratings to media files.</p> <p>Default: <code>100</code></p> <pre><code>max_rating = &lt;integer&gt;\n</code></pre>"},{"location":"configuration/#allow_modifying_stored_playlists","title":"allow_modifying_stored_playlists","text":"<p>Flag to indicate whether or not M3U playlists can be created, modified, or deleted in the playlist directories.</p> <p>Note: This setting is only supported through the web interface and some MPD clients.</p> <p>Default: <code>false</code></p> <pre><code>allow_modifying_stored_playlists = false\n</code></pre>"},{"location":"configuration/#default_playlist_directory","title":"default_playlist_directory","text":"<p>Name of the directory in one of the library directories that will be used as the default playlist directory.</p> <p>Note: OwnTone creates new playlists in this directory. This setting requires <code>allow_modify_stored_playlists</code> set to true.</p> <p>Default: unset</p> <pre><code>default_playlist_directory = \"&lt;path-to-playlist-directory&gt;\"\n</code></pre>"},{"location":"configuration/#clear_queue_on_stop_disable","title":"clear_queue_on_stop_disable","text":"<p>Flag to indicate whether or not the queue is cleared when the playback is stopped.</p> <p>Note: By default OwnTone will, like iTunes, clear the play queue if playback stops. Setting clear_queue_on_stop_disable to true will keep the playlist like MPD does. Moreover, some dacp clients do not show the play queue if playback is stopped.</p> <p>Default: <code>false</code></p> <pre><code>clear_queue_on_stop_disable = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#local-audio-settings","title":"Local Audio Settings","text":"<pre><code>audio {\n \u2026\n}\n</code></pre> <p>The <code>audio</code> section is meant to configure the local audio output. It accepts the settings below.</p>"},{"location":"configuration/#nickname","title":"nickname","text":"<p>Name appearing in the speaker list.</p> <p>Default: <code>\"Computer\"</code></p> <pre><code>nickname = \"Computer\"\n</code></pre>"},{"location":"configuration/#type","title":"type","text":"<p>Type of the output.</p> <p>Valid values: <code>alsa</code>, <code>pulseaudio</code>, <code>dummy</code>, <code>disabled</code></p> <p>Default: unset</p> <pre><code>type = \"&lt;alsa|pulseaudio|dummy|disabled&gt;\"\n</code></pre> <ul> <li><code>server</code> - For pulseaudio output, an optional server hostname or IP can be specified (e.g. \"localhost\"). If not set, connection is made via local socket.</li> </ul> <p>Default: unset</p> <pre><code>server = \"&lt;hostname|ip-address&gt;\"\n</code></pre> <ul> <li><code>card</code> - Name of the local audio PCM device.</li> </ul> <p>Note: ALSA only.</p> <p>Default: <code>\"default\"</code></p> <pre><code>card = \"&lt;device-name&gt;\"\n</code></pre>"},{"location":"configuration/#mixer","title":"mixer","text":"<p>Mixer channel used for volume control.</p> <p>Note: Usable with ALSA only. If not set, PCM will be used if available, otherwise Master.</p> <p>Default: unset</p> <pre><code>mixer = \"&lt;mixer&gt;\"\n</code></pre>"},{"location":"configuration/#mixer_device","title":"mixer_device","text":"<p>Name of the mixer device to use for volume control.</p> <p>Note: Usable with ALSA only.</p> <p>Default: unset</p> <pre><code>mixer_device = \"&lt;mixer-device&gt;\"\n</code></pre>"},{"location":"configuration/#sync_disable","title":"sync_disable","text":"<p>Flag to indicate whether or not audio resampling has to be enabled to keep local audio in sync with, for example, AirPlay.</p> <p>Note: This feature relies on accurate ALSA measurements of delay, and some devices don't provide that. If that is the case you are better off disabling the feature.</p> <p>Default: <code>false</code></p> <pre><code>sync_disable = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#offset_ms","title":"offset_ms","text":"<p>Start delay in milliseconds relatively to other speakers, for example AirPlay.</p> <p>Note: Negative values correspond to moving local audio ahead, positive correspond to delaying it.</p> <p>Valid values: -1000 to 1000</p> <p>Default: <code>0</code></p> <pre><code>offset_ms = 0\n</code></pre>"},{"location":"configuration/#adjust_period_seconds","title":"adjust_period_seconds","text":"<p>Period in seconds used to collect measurements for drift and latency adjustments.</p> <p>Note: To calculate if resampling is required and if yes what value, local audio delay is measured each second. After a period the collected measurements are used to estimate drift and latency, which determines if corrections are required.</p> <p>Default: <code>100</code></p> <pre><code>adjust_period_seconds = &lt;integer&gt;\n</code></pre>"},{"location":"configuration/#per-alsa-device-settings","title":"Per ALSA Device Settings","text":"<pre><code>alsa \"&lt;card-name&gt;\" {\n \u2026.\n}\n</code></pre> <p>Each <code>alsa</code> section is meant to configure a named ALSA output: one named section per device. It accepts the settings below.</p> <p>Note: Make sure to set the <code>\"&lt;card-name&gt;\"</code> correctly. Moreover, these settings will override the ALSA settings in the <code>audio</code> section above.</p>"},{"location":"configuration/#nickname_1","title":"nickname","text":"<p>Name appearing in the speaker list.</p> <p>Default: <code>\"&lt;card-name&gt;\"</code></p> <pre><code>nickname = \"&lt;speaker-name&gt;\"\n</code></pre>"},{"location":"configuration/#mixer_1","title":"mixer","text":"<p>Mixer channel used for volume control.</p> <p>Note: If not set, PCM will be used if available, otherwise Master.</p> <pre><code>mixer = \"&lt;mixer&gt;\"\n</code></pre>"},{"location":"configuration/#mixer_device_1","title":"mixer_device","text":"<p>Name of the mixer device to use for volume control.</p> <p>Default: <code>\"&lt;card-name&gt;\"</code></p> <pre><code>mixer_device = \"&lt;mixer-device&gt;\"\n</code></pre>"},{"location":"configuration/#offset_ms_1","title":"offset_ms","text":"<p>Start delay in milliseconds relatively to other speakers, for example AirPlay.</p> <p>Note: Negative values correspond to moving local audio ahead, positive correspond to delaying it.</p> <p>Valid values: -1000 to 1000</p> <p>Default: <code>0</code></p> <pre><code>offset_ms = 0\n</code></pre>"},{"location":"configuration/#fifo-settings","title":"FIFO Settings","text":"<pre><code>fifo {\n\n}\n</code></pre> <p>The <code>fifo</code> section, is meant to configure the named pipe audio output. It accepts the settings below.</p>"},{"location":"configuration/#nickname_2","title":"nickname","text":"<p>The name appearing in the speaker list.</p> <p>Default: <code>\"fifo\"</code></p> <pre><code>nickname = \"&lt;fifo-name&gt;\"\n</code></pre>"},{"location":"configuration/#path","title":"path","text":"<p>Path to the named pipe.</p> <p>Default: unset</p> <pre><code>path = \"&lt;path-to-fifo&gt;\"\n</code></pre>"},{"location":"configuration/#shared-airplay-settings","title":"Shared AirPlay Settings","text":"<pre><code>airplay_shared {\n \u2026\n}\n</code></pre> <p>The <code>airplay_shared</code> section describes the settings that are shared across all the AirPlay devices.</p>"},{"location":"configuration/#control_port","title":"control_port","text":"<p>Number of the UDP control port used when AirPlay devices make connections back to OwnTone.</p> <p>Note: Choosing specific ports may be helpful when running OwnTone behind a firewall.</p> <p>Default: <code>0</code></p> <pre><code>control_port = 0\n</code></pre>"},{"location":"configuration/#timing_port","title":"timing_port","text":"<p>Number of the UDP timing port used when AirPlay devices make connections back to OwnTone.</p> <p>Note: Choosing specific ports may be helpful when running OwnTone behind a firewall.</p> <p>Default: <code>0</code></p> <pre><code>timing_port = 0\n</code></pre>"},{"location":"configuration/#uncompressed_alac","title":"uncompressed_alac","text":"<p>Switch AirPlay 1 streams to uncompressed ALAC (as opposed to regular, compressed ALAC). Reduces CPU use at the cost of network bandwidth.</p> <p>Default: <code>false</code></p> <pre><code>uncompressed_alac = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#per-airplay-device-settings","title":"Per AirPlay Device Settings","text":"<pre><code>airplay \"&lt;airplay-device&gt;\" {\n\n}\n</code></pre> <p>Each <code>airplay</code> section is meant to configure a named AirPlay output: one named section per device. It accepts the settings below.</p> <p>Note: The capitalisation of the device name is relevant.</p>"},{"location":"configuration/#max_volume","title":"max_volume","text":"<p>Maximum value of the volume.</p> <p>Note: If that's more than your setup can handle set a lower value.</p> <p>Default: <code>11</code></p> <pre><code>max_volume = &lt;integer&gt;\n</code></pre>"},{"location":"configuration/#exclude","title":"exclude","text":"<p>Flag indicating if the device must be excluded from the speaker list.</p> <p>Default: <code>false</code></p> <pre><code>exclude = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#permanent","title":"permanent","text":"<p>Flag to indicate to keep the device in the speaker list and thus ignore mdns notifications about it no longer being present. The speaker will remain until restart of OwnTone.</p> <p>Default: <code>false</code></p> <pre><code>permanent = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#reconnect","title":"reconnect","text":"<p>Flag to indicate whether or not OwnTone must explicitly reconnect with the device.</p> <p>Note: Some devices spuriously disconnect during playback, and based on the device type OwnTone may attempt to reconnect.</p> <p>Default: <code>false</code></p> <pre><code>reconnect = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#password_1","title":"password","text":"<ul> <li>``- Password of the device.</li> </ul> <p>Default: unset</p> <pre><code>password = \"&lt;password&gt;\"\n</code></pre>"},{"location":"configuration/#raop_disable","title":"raop_disable","text":"<p>Flag to indicate whether or not AirPlay 1 (RAOP) must be disabled.</p> <p>Default: <code>false</code></p> <pre><code>raop_disable = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#nickname_3","title":"nickname","text":"<p>Name appearing in the speaker list.</p> <p>Note: The defined name overrides the name of the device.</p> <p>Default: unset</p> <pre><code>nickname = \"&lt;speaker-name&gt;\"\n</code></pre>"},{"location":"configuration/#per-chromecast-device-settings","title":"Per Chromecast Device Settings","text":"<pre><code>chromecast \"&lt;chromecast-device&gt;\" {\n \u2026\n}\n</code></pre> <p>Each <code>chromecast</code> section is meant to configure a named Chromecast output: one named section per device. It accepts the settings below.</p> <p>Note: The capitalisation of the device name is relevant.</p>"},{"location":"configuration/#max_volume_1","title":"max_volume","text":"<p>Maximum value of the volume.</p> <p>Note: If that's more than your setup can handle set a lower value.</p> <p>Default: <code>11</code></p> <pre><code>max_volume = &lt;integer&gt;\n</code></pre>"},{"location":"configuration/#exclude_1","title":"exclude","text":"<p>Flag indicating if the device must be excluded from the speaker list.</p> <p>Default: <code>false</code></p> <pre><code>exclude = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#nickname_4","title":"nickname","text":"<p>Name appearing in the speaker list.</p> <p>Note: The defined name overrides the name of the device.</p> <p>Default: unset</p> <pre><code>nickname = \"&lt;speaker-name&gt;\"\n</code></pre>"},{"location":"configuration/#spotify-settings","title":"Spotify Settings","text":"<pre><code>spotify {\n \u2026\n}\n</code></pre> <p>The <code>spotify</code> section accepts the settings below.</p> <p>Note: These settings only have effect if OwnTone is built with Spotify support.</p>"},{"location":"configuration/#bitrate","title":"bitrate","text":"<p>Bit rate of the stream.</p> <p>Valid values: <code>0</code> (No preference), <code>1</code> (96 kb/s), <code>2</code> (160 kb/s), <code>3</code> (320 kb/s)</p> <p>Default: <code>0</code></p> <pre><code>bitrate = &lt;0|1|2|3&gt;\n</code></pre>"},{"location":"configuration/#base_playlist_disable","title":"base_playlist_disable","text":"<p>Flag to indicate whether or not Spotify playlists are placed into the library playlist folder.</p> <p>Note: Spotify playlists are by default located in a Spotify playlist folder.</p> <p>Default: <code>false</code></p> <pre><code>base_playlist_disable = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#artist_override","title":"artist_override","text":"<p>Flag indicating whether or not the compilation artist must be used as the album artist.</p> <p>Note: Spotify playlists usually have many artists, and if you don't want every artist to be listed when artist browsing in Remote, you can set this flag to true.</p> <p>Default: <code>false</code></p> <pre><code>artist_override = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#album_override","title":"album_override","text":"<p>Flag to indicate to use the playlist name as the album name.</p> <p>Note: Similar to the different artists in Spotify playlists, the playlist items belong to different albums, and if you do not want every album to be listed when browsing in Remote, you can set the album_override flag to true. Moreover, if an item is in more than one playlist, it will only appear randomly in one album when browsing.</p> <p>Default: <code>false</code></p> <pre><code>album_override = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#rcp-roku-soundbridge-settings","title":"RCP / Roku Soundbridge Settings","text":"<pre><code>rcp \"&lt;device-name&gt;\" {\n\n}\n</code></pre> <p>Each <code>rcp</code> section is meant to configure a named RCP output: one named section per device. It accepts the settings below.</p> <p>Note: The capitalisation of the device name is relevant.</p>"},{"location":"configuration/#exclude_2","title":"exclude","text":"<p>Enable this option to exclude the device from the speaker list.</p> <p>Default: <code>false</code></p> <pre><code>exclude = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#clear_on_close","title":"clear_on_close","text":"<p>Flag indicating whether or not the power on the device is maintained.</p> <p>Note: A Roku / SoundBridge can power up in 2 modes: (default) reconnect to the previously used library (i.e. OwnTone) or in a cleared library mode. The Roku power up behaviour is affected by how OwnTone disconnects from the Roku device. Set to false to maintain the default Roku power on behaviour.</p> <p>Default: <code>false</code></p> <pre><code>clear_on_close = false\n</code></pre>"},{"location":"configuration/#mpd-settings","title":"MPD Settings","text":"<pre><code>mpd {\n \u2026\n}\n</code></pre> <p>The <code>mpd</code> section defines the settings for MPD clients. It accepts the settings below.</p> <p>Note: These settings only have effect if OwnTone is built with Spotify support.</p>"},{"location":"configuration/#port_1","title":"port","text":"<p>TCP port to listen for MPD client requests.</p> <p>Note: Setting the port to <code>0</code> disables the support for MPD.</p> <p>Default: <code>6600</code></p> <pre><code>port = 6600\n</code></pre>"},{"location":"configuration/#http_port","title":"http_port","text":"<p>HTTP port to listen for artwork requests.</p> <p>Notes:</p> <ul> <li>This setting is only supported by some MPD clients and will need additional configuration in the MPD client to work.</li> <li>Setting the port to <code>0</code> disables the serving of artwork.</li> </ul> <p>Default: <code>0</code></p> <pre><code>http_port = 0\n</code></pre>"},{"location":"configuration/#sqlite-settings","title":"SQLite Settings","text":"<pre><code>sqlite {\n \u2026\n}\n</code></pre> <p>The <code>sqlite</code> section defines how the SQLite database operates and accepts the settings below.</p> <p>Note: Make sure to read the SQLite documentation for the corresponding PRAGMA statements as changing them from the defaults may increase the possibility of database corruption. By default, the SQLite default values are used.</p>"},{"location":"configuration/#pragma_cache_size_library","title":"pragma_cache_size_library","text":"<p>Cache size in number of database pages for the library database.</p> <p>Note: SQLite default page size is 1024 bytes and cache size is 2000 pages.</p> <pre><code>pragma_cache_size_library = &lt;pages&gt;\n</code></pre>"},{"location":"configuration/#pragma_cache_size_cache","title":"pragma_cache_size_cache","text":"<p>Cache size in number of db pages for the cache database.</p> <p>Note: SQLite default page size is 1024 bytes and cache size is 2000 pages.</p> <pre><code>pragma_cache_size_cache = &lt;pages&gt;\n</code></pre>"},{"location":"configuration/#pragma_journal_mode","title":"pragma_journal_mode","text":"<p>Sets the journal mode for the database. Valid values are: <code>DELETE</code>, <code>TRUNCATE</code>, <code>PERSIST</code>, <code>MEMORY</code>, <code>WAL</code>, and <code>OFF</code>.</p> <p>Default: <code>\"DELETE\"</code></p> <pre><code>pragma_journal_mode = \"&lt;DELETE|TRUNCATE|PERSIST|MEMORY|WAL|OFF&gt;\"\n</code></pre>"},{"location":"configuration/#pragma_synchronous","title":"pragma_synchronous","text":"<p>Change the setting of the \"synchronous\" flag.</p> <p>Valid values: <code>0</code> (off), <code>1</code> (normal), <code>2</code> (full)</p> <p>Default: <code>2</code></p> <pre><code>pragma_synchronous = &lt;0|1|2&gt;\n</code></pre>"},{"location":"configuration/#pragma_mmap_size_library","title":"pragma_mmap_size_library","text":"<p>Number of bytes set aside for memory-mapped I/O for the library database.</p> <p>Notes: This setting requires SQLite 3.7.17+.</p> <p>Valid values: <code>0</code> (mmap disabled), <code>&lt;integer&gt;</code> (bytes for mmap)</p> <p>Default: <code>0</code></p> <pre><code>pragma_mmap_size_library = &lt;integer&gt;\n</code></pre>"},{"location":"configuration/#pragma_mmap_size_cache","title":"pragma_mmap_size_cache","text":"<p>Number of bytes set aside for memory-mapped I/O for the cache database.</p> <p>Note: This setting requires SQLite 3.7.17+.</p> <p>Valid values: <code>0</code> (mmap disabled), <code>&lt;integer&gt;</code> (bytes for mmap)</p> <pre><code>pragma_mmap_size_cache = &lt;integer&gt;\n</code></pre>"},{"location":"configuration/#vacuum","title":"vacuum","text":"<p>Flag indicating whether or not the database must be vacuumed on startup.</p> <p>Note: This setting increases the startup time, but may reduce database size.</p> <p>Default: <code>true</code></p> <pre><code>vacuum = &lt;true|false&gt;\n</code></pre>"},{"location":"configuration/#streaming-settings","title":"Streaming Settings","text":"<pre><code>streaming {\n \u2026\n}\n</code></pre> <p>The <code>streaming</code> section defines the audio settings for the streaming URL (<code>http://&lt;server-name&gt;:&lt;port-number&gt;/stream.mp3</code>) and accepts the settings below.</p>"},{"location":"configuration/#sample_rate","title":"sample_rate","text":"<p>Sampling rate of the stream: e.g., 44100, 48000, etc.</p> <p>Default: <code>44100</code></p> <pre><code>sample_rate = &lt;integer&gt;\n</code></pre>"},{"location":"configuration/#bit_rate","title":"bit_rate","text":"<p>Bit rate of the stream (in kb/s).</p> <p>Valid values: <code>64</code>, <code>96</code>, <code>128</code>, <code>192</code>, and <code>320</code>.</p> <p>Default: <code>192</code></p> <pre><code>bit_rate = &lt;64|96|128|192|320&gt;\n</code></pre>"},{"location":"configuration/#icy_metaint","title":"icy_metaint","text":"<p>Number of bytes of media stream data between each metadata chunk.</p> <p>Default: <code>16384</code></p> <pre><code>icy_metaint = &lt;integer&gt;\n</code></pre>"},{"location":"getting-started/","title":"Getting started","text":"<p>After installation (see Installation) do the following:</p> <ol> <li>Edit the configuration file (usually <code>/etc/owntone.conf</code>) to suit your needs</li> <li>Start or restart the server (usually <code>/etc/init.d/owntone restart</code>)</li> <li>Go to the web interface http://owntone.local:3689, or, if that won't work, to http://SERVER_ADDRESS:3689</li> <li>Wait for the library scan to complete</li> <li>If you will be using a remote, e.g. Apple Remote: Start the remote, go to Settings, Add Library</li> <li>Enter the pair code in the web interface (update the page with F5 if it does not automatically pick up the pairing request)</li> </ol>"},{"location":"installation/","title":"How to get and install OwnTone","text":"<p>You can compile and run OwnTone on pretty much any Linux- or BSD-platform. The instructions are here.</p> <p>Apt repositories, images and precompiled binaries are available for some platforms. These can save you some work and make it easier to stay up to date:</p> Platform How to get RPi w/Raspberry Pi OS Add OwnTone repository to apt sources(See: Raspberry Pi Forums) Debian/Ubuntu amd64 Download the .deb package as artifact from the Github workflow(requires that you are logged in) OpenWrt Run <code>opkg install libwebsockets-full owntone</code> Docker / Podman See official imageSee alternate image FreeBSD Run <code>pkg install owntone</code> (See: FreeBSD ports) <p>OwnTone is not in the official Debian repositories due to lack of Debian maintainer and Debian policy difficulties concerning the web UI, see this issue.</p>"},{"location":"json-api/","title":"API Endpoint Reference","text":"<p>Available API endpoints:</p> <ul> <li>Player: control playback, volume, shuffle/repeat modes</li> <li>Outputs: list available outputs and enable/disable outputs</li> <li>Queue: list, add or modify the current queue</li> <li>Library: list playlists, artists, albums and tracks from your library or trigger library rescan</li> <li>Search: search for playlists, artists, albums and tracks</li> <li>Server info: get server information</li> <li>Settings: list and change settings for the player web interface</li> <li>Push notifications: receive push notifications</li> </ul> <p>JSON-Object model:</p> <ul> <li>Album</li> <li>Artist</li> <li>Browse Info</li> <li>Category</li> <li>Directory</li> <li>Option</li> <li>Paging</li> <li>Playlist</li> <li>Queue item</li> <li>Track</li> </ul>"},{"location":"json-api/#player","title":"Player","text":"Method Endpoint Description GET /api/player Get player status PUT /api/player/play, /api/player/pause, /api/player/stop, /api/player/toggle Start, pause or stop playback PUT /api/player/next, /api/player/previous Skip forward or backward PUT /api/player/shuffle Set shuffle mode PUT /api/player/consume Set consume mode PUT /api/player/repeat Set repeat mode PUT /api/player/volume Set master volume or volume for a specific output PUT /api/player/seek Seek to a position in the currently playing track"},{"location":"json-api/#get-player-status","title":"Get player status","text":"<p>Endpoint</p> <pre><code>GET /api/player\n</code></pre> <p>Response</p> Key Type Value state string <code>play</code>, <code>pause</code> or <code>stop</code> repeat string <code>off</code>, <code>all</code> or <code>single</code> consume boolean <code>true</code> if consume mode is enabled shuffle boolean <code>true</code> if shuffle mode is enabled volume integer Master volume in percent (0 - 100) item_id integer The current playing queue item <code>id</code> item_length_ms integer Total length in milliseconds of the current queue item item_progress_ms integer Progress into the current queue item in milliseconds <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/player\"\n</code></pre> <pre><code>{\n \"state\": \"pause\",\n \"repeat\": \"off\",\n \"consume\": false,\n \"shuffle\": false,\n \"volume\": 50,\n \"item_id\": 269,\n \"item_length_ms\": 278093,\n \"item_progress_ms\": 3674\n}\n</code></pre>"},{"location":"json-api/#control-playback","title":"Control playback","text":"<p>Start or resume, pause, stop playback.</p> <p>Endpoint</p> <pre><code>PUT /api/player/play\n</code></pre> <pre><code>PUT /api/player/pause\n</code></pre> <pre><code>PUT /api/player/stop\n</code></pre> <pre><code>PUT /api/player/toggle\n</code></pre> <p>Response</p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p>Example</p> <pre><code>curl -X PUT \"http://localhost:3689/api/player/play\"\n</code></pre> <pre><code>curl -X PUT \"http://localhost:3689/api/player/pause\"\n</code></pre> <pre><code>curl -X PUT \"http://localhost:3689/api/player/stop\"\n</code></pre> <pre><code>curl -X PUT \"http://localhost:3689/api/player/toggle\"\n</code></pre>"},{"location":"json-api/#skip-tracks","title":"Skip tracks","text":"<p>Skip forward or backward</p> <p>Endpoint</p> <pre><code>PUT /api/player/next\n</code></pre> <pre><code>PUT /api/player/previous\n</code></pre> <p>Response</p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p>Example</p> <pre><code>curl -X PUT \"http://localhost:3689/api/player/next\"\n</code></pre> <pre><code>curl -X PUT \"http://localhost:3689/api/player/previous\"\n</code></pre>"},{"location":"json-api/#set-shuffle-mode","title":"Set shuffle mode","text":"<p>Enable or disable shuffle mode</p> <p>Endpoint</p> <pre><code>PUT /api/player/shuffle\n</code></pre> <p>Query parameters</p> Parameter Value state The new shuffle state, should be either <code>true</code> or <code>false</code> <p>Response</p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p>Example</p> <pre><code>curl -X PUT \"http://localhost:3689/api/player/shuffle?state=true\"\n</code></pre>"},{"location":"json-api/#set-consume-mode","title":"Set consume mode","text":"<p>Enable or disable consume mode</p> <p>Endpoint</p> <pre><code>PUT /api/player/consume\n</code></pre> <p>Query parameters</p> Parameter Value state The new consume state, should be either <code>true</code> or <code>false</code> <p>Response</p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p>Example</p> <pre><code>curl -X PUT \"http://localhost:3689/api/player/consume?state=true\"\n</code></pre>"},{"location":"json-api/#set-repeat-mode","title":"Set repeat mode","text":"<p>Change repeat mode</p> <p>Endpoint</p> <pre><code>PUT /api/player/repeat\n</code></pre> <p>Query parameters</p> Parameter Value state The new repeat mode, should be either <code>off</code>, <code>all</code> or <code>single</code> <p>Response</p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p>Example</p> <pre><code>curl -X PUT \"http://localhost:3689/api/player/repeat?state=all\"\n</code></pre>"},{"location":"json-api/#set-volume","title":"Set volume","text":"<p>Change master volume or volume of a specific output.</p> <p>Endpoint</p> <pre><code>PUT /api/player/volume\n</code></pre> <p>Query parameters</p> Parameter Value volume The new volume (0 - 100) step The increase or decrease volume by the given amount (-100 - 100) output_id (Optional) If an output id is given, only the volume of this output will be changed. If parameter is omitted, the master volume will be changed. <p>Either <code>volume</code> or <code>step</code> must be present as query parameter</p> <p>Response</p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p>Example</p> <pre><code>curl -X PUT \"http://localhost:3689/api/player/volume?volume=50\"\n</code></pre> <pre><code>curl -X PUT \"http://localhost:3689/api/player/volume?step=-5\"\n</code></pre> <pre><code>curl -X PUT \"http://localhost:3689/api/player/volume?volume=50&amp;output_id=0\"\n</code></pre>"},{"location":"json-api/#seek","title":"Seek","text":"<p>Seek to a position in the currently playing track.</p> <p>Endpoint</p> <pre><code>PUT /api/player/seek\n</code></pre> <p>Query parameters</p> Parameter Value position_ms The new position in milliseconds to seek to seek_ms A relative amount of milliseconds to seek to <p>Response</p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p>Example</p> <p>Seek to position:</p> <pre><code>curl -X PUT \"http://localhost:3689/api/player/seek?position_ms=2000\"\n</code></pre> <p>Relative seeking (skip 30 seconds backwards):</p> <pre><code>curl -X PUT \"http://localhost:3689/api/player/seek?seek_ms=-30000\"\n</code></pre>"},{"location":"json-api/#outputs","title":"Outputs","text":"Method Endpoint Description GET /api/outputs Get a list of available outputs PUT /api/outputs/set Set enabled outputs GET /api/outputs/{id} Get an output PUT /api/outputs/{id} Change an output setting PUT /api/outputs/{id}/toggle Enable or disable an output, depending on the current state"},{"location":"json-api/#get-a-list-of-available-outputs","title":"Get a list of available outputs","text":"<p>Endpoint</p> <pre><code>GET /api/outputs\n</code></pre> <p>Response</p> Key Type Value outputs array Array of <code>output</code> objects <p><code>output</code> object</p> Key Type Value id string Output id name string Output name type string Type of the output: <code>AirPlay</code>, <code>Chromecast</code>, <code>ALSA</code>, <code>Pulseaudio</code>, <code>fifo</code> selected boolean <code>true</code> if output is enabled has_password boolean <code>true</code> if output is password protected requires_auth boolean <code>true</code> if output requires authentication needs_auth_key boolean <code>true</code> if output requires an authorization key (device verification) volume integer Volume in percent (0 - 100) <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/outputs\"\n</code></pre> <pre><code>{\n \"outputs\": [\n {\n \"id\": \"123456789012345\",\n \"name\": \"kitchen\",\n \"type\": \"AirPlay\",\n \"selected\": true,\n \"has_password\": false,\n \"requires_auth\": false,\n \"needs_auth_key\": false,\n \"volume\": 0\n },\n {\n \"id\": \"0\",\n \"name\": \"Computer\",\n \"type\": \"ALSA\",\n \"selected\": true,\n \"has_password\": false,\n \"requires_auth\": false,\n \"needs_auth_key\": false,\n \"volume\": 19\n },\n {\n \"id\": \"100\",\n \"name\": \"daapd-fifo\",\n \"type\": \"fifo\",\n \"selected\": false,\n \"has_password\": false,\n \"requires_auth\": false,\n \"needs_auth_key\": false,\n \"volume\": 0\n }\n ]\n}\n</code></pre>"},{"location":"json-api/#set-enabled-outputs","title":"Set enabled outputs","text":"<p>Set the enabled outputs by passing an array of output ids. The server enables all outputs with the given ids and disables the remaining outputs.</p> <p>Endpoint</p> <pre><code>PUT /api/outputs/set\n</code></pre> <p>Body parameters</p> Parameter Type Value outputs array Array of output ids <p>Response</p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p>Example</p> <pre><code>curl -X PUT \"http://localhost:3689/api/outputs/set\" --data \"{\\\"outputs\\\":[\\\"198018693182577\\\",\\\"0\\\"]}\"\n</code></pre>"},{"location":"json-api/#get-an-output","title":"Get an output","text":"<p>Get an output</p> <p>Endpoint</p> <pre><code>GET /api/outputs/{id}\n</code></pre> <p>Path parameters</p> Parameter Value id Output id <p>Response</p> <p>On success returns the HTTP <code>200 OK</code> success status response code. With the response body holding the <code>output</code> object.</p> <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/outputs/0\"\n</code></pre> <pre><code>{\n \"id\": \"0\",\n \"name\": \"Computer\",\n \"type\": \"ALSA\",\n \"selected\": true,\n \"has_password\": false,\n \"requires_auth\": false,\n \"needs_auth_key\": false,\n \"volume\": 3\n}\n</code></pre>"},{"location":"json-api/#change-an-output","title":"Change an output","text":"<p>Enable or disable an output and change its volume.</p> <p>Endpoint</p> <pre><code>PUT /api/outputs/{id}\n</code></pre> <p>Path parameters</p> Parameter Value id Output id <p>Body parameters</p> Parameter Type Value selected boolean (Optional) <code>true</code> to enable and <code>false</code> to disable the output volume integer (Optional) Volume in percent (0 - 100) pin string (Optional) PIN for device verification <p>Response</p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p>Example</p> <pre><code>curl -X PUT \"http://localhost:3689/api/outputs/0\" --data \"{\\\"selected\\\":true, \\\"volume\\\": 50}\"\n</code></pre>"},{"location":"json-api/#toggle-an-output","title":"Toggle an output","text":"<p>Enable or disable an output, depending on its current state</p> <p>Endpoint</p> <pre><code>PUT /api/outputs/{id}/toggle\n</code></pre> <p>Path parameters</p> Parameter Value id Output id <p>Response</p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p>Example</p> <pre><code>curl -X PUT \"http://localhost:3689/api/outputs/0/toggle\"\n</code></pre>"},{"location":"json-api/#queue","title":"Queue","text":"Method Endpoint Description GET /api/queue Get a list of queue items PUT /api/queue/clear Remove all items from the queue POST /api/queue/items/add Add items to the queue PUT /api/queue/items/{id}|now_playing Updating a queue item in the queue DELETE /api/queue/items/{id} Remove a queue item from the queue"},{"location":"json-api/#list-queue-items","title":"List queue items","text":"<p>Lists the items in the current queue</p> <p>Endpoint</p> <pre><code>GET /api/queue\n</code></pre> <p>Query parameters</p> Parameter Value id (Optional) If a queue item id is given, only the item with the id will be returned. Use id=now_playing to get the currently playing item. start (Optional) If a <code>start</code>and an <code>end</code> position is given, only the items from <code>start</code> (included) to <code>end</code> (excluded) will be returned. If only a <code>start</code> position is given, only the item at this position will be returned. end (Optional) See <code>start</code> parameter <p>Response</p> Key Type Value version integer Version number of the current queue count integer Number of items in the current queue items array Array of <code>queue item</code> objects <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/queue\"\n</code></pre> <pre><code>{\n \"version\": 833,\n \"count\": 20,\n \"items\": [\n {\n \"id\": 12122,\n \"position\": 0,\n \"track_id\": 10749,\n \"title\": \"Angels\",\n \"artist\": \"The xx\",\n \"artist_sort\": \"xx, The\",\n \"album\": \"Coexist\",\n \"album_sort\": \"Coexist\",\n \"albumartist\": \"The xx\",\n \"albumartist_sort\": \"xx, The\",\n \"genre\": \"Indie Rock\",\n \"year\": 2012,\n \"track_number\": 1,\n \"disc_number\": 1,\n \"length_ms\": 171735,\n \"media_kind\": \"music\",\n \"data_kind\": \"file\",\n \"path\": \"/music/srv/The xx/Coexist/01 Angels.mp3\",\n \"uri\": \"library:track:10749\"\n },\n ...\n ]\n}\n</code></pre>"},{"location":"json-api/#clearing-the-queue","title":"Clearing the queue","text":"<p>Remove all items form the current queue</p> <p>Endpoint</p> <pre><code>PUT /api/queue/clear\n</code></pre> <p>Response</p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p>Example</p> <pre><code>curl -X PUT \"http://localhost:3689/api/queue/clear\"\n</code></pre>"},{"location":"json-api/#adding-items-to-the-queue","title":"Adding items to the queue","text":"<p>Add tracks, playlists artists or albums to the current queue</p> <p>Endpoint</p> <pre><code>POST /api/queue/items/add\n</code></pre> <p>Query parameters</p> Parameter Value uris Comma separated list of resource identifiers (<code>track</code>, <code>playlist</code>, <code>artist</code> or <code>album</code> object <code>uri</code>) expression A smart playlist query expression identifying the tracks that will be added to the queue. position (Optional) If a position is given, new items are inserted starting from this position into the queue. playback (Optional) If the <code>playback</code> parameter is set to <code>start</code>, playback will be started after adding the new items. playback_from_position (Optional) If the <code>playback</code> parameter is set to <code>start</code>, playback will be started with the queue item at the position given in <code>playback_from_position</code>. clear (Optional) If the <code>clear</code> parameter is set to <code>true</code>, the queue will be cleared before adding the new items. shuffle (Optional) If the <code>shuffle</code> parameter is set to <code>true</code>, the shuffle mode is activated. If it is set to something else, the shuffle mode is deactivated. To leave the shuffle mode untouched the parameter should be omitted. limit (Optional) Maximum number of tracks to add <p>Either the <code>uris</code> or the <code>expression</code> parameter must be set. If both are set the <code>uris</code> parameter takes precedence and the <code>expression</code> parameter will be ignored.</p> <p>Response</p> <p>On success returns the HTTP <code>200 OK</code> success status response code.</p> Key Type Value version integer Version number of the current queue count integer Number of tracks added to the queue items array Array of <code>queue item</code> objects added <p>Example</p> <p>Add new items by uri:</p> <pre><code>curl -X POST \"http://localhost:3689/api/queue/items/add?uris=library:playlist:68,library:artist:2932599850102967727\"\n</code></pre> <pre><code>{\n \"version\": 833,\n \"count\": 20,\n \"items\": [\n {\n \"id\": 12122,\n \"position\": 0,\n \"track_id\": 10749,\n \"title\": \"Angels\",\n \"artist\": \"The xx\",\n \"artist_sort\": \"xx, The\",\n \"album\": \"Coexist\",\n \"album_sort\": \"Coexist\",\n \"albumartist\": \"The xx\",\n \"albumartist_sort\": \"xx, The\",\n \"genre\": \"Indie Rock\",\n \"year\": 2012,\n \"track_number\": 1,\n \"disc_number\": 1,\n \"length_ms\": 171735,\n \"media_kind\": \"music\",\n \"data_kind\": \"file\",\n \"path\": \"/music/srv/The xx/Coexist/01 Angels.mp3\",\n \"uri\": \"library:track:10749\"\n },\n ...\n ]\n}\n</code></pre> <p>Add new items by query language:</p> <pre><code>curl -X POST \"http://localhost:3689/api/queue/items/add?expression=media_kind+is+music\"\n</code></pre> <pre><code>{\n \"version\": 833,\n \"count\": 20,\n \"items\": [\n {\n \"id\": 12122,\n \"position\": 0,\n \"track_id\": 10749,\n \"title\": \"Angels\",\n \"artist\": \"The xx\",\n \"artist_sort\": \"xx, The\",\n \"album\": \"Coexist\",\n \"album_sort\": \"Coexist\",\n \"albumartist\": \"The xx\",\n \"albumartist_sort\": \"xx, The\",\n \"genre\": \"Indie Rock\",\n \"year\": 2012,\n \"track_number\": 1,\n \"disc_number\": 1,\n \"length_ms\": 171735,\n \"media_kind\": \"music\",\n \"data_kind\": \"file\",\n \"path\": \"/music/srv/The xx/Coexist/01 Angels.mp3\",\n \"uri\": \"library:track:10749\"\n },\n ...\n ]\n}\n</code></pre> <p>Clear current queue, add 10 new random tracks of <code>genre</code> Pop and start playback</p> <pre><code>curl -X POST \"http://localhost:3689/api/queue/items/add?limit=10&amp;clear=true&amp;playback=start&amp;expression=genre+is+%22Pop%22+order+by+random+desc\"\n</code></pre> <pre><code>{\n \"count\": 10\n}\n</code></pre>"},{"location":"json-api/#updating-a-queue-item","title":"Updating a queue item","text":"<p>Update or move a queue item in the current queue</p> <p>Endpoint</p> <pre><code>PUT /api/queue/items/{id}\n</code></pre> <p>or</p> <pre><code>PUT /api/queue/items/now_playing\n</code></pre> <p>Path parameters</p> Parameter Value id Queue item id <p>(or use now_playing to update the track currently playing)</p> <p>Query parameters</p> Parameter Value new_position The new position for the queue item in the current queue. title New track title album New album title artist New artist album_artist New album artist composer New composer genre New genre artwork_url New URL to track artwork <p>Response</p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p>Example</p> <pre><code>curl -X PUT \"http://localhost:3689/api/queue/items/3?new_position=0\"\n</code></pre> <pre><code>curl -X PUT \"http://localhost:3689/api/queue/items/3?title=Awesome%20title&amp;artwork_url=http%3A%2F%2Fgyfgafguf.dk%2Fimages%2Fpige3.jpg\"\n</code></pre> <pre><code>curl -X PUT \"http://localhost:3689/api/queue/items/now_playing?title=Awesome%20title&amp;artwork_url=http%3A%2F%2Fgyfgafguf.dk%2Fimages%2Fpige3.jpg\"\n</code></pre>"},{"location":"json-api/#removing-a-queue-item","title":"Removing a queue item","text":"<p>Remove a queue item from the current queue</p> <p>Endpoint</p> <pre><code>DELETE /api/queue/items/{id}\n</code></pre> <p>Path parameters</p> Parameter Value id Queue item id <p>Response</p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p>Example</p> <pre><code>curl -X PUT \"http://localhost:3689/api/queue/items/2\"\n</code></pre>"},{"location":"json-api/#library","title":"Library","text":"Method Endpoint Description GET /api/library Get library information GET /api/library/playlists Get a list of playlists GET /api/library/playlists/{id} Get a playlist PUT /api/library/playlists/{id} Update a playlist attribute DELETE /api/library/playlists/{id} Delete a playlist GET /api/library/playlists/{id}/tracks Get list of tracks for a playlist PUT /api/library/playlists/{id}/tracks Update play count of tracks for a playlist GET /api/library/playlists/{id}/playlists Get list of playlists for a playlist folder GET /api/library/artists Get a list of artists GET /api/library/artists/{id} Get an artist GET /api/library/artists/{id}/albums Get list of albums for an artist GET /api/library/albums Get a list of albums GET /api/library/albums/{id} Get an album GET /api/library/albums/{id}/tracks Get list of tracks for an album GET /api/library/tracks/{id} Get a track GET /api/library/tracks/{id}/playlists Get list of playlists for a track PUT /api/library/tracks Update multiple track properties PUT /api/library/tracks/{id} Update single track properties GET /api/library/genres Get list of genres GET /api/library/count Get count of tracks, artists and albums GET /api/library/files Get list of directories in the local library POST /api/library/add Add an item to the library PUT /api/update Trigger a library rescan PUT /api/rescan Trigger a library metadata rescan PUT /api/library/backup Request library backup db"},{"location":"json-api/#library-information","title":"Library information","text":"<p>List some library stats</p> <p>Endpoint</p> <pre><code>GET /api/library\n</code></pre> <p>Response</p> Key Type Value songs integer Array of <code>playlist</code> objects db_playtime integer Total playtime of all songs in the library artists integer Number of album artists in the library albums integer Number of albums in the library started_at string Server startup time (timestamp in <code>ISO 8601</code> format) updated_at string Last library update (timestamp in <code>ISO 8601</code> format) updating boolean <code>true</code> if library rescan is in progress <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/library\"\n</code></pre> <pre><code>{\n \"songs\": 217,\n \"db_playtime\": 66811,\n \"artists\": 9,\n \"albums\": 19,\n \"started_at\": \"2018-11-19T19:06:08Z\",\n \"updated_at\": \"2018-11-19T19:06:16Z\",\n \"updating\": false\n}\n</code></pre>"},{"location":"json-api/#list-playlists","title":"List playlists","text":"<p>Lists all playlists in your library (does not return playlist folders)</p> <p>Endpoint</p> <pre><code>GET /api/library/playlists\n</code></pre> <p>Query parameters</p> Parameter Value offset (Optional) Offset of the first playlist to return limit (Optional) Maximum number of playlists to return <p>Response</p> Key Type Value items array Array of <code>playlist</code> objects total integer Total number of playlists in the library offset integer Requested offset of the first playlist limit integer Requested maximum number of playlists <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/library/playlists\"\n</code></pre> <pre><code>{\n \"items\": [\n {\n \"id\": 1,\n \"name\": \"radio\",\n \"path\": \"/music/srv/radio.m3u\",\n \"smart_playlist\": false,\n \"uri\": \"library:playlist:1\"\n },\n ...\n ],\n \"total\": 20,\n \"offset\": 0,\n \"limit\": -1\n}\n</code></pre>"},{"location":"json-api/#get-a-playlist","title":"Get a playlist","text":"<p>Get a specific playlists in your library</p> <p>Endpoint</p> <pre><code>GET /api/library/playlists/{id}\n</code></pre> <p>Path parameters</p> Parameter Value id Playlist id <p>Response</p> <p>On success returns the HTTP <code>200 OK</code> success status response code. With the response body holding the <code>playlist</code> object.</p> <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/library/playlists/1\"\n</code></pre> <pre><code>{\n \"id\": 1,\n \"name\": \"radio\",\n \"path\": \"/music/srv/radio.m3u\",\n \"smart_playlist\": false,\n \"uri\": \"library:playlist:1\"\n}\n</code></pre>"},{"location":"json-api/#update-a-playlist","title":"Update a playlist","text":"<p>Update attributes of a specific playlists in your library</p> <p>Endpoint</p> <pre><code>PUT /api/library/playlists/{id}\n</code></pre> <p>Path parameters</p> Parameter Value id Playlist id <p>Query parameters</p> Parameter Value query_limit For RSS feeds, this sets how many podcasts to retrieve <p>Example</p> <pre><code>curl -X PUT \"http://localhost:3689/api/library/playlists/25?query_limit=20\"\n</code></pre>"},{"location":"json-api/#delete-a-playlist","title":"Delete a playlist","text":"<p>Delete a playlist, e.g. a RSS feed</p> <p>Endpoint</p> <pre><code>DELETE /api/library/playlists/{id}\n</code></pre> <p>Path parameters</p> Parameter Value id Playlist id <p>Example</p> <pre><code>curl -X DELETE \"http://localhost:3689/api/library/playlists/25\"\n</code></pre>"},{"location":"json-api/#list-playlist-tracks","title":"List playlist tracks","text":"<p>Lists the tracks in a playlists</p> <p>Endpoint</p> <pre><code>GET /api/library/playlists/{id}/tracks\n</code></pre> <p>Path parameters</p> Parameter Value id Playlist id <p>Query parameters</p> Parameter Value offset (Optional) Offset of the first track to return limit (Optional) Maximum number of tracks to return <p>Response</p> Key Type Value items array Array of <code>track</code> objects total integer Total number of tracks in the playlist offset integer Requested offset of the first track limit integer Requested maximum number of tracks <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/library/playlists/1/tracks\"\n</code></pre> <pre><code>{\n \"items\": [\n {\n \"id\": 10766,\n \"title\": \"Solange wir tanzen\",\n \"artist\": \"Heinrich\",\n \"artist_sort\": \"Heinrich\",\n \"album\": \"Solange wir tanzen\",\n \"album_sort\": \"Solange wir tanzen\",\n \"albumartist\": \"Heinrich\",\n \"albumartist_sort\": \"Heinrich\",\n \"genre\": \"Electronica\",\n \"year\": 2014,\n \"track_number\": 1,\n \"disc_number\": 1,\n \"length_ms\": 223085,\n \"play_count\": 2,\n \"skip_count\": 1,\n \"time_played\": \"2018-02-23T10:31:20Z\",\n \"media_kind\": \"music\",\n \"data_kind\": \"file\",\n \"path\": \"/music/srv/Heinrich/Solange wir tanzen/01 Solange wir tanzen.mp3\",\n \"uri\": \"library:track:10766\"\n },\n ...\n ],\n \"total\": 20,\n \"offset\": 0,\n \"limit\": -1\n}\n</code></pre>"},{"location":"json-api/#update-playlist-tracks","title":"Update playlist tracks","text":"<p>Updates the play count for tracks in a playlists</p> <p>Endpoint</p> <pre><code>PUT /api/library/playlists/{id}/tracks\n</code></pre> <p>Path parameters</p> Parameter Value id Playlist id <p>Query parameters</p> Parameter Value play_count Either <code>increment</code>, <code>played</code> or <code>reset</code>. <code>increment</code> will increment <code>play_count</code> and update <code>time_played</code>, <code>played</code> will be like <code>increment</code> but only where <code>play_count</code> is 0, <code>reset</code> will set <code>play_count</code> and <code>skip_count</code> to zero and delete <code>time_played</code> and <code>time_skipped</code> <p>Example</p> <pre><code>curl -X PUT \"http://localhost:3689/api/library/playlists/1/tracks?play_count=played\"\n</code></pre>"},{"location":"json-api/#list-playlists-in-a-playlist-folder","title":"List playlists in a playlist folder","text":"<p>Lists the playlists in a playlist folder</p> <p>Note: The root playlist folder has <code>id</code> 0.</p> <p>Endpoint</p> <pre><code>GET /api/library/playlists/{id}/playlists\n</code></pre> <p>Path parameters</p> Parameter Value id Playlist id <p>Query parameters</p> Parameter Value offset (Optional) Offset of the first playlist to return limit (Optional) Maximum number of playlist to return <p>Response</p> Key Type Value items array Array of <code>playlist</code> objects total integer Total number of playlists in the playlist folder offset integer Requested offset of the first playlist limit integer Requested maximum number of playlist <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/library/playlists/0/tracks\"\n</code></pre> <pre><code>{\n \"items\": [\n {\n \"id\": 11,\n \"name\": \"Spotify\",\n \"path\": \"spotify:playlistfolder\",\n \"parent_id\": \"0\",\n \"smart_playlist\": false,\n \"folder\": true,\n \"uri\": \"library:playlist:11\"\n },\n {\n \"id\": 8,\n \"name\": \"bytefm\",\n \"path\": \"/srv/music/Playlists/bytefm.m3u\",\n \"parent_id\": \"0\",\n \"smart_playlist\": false,\n \"folder\": false,\n \"uri\": \"library:playlist:8\"\n }\n ],\n \"total\": 2,\n \"offset\": 0,\n \"limit\": -1\n}\n</code></pre>"},{"location":"json-api/#list-artists","title":"List artists","text":"<p>Lists the artists in your library</p> <p>Endpoint</p> <pre><code>GET /api/library/artists\n</code></pre> <p>Query parameters</p> Parameter Value offset (Optional) Offset of the first artist to return limit (Optional) Maximum number of artists to return <p>Response</p> Key Type Value items array Array of <code>artist</code> objects total integer Total number of artists in the library offset integer Requested offset of the first artist limit integer Requested maximum number of artists <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/library/artists\"\n</code></pre> <pre><code>{\n \"items\": [\n {\n \"id\": \"3815427709949443149\",\n \"name\": \"ABAY\",\n \"name_sort\": \"ABAY\",\n \"album_count\": 1,\n \"track_count\": 10,\n \"length_ms\": 2951554,\n \"uri\": \"library:artist:3815427709949443149\"\n },\n ...\n ],\n \"total\": 20,\n \"offset\": 0,\n \"limit\": -1\n}\n</code></pre>"},{"location":"json-api/#get-an-artist","title":"Get an artist","text":"<p>Get a specific artist in your library</p> <p>Endpoint</p> <pre><code>GET /api/library/artists/{id}\n</code></pre> <p>Path parameters</p> Parameter Value id Artist id <p>Response</p> <p>On success returns the HTTP <code>200 OK</code> success status response code. With the response body holding the <code>artist</code> object.</p> <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/library/artists/3815427709949443149\"\n</code></pre> <pre><code>{\n \"id\": \"3815427709949443149\",\n \"name\": \"ABAY\",\n \"name_sort\": \"ABAY\",\n \"album_count\": 1,\n \"track_count\": 10,\n \"length_ms\": 2951554,\n \"uri\": \"library:artist:3815427709949443149\"\n}\n</code></pre>"},{"location":"json-api/#list-artist-albums","title":"List artist albums","text":"<p>Lists the albums of an artist</p> <p>Endpoint</p> <pre><code>GET /api/library/artists/{id}/albums\n</code></pre> <p>Path parameters</p> Parameter Value id Artist id <p>Query parameters</p> Parameter Value offset (Optional) Offset of the first album to return limit (Optional) Maximum number of albums to return <p>Response</p> Key Type Value items array Array of <code>album</code> objects total integer Total number of albums of this artist offset integer Requested offset of the first album limit integer Requested maximum number of albums <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/library/artists/32561671101664759/albums\"\n</code></pre> <pre><code>{\n \"items\": [\n {\n \"id\": \"8009851123233197743\",\n \"name\": \"Add Violence\",\n \"name_sort\": \"Add Violence\",\n \"artist\": \"Nine Inch Nails\",\n \"artist_id\": \"32561671101664759\",\n \"track_count\": 5,\n \"length_ms\": 1634961,\n \"uri\": \"library:album:8009851123233197743\"\n },\n ...\n ],\n \"total\": 20,\n \"offset\": 0,\n \"limit\": -1\n}\n</code></pre>"},{"location":"json-api/#list-albums","title":"List albums","text":"<p>Lists the albums in your library</p> <p>Endpoint</p> <pre><code>GET /api/library/albums\n</code></pre> <p>Query parameters</p> Parameter Value offset (Optional) Offset of the first album to return limit (Optional) Maximum number of albums to return <p>Response</p> Key Type Value items array Array of <code>album</code> objects total integer Total number of albums in the library offset integer Requested offset of the first albums limit integer Requested maximum number of albums <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/library/albums\"\n</code></pre> <pre><code>{\n \"items\": [\n {\n \"id\": \"8009851123233197743\",\n \"name\": \"Add Violence\",\n \"name_sort\": \"Add Violence\",\n \"artist\": \"Nine Inch Nails\",\n \"artist_id\": \"32561671101664759\",\n \"track_count\": 5,\n \"length_ms\": 1634961,\n \"uri\": \"library:album:8009851123233197743\"\n },\n ...\n ],\n \"total\": 20,\n \"offset\": 0,\n \"limit\": -1\n}\n</code></pre>"},{"location":"json-api/#get-an-album","title":"Get an album","text":"<p>Get a specific album in your library</p> <p>Endpoint</p> <pre><code>GET /api/library/albums/{id}\n</code></pre> <p>Path parameters</p> Parameter Value id Album id <p>Response</p> <p>On success returns the HTTP <code>200 OK</code> success status response code. With the response body holding the <code>album</code> object.</p> <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/library/albums/8009851123233197743\"\n</code></pre> <pre><code>{\n \"id\": \"8009851123233197743\",\n \"name\": \"Add Violence\",\n \"name_sort\": \"Add Violence\",\n \"artist\": \"Nine Inch Nails\",\n \"artist_id\": \"32561671101664759\",\n \"track_count\": 5,\n \"length_ms\": 1634961,\n \"uri\": \"library:album:8009851123233197743\"\n}\n</code></pre>"},{"location":"json-api/#list-album-tracks","title":"List album tracks","text":"<p>Lists the tracks in an album</p> <p>Endpoint</p> <pre><code>GET /api/library/albums/{id}/tracks\n</code></pre> <p>Path parameters</p> Parameter Value id Album id <p>Query parameters</p> Parameter Value offset (Optional) Offset of the first track to return limit (Optional) Maximum number of tracks to return <p>Response</p> Key Type Value items array Array of <code>track</code> objects total integer Total number of tracks offset integer Requested offset of the first track limit integer Requested maximum number of tracks <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/library/albums/1/tracks\"\n</code></pre> <pre><code>{\n \"items\": [\n {\n \"id\": 10766,\n \"title\": \"Solange wir tanzen\",\n \"artist\": \"Heinrich\",\n \"artist_sort\": \"Heinrich\",\n \"album\": \"Solange wir tanzen\",\n \"album_sort\": \"Solange wir tanzen\",\n \"albumartist\": \"Heinrich\",\n \"albumartist_sort\": \"Heinrich\",\n \"genre\": \"Electronica\",\n \"year\": 2014,\n \"track_number\": 1,\n \"disc_number\": 1,\n \"length_ms\": 223085,\n \"play_count\": 2,\n \"last_time_played\": \"2018-02-23T10:31:20Z\",\n \"media_kind\": \"music\",\n \"data_kind\": \"file\",\n \"path\": \"/music/srv/Heinrich/Solange wir tanzen/01 Solange wir tanzen.mp3\",\n \"uri\": \"library:track:10766\"\n },\n ...\n ],\n \"total\": 20,\n \"offset\": 0,\n \"limit\": -1\n}\n</code></pre>"},{"location":"json-api/#get-a-track","title":"Get a track","text":"<p>Get a specific track in your library</p> <p>Endpoint</p> <pre><code>GET /api/library/tracks/{id}\n</code></pre> <p>Path parameters</p> Parameter Value id Track id <p>Response</p> <p>On success returns the HTTP <code>200 OK</code> success status response code. With the response body holding the <code>track</code> object.</p> <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/library/tracks/1\"\n</code></pre> <pre><code>{\n \"id\": 1,\n \"title\": \"Pardon Me\",\n \"title_sort\": \"Pardon Me\",\n \"artist\": \"Incubus\",\n \"artist_sort\": \"Incubus\",\n \"album\": \"Make Yourself\",\n \"album_sort\": \"Make Yourself\",\n \"album_id\": \"6683985628074308431\",\n \"album_artist\": \"Incubus\",\n \"album_artist_sort\": \"Incubus\",\n \"album_artist_id\": \"4833612337650426236\",\n \"composer\": \"Alex Katunich/Brandon Boyd/Chris Kilmore/Jose Antonio Pasillas II/Mike Einziger\",\n \"genre\": \"Alternative Rock\",\n \"year\": 2001,\n \"track_number\": 12,\n \"disc_number\": 1,\n \"length_ms\": 223170,\n \"rating\": 0,\n \"usermark\": 0,\n \"play_count\": 0,\n \"skip_count\": 0,\n \"time_added\": \"2019-01-20T11:58:29Z\",\n \"date_released\": \"2001-05-27\",\n \"seek_ms\": 0,\n \"media_kind\": \"music\",\n \"data_kind\": \"file\",\n \"path\": \"/music/srv/Incubus/Make Yourself/12 Pardon Me.mp3\",\n \"uri\": \"library:track:1\",\n \"artwork_url\": \"/artwork/item/1\",\n \"lyrics\": \"[00:00:10] Let's start the music [...]\"\n}\n</code></pre>"},{"location":"json-api/#list-playlists-for-a-track","title":"List playlists for a track","text":"<p>Get the list of playlists that contain a track (does not return smart playlists)</p> <p>Endpoint</p> <pre><code>GET /api/library/tracks/{id}/playlists\n</code></pre> <p>Path parameters</p> Parameter Value id Track id <p>Query parameters</p> Parameter Value offset (Optional) Offset of the first playlist to return limit (Optional) Maximum number of playlist to return <p>Response</p> Key Type Value items array Array of <code>playlist</code> objects total integer Total number of playlists offset integer Requested offset of the first playlist limit integer Requested maximum number of playlists <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/library/tracks/27/playlists\"\n</code></pre> <pre><code>{\n \"items\": [\n {\n \"id\": 1,\n \"name\": \"playlist\",\n \"path\": \"/music/srv/playlist.m3u\",\n \"smart_playlist\": false,\n \"uri\": \"library:playlist:1\"\n },\n ...\n ],\n \"total\": 2,\n \"offset\": 0,\n \"limit\": -1\n}\n</code></pre>"},{"location":"json-api/#update-track-properties","title":"Update track properties","text":"<p>Change properties of one or more tracks (supported properties are \"rating\", \"play_count\" and \"usermark\")</p> <p>Endpoint</p> <pre><code>PUT /api/library/tracks\n</code></pre> <p>Body parameters</p> Parameter Type Value tracks array Array of track objects <p>Response</p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p>Example</p> <pre><code>curl -X PUT -d '{ \"tracks\": [ { \"id\": 1, \"rating\": 100, \"usermark\": 4 }, { \"id\": 2, \"usermark\": 3 } ] }' \"http://localhost:3689/api/library/tracks\"\n</code></pre> <p>Endpoint</p> <pre><code>PUT /api/library/tracks/{id}\n</code></pre> <p>Path parameters</p> Parameter Value id Track id <p>Query parameters</p> Parameter Value rating The new rating (0 - 100) play_count Either <code>increment</code> or <code>reset</code>. <code>increment</code> will increment <code>play_count</code> and update <code>time_played</code>, <code>reset</code> will set <code>play_count</code> and <code>skip_count</code> to zero and delete <code>time_played</code> and <code>time_skipped</code> usermark The new usermark (&gt;= 0) <p>Response</p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p>Example</p> <pre><code>curl -X PUT \"http://localhost:3689/api/library/tracks/1?rating=100\"\n</code></pre> <pre><code>curl -X PUT \"http://localhost:3689/api/library/tracks/1?play_count=increment\"\n</code></pre>"},{"location":"json-api/#list-genres","title":"List genres","text":"<p>Get list of genres</p> <p>Endpoint</p> <pre><code>GET /api/library/genres\n</code></pre> <p>Response</p> Key Type Value items array Array of <code>browse-info</code> objects total integer Total number of genres in the library offset integer Requested offset of the first genre limit integer Requested maximum number of genres <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/library/genres\"\n</code></pre> <pre><code>{\n \"items\": [\n {\n \"name\": \"Classical\"\n },\n {\n \"name\": \"Drum &amp; Bass\"\n },\n {\n \"name\": \"Pop\"\n },\n {\n \"name\": \"Rock/Pop\"\n },\n {\n \"name\": \"'90s Alternative\"\n }\n ],\n \"total\": 5,\n \"offset\": 0,\n \"limit\": -1\n}\n</code></pre>"},{"location":"json-api/#list-albums-for-genre","title":"List albums for genre","text":"<p>Lists the albums in a genre</p> <p>Endpoint</p> <pre><code>GET api/search?type=albums&amp;expression=genre+is+\\\"{genre name}\\\"\"\n</code></pre> <p>Query parameters</p> Parameter Value genre genre name (uri encoded and html esc seq for chars: '/&amp;) offset (Optional) Offset of the first album to return limit (Optional) Maximum number of albums to return <p>Response</p> Key Type Value items array Array of <code>album</code> objects total integer Total number of albums in the library offset integer Requested offset of the first albums limit integer Requested maximum number of albums <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/search?type=albums&amp;expression=genre+is+\\\"Pop\\\"\"\ncurl -X GET \"http://localhost:3689/api/search?type=albums&amp;expression=genre+is+\\\"Rock%2FPop\\\"\" # Rock/Pop\ncurl -X GET \"http://localhost:3689/api/search?type=albums&amp;expression=genre+is+\\\"Drum%20%26%20Bass\\\"\" # Drum &amp; Bass\ncurl -X GET \"http://localhost:3689/api/search?type=albums&amp;expression=genre+is+\\\"%2790s%20Alternative\\\"\" # '90 Alternative\n</code></pre> <pre><code>{\n \"albums\": {\n \"items\": [\n {\n \"id\": \"320189328729146437\",\n \"name\": \"Best Ever\",\n \"name_sort\": \"Best Ever\",\n \"artist\": \"ABC\",\n \"artist_id\": \"8760559201889050080\",\n \"track_count\": 1,\n \"length_ms\": 3631,\n \"uri\": \"library:album:320189328729146437\"\n },\n {\n \"id\": \"7964595866631625723\",\n \"name\": \"Greatest Hits\",\n \"name_sort\": \"Greatest Hits\",\n \"artist\": \"Marvin Gaye\",\n \"artist_id\": \"5261930703203735930\",\n \"track_count\": 2,\n \"length_ms\": 7262,\n \"uri\": \"library:album:7964595866631625723\"\n },\n {\n \"id\": \"3844610748145176456\",\n \"name\": \"The Very Best of Etta\",\n \"name_sort\": \"Very Best of Etta\",\n \"artist\": \"Etta James\",\n \"artist_id\": \"2627182178555864595\",\n \"track_count\": 1,\n \"length_ms\": 177926,\n \"uri\": \"library:album:3844610748145176456\"\n }\n ],\n \"total\": 3,\n \"offset\": 0,\n \"limit\": -1\n }\n}\n</code></pre>"},{"location":"json-api/#get-count-of-tracks-artists-and-albums","title":"Get count of tracks, artists and albums","text":"<p>Get information about the number of tracks, artists and albums and the total playtime</p> <p>Endpoint</p> <pre><code>GET /api/library/count\n</code></pre> <p>Query parameters</p> Parameter Value expression (Optional) The smart playlist query expression, if this parameter is omitted returns the information for the whole library <p>Response</p> Key Type Value tracks integer Number of tracks matching the expression artists integer Number of artists matching the expression albums integer Number of albums matching the expression db_playtime integer Total playtime in milliseconds of all tracks matching the expression <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/library/count?expression=data_kind+is+file\"\n</code></pre> <pre><code>{\n \"tracks\": 6811,\n \"artists\": 355,\n \"albums\": 646,\n \"db_playtime\": 1590767\n}\n</code></pre>"},{"location":"json-api/#list-local-directories","title":"List local directories","text":"<p>List the local directories and the directory contents (tracks and playlists)</p> <p>Endpoint</p> <pre><code>GET /api/library/files\n</code></pre> <p>Query parameters</p> Parameter Value directory (Optional) A path to a directory in your local library. <p>Response</p> Key Type Value directories array Array of <code>directory</code> objects containing the sub directories tracks object <code>paging</code> object containing <code>track</code> objects that matches the <code>directory</code> playlists object <code>paging</code> object containing <code>playlist</code> objects that matches the <code>directory</code> <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/library/files?directory=/music/srv\"\n</code></pre> <pre><code>{\n \"directories\": [\n {\n \"path\": \"/music/srv/Audiobooks\"\n },\n {\n \"path\": \"/music/srv/Music\"\n },\n {\n \"path\": \"/music/srv/Playlists\"\n },\n {\n \"path\": \"/music/srv/Podcasts\"\n }\n ],\n \"tracks\": {\n \"items\": [\n {\n \"id\": 1,\n \"title\": \"input.pipe\",\n \"artist\": \"Unknown artist\",\n \"artist_sort\": \"Unknown artist\",\n \"album\": \"Unknown album\",\n \"album_sort\": \"Unknown album\",\n \"album_id\": \"4201163758598356043\",\n \"album_artist\": \"Unknown artist\",\n \"album_artist_sort\": \"Unknown artist\",\n \"album_artist_id\": \"4187901437947843388\",\n \"genre\": \"Unknown genre\",\n \"year\": 0,\n \"track_number\": 0,\n \"disc_number\": 0,\n \"length_ms\": 0,\n \"play_count\": 0,\n \"skip_count\": 0,\n \"time_added\": \"2018-11-24T08:41:35Z\",\n \"seek_ms\": 0,\n \"media_kind\": \"music\",\n \"data_kind\": \"pipe\",\n \"path\": \"/music/srv/input.pipe\",\n \"uri\": \"library:track:1\",\n \"artwork_url\": \"/artwork/item/1\"\n }\n ],\n \"total\": 1,\n \"offset\": 0,\n \"limit\": -1\n },\n \"playlists\": {\n \"items\": [\n {\n \"id\": 8,\n \"name\": \"radio\",\n \"path\": \"/music/srv/radio.m3u\",\n \"smart_playlist\": true,\n \"uri\": \"library:playlist:8\"\n }\n ],\n \"total\": 1,\n \"offset\": 0,\n \"limit\": -1\n }\n}\n</code></pre>"},{"location":"json-api/#add-an-item-to-the-library","title":"Add an item to the library","text":"<p>This endpoint currently only supports adding RSS feeds.</p> <p>Endpoint</p> <pre><code>POST /api/library/add\n</code></pre> <p>Query parameters</p> Parameter Value url URL of the RSS to add <p>Response</p> <p>On success returns the HTTP <code>200 OK</code> success status response code.</p> <p>Example</p> <pre><code>curl -X POST \"http://localhost:3689/api/library/add?url=http%3A%2F%2Fmyurl.com%2Flink.rss\"\n</code></pre>"},{"location":"json-api/#trigger-rescan","title":"Trigger rescan","text":"<p>Trigger a library rescan</p> <p>Endpoint</p> <pre><code>PUT /api/update\n</code></pre> <p>Response</p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p>Example</p> <pre><code>curl -X PUT \"http://localhost:3689/api/update\"\n</code></pre> <pre><code>{\n \"songs\": 217,\n \"db_playtime\": 66811,\n \"artists\": 9,\n \"albums\": 19,\n \"started_at\": \"2018-11-19T19:06:08Z\",\n \"updated_at\": \"2018-11-19T19:06:16Z\",\n \"updating\": false\n}\n</code></pre>"},{"location":"json-api/#trigger-metadata-rescan","title":"Trigger metadata rescan","text":"<p>Trigger a library metadata rescan even if files have not been updated. Maintenance method.</p> <p>Endpoint</p> <pre><code>PUT /api/rescan\n</code></pre> <p>Response</p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p>Example</p> <pre><code>curl -X PUT \"http://localhost:3689/api/rescan\"\n</code></pre>"},{"location":"json-api/#backup-db","title":"Backup DB","text":"<p>Request a library backup - configuration must be enabled and point to a valid writable path. Maintenance method.</p> <p>Endpoint</p> <pre><code>PUT /api/library/backup\n</code></pre> <p>Response</p> <p>On success returns the HTTP <code>200 OK</code> success status response code. If backups are not enabled returns HTTP <code>503 Service Unavailable</code> response code. Otherwise a HTTP <code>500 Internal Server Error</code> response is returned.</p> <p>Example</p> <pre><code>curl -X PUT \"http://localhost:3689/api/library/backup\"\n</code></pre>"},{"location":"json-api/#search","title":"Search","text":"Method Endpoint Description GET /api/search Search for playlists, artists, albums, tracks, genres, composers by a simple search term GET /api/search Search by complex query expression"},{"location":"json-api/#search-by-search-term","title":"Search by search term","text":"<p>Search for playlists, artists, albums, tracks, genres, composers that include the given query in their title (case insensitive matching).</p> <p>Endpoint</p> <pre><code>GET /api/search\n</code></pre> <p>Query parameters</p> Parameter Value query The search keyword type Comma separated list of the result types (<code>playlist</code>, <code>artist</code>, <code>album</code>, <code>track</code>, <code>genres</code>, <code>composers</code>) media_kind (Optional) Filter results by media kind (<code>music</code>, <code>movie</code>, <code>podcast</code>, <code>audiobook</code>, <code>musicvideo</code>, <code>tvshow</code>). Filter only applies to artist, album and track result types. offset (Optional) Offset of the first item to return for each type limit (Optional) Maximum number of items to return for each type <p>Response</p> Key Type Value tracks object <code>paging</code> object containing <code>track</code> objects that match the <code>query</code> artists object <code>paging</code> object containing <code>artist</code> objects that match the <code>query</code> albums object <code>paging</code> object containing <code>album</code> objects that match the <code>query</code> playlists object <code>paging</code> object containing <code>playlist</code> objects that match the <code>query</code> genres object <code>paging</code> object containing <code>browse-info</code> objects that match the <code>query</code> composers object <code>paging</code> object containing <code>browse-info</code> objects that match the <code>query</code> <p>Example</p> <p>Search for all tracks, artists, albums and playlists that contain \"the\" in their title and return the first two results for each type:</p> <pre><code>curl -X GET \"http://localhost:3689/api/search?type=tracks,artists,albums,playlists&amp;query=the&amp;offset=0&amp;limit=2\"\n</code></pre> <pre><code>{\n \"tracks\": {\n \"items\": [\n {\n \"id\": 35,\n \"title\": \"Another Love\",\n \"artist\": \"Tom Odell\",\n \"artist_sort\": \"Tom Odell\",\n \"album\": \"Es is was es is\",\n \"album_sort\": \"Es is was es is\",\n \"album_id\": \"6494853621007413058\",\n \"album_artist\": \"Various artists\",\n \"album_artist_sort\": \"Various artists\",\n \"album_artist_id\": \"8395563705718003786\",\n \"genre\": \"Singer/Songwriter\",\n \"year\": 2013,\n \"track_number\": 7,\n \"disc_number\": 1,\n \"length_ms\": 251030,\n \"play_count\": 0,\n \"media_kind\": \"music\",\n \"data_kind\": \"file\",\n \"path\": \"/music/srv/Compilations/Es is was es is/07 Another Love.m4a\",\n \"uri\": \"library:track:35\"\n },\n {\n \"id\": 215,\n \"title\": \"Away From the Sun\",\n \"artist\": \"3 Doors Down\",\n \"artist_sort\": \"3 Doors Down\",\n \"album\": \"Away From the Sun\",\n \"album_sort\": \"Away From the Sun\",\n \"album_id\": \"8264078270267374619\",\n \"album_artist\": \"3 Doors Down\",\n \"album_artist_sort\": \"3 Doors Down\",\n \"album_artist_id\": \"5030128490104968038\",\n \"genre\": \"Rock\",\n \"year\": 2002,\n \"track_number\": 2,\n \"disc_number\": 1,\n \"length_ms\": 233278,\n \"play_count\": 0,\n \"media_kind\": \"music\",\n \"data_kind\": \"file\",\n \"path\": \"/music/srv/Away From the Sun/02 Away From the Sun.mp3\",\n \"uri\": \"library:track:215\"\n }\n ],\n \"total\": 14,\n \"offset\": 0,\n \"limit\": 2\n },\n \"artists\": {\n \"items\": [\n {\n \"id\": \"8737690491750445895\",\n \"name\": \"The xx\",\n \"name_sort\": \"xx, The\",\n \"album_count\": 2,\n \"track_count\": 25,\n \"length_ms\": 5229196,\n \"uri\": \"library:artist:8737690491750445895\"\n }\n ],\n \"total\": 1,\n \"offset\": 0,\n \"limit\": 2\n },\n \"albums\": {\n \"items\": [\n {\n \"id\": \"8264078270267374619\",\n \"name\": \"Away From the Sun\",\n \"name_sort\": \"Away From the Sun\",\n \"artist\": \"3 Doors Down\",\n \"artist_id\": \"5030128490104968038\",\n \"track_count\": 12,\n \"length_ms\": 2818174,\n \"uri\": \"library:album:8264078270267374619\"\n },\n {\n \"id\": \"6835720495312674468\",\n \"name\": \"The Better Life\",\n \"name_sort\": \"Better Life\",\n \"artist\": \"3 Doors Down\",\n \"artist_id\": \"5030128490104968038\",\n \"track_count\": 11,\n \"length_ms\": 2393332,\n \"uri\": \"library:album:6835720495312674468\"\n }\n ],\n \"total\": 3,\n \"offset\": 0,\n \"limit\": 2\n },\n \"playlists\": {\n \"items\": [],\n \"total\": 0,\n \"offset\": 0,\n \"limit\": 2\n }\n}\n</code></pre>"},{"location":"json-api/#search-by-query-language","title":"Search by query language","text":"<p>Search for artists, albums, tracks by a smart playlist query expression (see Smart Playlists for the expression syntax).</p> <p>Endpoint</p> <pre><code>GET /api/search\n</code></pre> <p>Query parameters</p> Parameter Value expression The smart playlist query expression type Comma separated list of the result types (<code>artist</code>, <code>album</code>, <code>track</code> offset (Optional) Offset of the first item to return for each type limit (Optional) Maximum number of items to return for each type <p>Response</p> Key Type Value tracks object <code>paging</code> object containing <code>track</code> objects that matches the <code>query</code> artists object <code>paging</code> object containing <code>artist</code> objects that matches the <code>query</code> albums object <code>paging</code> object containing <code>album</code> objects that matches the <code>query</code> <p>Example</p> <p>Search for music tracks ordered descending by the time added to the library and limit result to 2 items:</p> <pre><code>curl -X GET \"http://localhost:3689/api/search?type=tracks&amp;expression=media_kind+is+music+order+by+time_added+desc&amp;offset=0&amp;limit=2\"\n</code></pre>"},{"location":"json-api/#server-info","title":"Server info","text":"Method Endpoint Description GET /api/config Get configuration information"},{"location":"json-api/#config","title":"Config","text":"<p>Endpoint</p> <pre><code>GET /api/config\n</code></pre> <p>Response</p> Key Type Value version string Server version websocket_port integer Port number for the websocket (or <code>0</code> if websocket is disabled) buildoptions array Array of strings indicating which features are supported by the server <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/config\"\n</code></pre> <pre><code>{\n \"websocket_port\": 3688,\n \"version\": \"25.0\",\n \"buildoptions\": [\n \"ffmpeg\",\n \"iTunes XML\",\n \"Spotify\",\n \"LastFM\",\n \"MPD\",\n \"Device verification\",\n \"Websockets\",\n \"ALSA\"\n ]\n}\n</code></pre>"},{"location":"json-api/#settings","title":"Settings","text":"Method Endpoint Description GET /api/settings Get all available categories GET /api/settings/{category-name} Get all available options for a category GET /api/settings/{category-name}/{option-name} Get a single setting option PUT /api/settings/{category-name}/{option-name} Change the value of a setting option DELETE /api/settings/{category-name}/{option-name} Reset a setting option to its default"},{"location":"json-api/#list-categories","title":"List categories","text":"<p>List all settings categories with their options</p> <p>Endpoint</p> <pre><code>GET /api/settings\n</code></pre> <p>Response</p> Key Type Value categories array Array of settings category objects <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/settings\"\n</code></pre> <pre><code>{\n \"categories\": [\n {\n \"name\": \"webinterface\",\n \"options\": [\n {\n \"name\": \"show_composer_now_playing\",\n \"type\": 1,\n \"value\": true\n },\n {\n \"name\": \"show_composer_for_genre\",\n \"type\": 2,\n \"value\": \"classical\"\n }\n ]\n }\n ]\n}\n</code></pre>"},{"location":"json-api/#get-a-category","title":"Get a category","text":"<p>Get a settings category with their options</p> <p>Endpoint</p> <pre><code>GET /api/settings/{category-name}\n</code></pre> <p>Response</p> <p>Returns a settings category object</p> <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/settings/webinterface\"\n</code></pre> <pre><code>{\n \"name\": \"webinterface\",\n \"options\": [\n {\n \"name\": \"show_composer_now_playing\",\n \"type\": 1,\n \"value\": true\n },\n {\n \"name\": \"show_composer_for_genre\",\n \"type\": 2,\n \"value\": \"classical\"\n }\n ]\n}\n</code></pre>"},{"location":"json-api/#get-an-option","title":"Get an option","text":"<p>Get a single settings option</p> <p>Endpoint</p> <pre><code>GET /api/settings/{category-name}/{option-name}\n</code></pre> <p>Response</p> <p>Returns a settings option object</p> <p>Example</p> <pre><code>curl -X GET \"http://localhost:3689/api/settings/webinterface/show_composer_now_playing\"\n</code></pre> <pre><code>{\n \"name\": \"show_composer_now_playing\",\n \"type\": 1,\n \"value\": true\n}\n</code></pre>"},{"location":"json-api/#change-an-option-value","title":"Change an option value","text":"<p>Get a single settings option</p> <p>Endpoint</p> <pre><code>PUT /api/settings/{category-name}/{option-name}\n</code></pre> <p>Request</p> Key Type Value name string Option name value (integer / boolean / string) New option value <p>Response</p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p>Example</p> <pre><code>curl -X PUT \"http://localhost:3689/api/settings/webinterface/show_composer_now_playing\" --data \"{\\\"name\\\":\\\"show_composer_now_playing\\\",\\\"value\\\":true}\"\n</code></pre>"},{"location":"json-api/#delete-an-option","title":"Delete an option","text":"<p>Delete a single settings option (thus resetting it to default)</p> <p>Endpoint</p> <pre><code>DELETE /api/settings/{category-name}/{option-name}\n</code></pre> <p>Response</p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p>Example</p> <pre><code>curl -X DELETE \"http://localhost:3689/api/settings/webinterface/show_composer_now_playing\"\n</code></pre>"},{"location":"json-api/#push-notifications","title":"Push notifications","text":"<p>If the server was built with websocket support it exposes a websocket at <code>localhost:3688</code> to inform clients of changes (e. g. player state or library updates). The port depends on the server configuration and can be read using the <code>/api/config</code> endpoint.</p> <p>After connecting to the websocket, the client should send a message containing the event types it is interested in. After that the server will send a message each time one of the events occurred.</p> <p>Message</p> Key Type Value notify array Array of event types <p>Event types</p> Type Description update Library update started or finished database Library database changed (new/modified/deleted tracks) outputs An output was enabled or disabled player Player state changes options Playback option changes (shuffle, repeat, consume mode) volume Volume changes queue Queue changes <p>Example</p> <pre><code>curl --include \\\n --no-buffer \\\n --header \"Connection: Upgrade\" \\\n --header \"Upgrade: websocket\" \\\n --header \"Host: localhost:3688\" \\\n --header \"Origin: http://localhost:3688\" \\\n --header \"Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==\" \\\n --header \"Sec-WebSocket-Version: 13\" \\\n --header \"Sec-WebSocket-Protocol: notify\" \\\n http://localhost:3688/ \\\n --data \"{ \\\"notify\\\": [ \\\"player\\\" ] }\"\n</code></pre> <pre><code>{ \n \"notify\": [\n \"player\"\n ]\n}\n</code></pre>"},{"location":"json-api/#objects","title":"Objects","text":""},{"location":"json-api/#album-object","title":"<code>album</code> object","text":"Key Type Value id string Album id name string Album name name_sort string Album sort name artist_id string Album artist id artist string Album artist name track_count integer Number of tracks length_ms integer Total length of tracks in milliseconds uri string Resource identifier artwork_url string (optional) Artwork url"},{"location":"json-api/#artist-object","title":"<code>artist</code> object","text":"Key Type Value id string Artist id name string Artist name name_sort string Artist sort name album_count integer Number of albums track_count integer Number of tracks length_ms integer Total length of tracks in milliseconds uri string Resource identifier artwork_url string (optional) Artwork url"},{"location":"json-api/#browse-info-object","title":"<code>browse-info</code> object","text":"Key Type Value name string Name (depends on the type of the query) name_sort string Sort name artist_count integer Number of artists album_count integer Number of albums track_count integer Number of tracks time_played string Timestamp in <code>ISO 8601</code> format time_added string Timestamp in <code>ISO 8601</code> format"},{"location":"json-api/#category-object","title":"<code>category</code> object","text":"Key Type Value name string Category name options array Array of option in this category"},{"location":"json-api/#directory-object","title":"<code>directory</code> object","text":"Key Type Value path string Directory path"},{"location":"json-api/#option-object","title":"<code>option</code> object","text":"Key Type Value name string Option name type integer The type of the value for this option (<code>0</code>: integer, <code>1</code>: boolean, <code>2</code>: string) value (integer / boolean / string) Current value for this option"},{"location":"json-api/#paging-object","title":"<code>paging</code> object","text":"Key Type Value items array Array of result objects total integer Total number of items offset integer Requested offset of the first item limit integer Requested maximum number of items"},{"location":"json-api/#playlist-object","title":"<code>playlist</code> object","text":"Key Type Value id string Playlist id name string Playlist name path string Path parent_id integer Playlist id of the parent (folder) playlist type string Type of this playlist: <code>special</code>, <code>folder</code>, <code>smart</code>, <code>plain</code> smart_playlist boolean <code>true</code> if playlist is a smart playlist folder boolean <code>true</code> if it is a playlist folder uri string Resource identifier"},{"location":"json-api/#queue-item-object","title":"<code>queue item</code> object","text":"Key Type Value id string Item id position integer Position in the queue (starting with zero) track_id string Track id title string Title artist string Track artist name artist_sort string Track artist sort name album string Album name album_sort string Album sort name album_id string Album id album_artist string Album artist name album_artist_sort string Album artist sort name album_artist_id string Album artist id composer string Composer (optional) genre string Genre year integer Release year track_number integer Track number disc_number integer Disc number length_ms integer Track length in milliseconds media_kind string Media type of this track: <code>music</code>, <code>movie</code>, <code>podcast</code>, <code>audiobook</code>, <code>musicvideo</code>, <code>tvshow</code> data_kind string Data type of this track: <code>file</code>, <code>url</code>, <code>spotify</code>, <code>pipe</code> path string Path uri string Resource identifier artwork_url string (optional) Artwork url type string file (codec) type (ie mp3/flac/...) bitrate string file bitrate (ie 192/128/...) samplerate string file sample rate (ie 44100/48000/...) channel string file channel (ie mono/stereo/xx ch))"},{"location":"json-api/#track-object","title":"<code>track</code> object","text":"Key Type Value id integer Track id title string Title title_sort string Sort title artist string Track artist name artist_sort string Track artist sort name album string Album name album_sort string Album sort name album_id string Album id album_artist string Album artist name album_artist_sort string Album artist sort name album_artist_id string Album artist id composer string Track composer genre string Genre comment string Comment year integer Release year track_number integer Track number disc_number integer Disc number length_ms integer Track length in milliseconds rating integer Track rating (ranges from 0 to 100) play_count integer How many times the track was played skip_count integer How many times the track was skipped time_played string Timestamp in <code>ISO 8601</code> format time_skipped string Timestamp in <code>ISO 8601</code> format time_added string Timestamp in <code>ISO 8601</code> format date_released string Date in the format <code>yyyy-mm-dd</code> seek_ms integer Resume point in milliseconds (available only for podcasts and audiobooks) media_kind string Media type of this track: <code>music</code>, <code>movie</code>, <code>podcast</code>, <code>audiobook</code>, <code>musicvideo</code>, <code>tvshow</code> data_kind string Data type of this track: <code>file</code>, <code>url</code>, <code>spotify</code>, <code>pipe</code> path string Path uri string Resource identifier artwork_url string (optional) Artwork url usermark integer User review marking of track (ranges from 0) lyrics string The lyrics if found either as LRC or plain text"},{"location":"json-api/#artwork-urls","title":"Artwork urls","text":"<p>Artwork urls in <code>queue item</code>, <code>artist</code>, <code>album</code> and <code>track</code> objects can be either relative urls or absolute urls to the artwork image. Absolute artwork urls are pointing to external artwork images (e. g. for radio streams that provide artwork metadata), while relative artwork urls are served from the server.</p> <p>It is possible to add the query parameters <code>maxwidth</code> and/or <code>maxheight</code> to relative artwork urls, in order to get a smaller image (the server only scales down never up).</p> <p>Note that even if a relative artwork url attribute is present, it is not guaranteed to exist.</p>"},{"location":"library/","title":"Library","text":"<p>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 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\".</p> <p>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.</p> <p>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.</p> <p>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. You can do this by using \"Update library\" from the web interface.</p> <p>Symlinks are supported and dereferenced, but it is best to use them for directories only.</p> <p>Files starting with . (dot) and _ (underscore) are ignored.</p>"},{"location":"library/#pipes-for-eg-multiroom-with-shairport-sync","title":"Pipes (for e.g. multiroom with Shairport-sync)","text":"<p>Some programs, like for instance Shairport-sync, can be configured to output audio to a named pipe. If this pipe is placed in the library, OwnTone will automatically detect that it is there, and when there is audio being written to it, playback of the audio will be autostarted (and stopped).</p> <p>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 speakers you have selected (through Remote).</p> <p>The format of the audio being written to the pipe must be PCM16.</p> <p>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.</p> <p>Shairport-sync can write metadata to a pipe, and OwnTone can read this. 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\".</p>"},{"location":"library/#libraries-on-network-mounts","title":"Libraries on network mounts","text":"<p>Most network filesharing protocols do not offer notifications when the library is changed. So that means OwnTone cannot update its database in real time. Instead you can schedule a cron job to update the database.</p> <p>The first step in doing this is to add two entries to the 'directories' configuration item in owntone.conf:</p> <pre><code> directories = { \"/some/local/dir\", \"/your/network/mount/library\" }\n</code></pre> <p>Now you can make a cron job that runs this command:</p> <pre><code> touch /some/local/dir/trigger.init-rescan\n</code></pre> <p>When OwnTone detects a file with filename ending .init-rescan it will perform a bulk scan similar to the startup scan.</p> <p>Alternatively, you can force a metadata scan of the library even if the files have not changed by creating a filename ending <code>.meta-rescan</code>.</p>"},{"location":"library/#supported-formats","title":"Supported formats","text":"<p>OwnTone should support pretty much all audio formats. It relies on libav (or ffmpeg) to extract metadata and decode the files on the fly when the client doesn't support the format.</p> <p>Formats are attributed a code, so any new format will need to be explicitely added. Currently supported:</p> <ul> <li>MPEG4: mp4a, mp4v</li> <li>AAC: alac</li> <li>MP3 (and friends): mpeg</li> <li>FLAC: flac</li> <li>OGG VORBIS: ogg</li> <li>Musepack: mpc</li> <li>WMA: wma (WMA Pro), wmal (WMA Lossless), wmav (WMA video)</li> <li>AIFF: aif</li> <li>WAV: wav</li> <li>Monkey's audio: ape</li> </ul>"},{"location":"library/#troubleshooting-library-issues","title":"Troubleshooting library issues","text":"<p>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 playlists from OwnTone's database and initiate a fresh bulk scan. Pairing and speaker information will be kept. Only use this for troubleshooting, it is not necessary during normal operation.</p>"},{"location":"playlists/","title":"Playlists and Radio","text":"<p>OwnTone supports M3U and PLS playlists. Just drop your playlist somewhere in your library with an .m3u or .pls extension and it will pick it up.</p> <p>From the web interface, and some mpd clients, you can also create and modify playlists by saving the current queue. Click the \"Save\" button. Note that this requires that <code>allow_modifying_stored_playlists</code> is enabled in the configuration file, and that the server has write access to <code>default_playlist_directory</code>.</p> <p>If the playlist contains an http URL it will be added as an internet radio station, and the URL will be probed for Shoutcast (ICY) metadata. If the radio station provides artwork, OwnTone will download it during playback and send it to any remotes or AirPlay devices requesting it.</p> <p>Instead of downloading M3U's from your radio stations, you can also make an empty M3U file and insert links in it to the M3U's of your radio stations.</p> <p>Radio streams can only be played by OwnTone, so that means they will not be available to play in DAAP clients like iTunes.</p> <p>The server can import playlists from iTunes Music Library XML files. By default, metadata from our parsers is preferred over what's in the iTunes DB; use itunes_overrides = true if you prefer iTunes' metadata.</p> <p>OwnTone has support for smart playlists. How to create a smart playlist is documented in Smart playlists.</p> <p>If you're not satisfied with internet radio metadata that OwnTone shows, then you can read about tweaking it in Radio streams.</p>"},{"location":"smart-playlists/","title":"Smart Playlists","text":"<p>To add a smart playlist to the server, create a new text file with a filename ending with .smartpl; the filename doesn't matter, only the .smartpl ending does. The file must be placed somewhere in your library folder.</p>"},{"location":"smart-playlists/#syntax","title":"Syntax","text":"<p>The contents of a smart playlist must follow the syntax:</p> <pre><code>\"Playlist Name\" { expression }\n</code></pre> <p>There is exactly one smart playlist allowed for a .smartpl file.</p> <p>An expression consists of:</p> <pre><code>field-name operator operand\n</code></pre> <p>Where valid field-names (with their types) are:</p> <ul> <li><code>artist</code> (string)</li> <li><code>album_artist</code> (string)</li> <li><code>album</code> (string)</li> <li><code>title</code> (string)</li> <li><code>genre</code> (string)</li> <li><code>composer</code> (string)</li> <li><code>comment</code> (string)</li> <li><code>path</code> (string)</li> <li><code>type</code> (string)</li> <li><code>grouping</code> (string)</li> <li><code>data_kind</code> (enumeration)</li> <li><code>media_kind</code> (enumeration)</li> <li><code>play_count</code> (integer)</li> <li><code>skip_count</code> (integer)</li> <li><code>rating</code> (integer)</li> <li><code>year</code> (integer)</li> <li><code>compilation</code> (integer)</li> <li><code>track</code> (integer)</li> <li><code>disc</code> (integer)</li> <li><code>time_added</code> (date)</li> <li><code>time_modified</code> (date)</li> <li><code>time_played</code> (date)</li> <li><code>time_skipped</code> (date)</li> <li><code>random</code> (special)</li> <li><code>file_size</code> (integer)</li> </ul> <p>Valid operators include:</p> <ul> <li><code>is</code>, <code>includes</code>, <code>starts with</code>, <code>ends with</code> (string)</li> <li><code>&gt;</code>, <code>&lt;</code>, <code>&lt;=</code>, <code>&gt;=</code>, <code>=</code> (int)</li> <li><code>after</code>, <code>before</code> (date)</li> <li><code>is</code> (enumeration)</li> </ul> <p>The <code>is</code> operator must exactly match the field value, while the <code>includes</code> operator matches a substring. The <code>starts with</code> operator matches, if the value starts with the given prefix, and <code>ends with</code> matches the opposite. All these matches are case-insensitive.</p> <p>Valid operands include:</p> <ul> <li>\"string value\" (string)</li> <li>integer (int)</li> </ul> <p>Valid operands for the enumeration <code>data_kind</code> are:</p> <ul> <li><code>file</code></li> <li><code>url</code></li> <li><code>spotify</code></li> <li><code>pipe</code></li> </ul> <p>Valid operands for the enumeration <code>media_kind</code> are:</p> <ul> <li><code>music</code></li> <li><code>movie</code></li> <li><code>podcast</code></li> <li><code>audiobook</code></li> <li><code>tvshow</code></li> </ul> <p>Multiple expressions can be anded or ored together, using the keywords <code>OR</code> and <code>AND</code>. The unary not operator is also supported using the keyword <code>NOT</code>.</p> <p>It is possible to define the sort order and limit the number of items by adding an order clause and/or a limit clause after the last expression:</p> <pre><code>\"Playlist Name\" { expression ORDER BY field-name sort-direction LIMIT limit }\n</code></pre> <p>\"sort-direction\" is either <code>ASC</code> (ascending) or <code>DESC</code> (descending). \"limit\" is the maximum number of items.</p> <p>There is additionally a special <code>random</code> field-name that can be used in conjunction with <code>limit</code> to select a random number of items based on current expression.</p>"},{"location":"smart-playlists/#examples","title":"Examples","text":"<pre><code>\"techno\" {\n genre includes \"techno\"\n and artist includes \"zombie\"\n}\n</code></pre> <p>This would match songs by \"Rob Zombie\" or \"White Zombie\", as well as those with a genre of \"Techno-Industrial\" or \"Trance/Techno\", for example.</p> <pre><code>\"techno 2015\" {\n genre includes \"techno\"\n and artist includes \"zombie\"\n and not genre includes \"industrial\"\n}\n</code></pre> <p>This would exclude e. g. songs with the genre \"Techno-Industrial\".</p> <pre><code>\"Local music\" {\n data_kind is file\n and media_kind is music\n}\n</code></pre> <p>This would match all songs added as files to the library that are not placed under the folders for podcasts, audiobooks.</p> <pre><code>\"Unplayed podcasts and audiobooks\" {\n play_count = 0\n and (media_kind is podcast or media_kind is audiobook)\n}\n</code></pre> <p>This would match any podcast and audiobook file that was never played.</p> <pre><code>\"Recently added music\" {\n media_kind is music\n order by time_added desc\n limit 10\n}\n</code></pre> <p>This would match the last 10 music files added to the library.</p> <pre><code>\"Random 10 Rated Pop songs\" {\n rating &gt; 0 and\n genre is \"Pop\" and\n media_kind is music\n order by random desc\n limit 10\n}\n</code></pre> <p>This generates a random set of, maximum of 10, rated Pop music tracks every time the playlist is queried.</p>"},{"location":"smart-playlists/#date-operand-syntax","title":"Date Operand Syntax","text":"<p>One example of a valid date is a date in yyyy-mm-dd format:</p> <pre><code>\"Files added after January 1, 2004\" {\n time_added after 2004-01-01\n}\n</code></pre> <p>There are also some special date keywords:</p> <ul> <li><code>today</code>, <code>yesterday</code>, <code>this week</code>, <code>last week</code>, <code>last month</code>, <code>last year</code></li> </ul> <p>These dates refer to the start of that period; <code>today</code> means 00:00hrs of today, <code>this week</code> means current Monday 00:00hrs, <code>last week</code> means the previous Monday 00:00hrs, <code>last month</code> is the first day of the previous month at 00:00hrs etc.</p> <p>A valid date can also be made by applying an interval to a date. Intervals can be defined as <code>days</code>, <code>weeks</code>, <code>months</code>, <code>years</code>. As an example, a valid date might be:</p> <p><code>3 weeks before today</code> or <code>3 weeks ago</code></p> <p>Examples:</p> <pre><code>\"Recently Added\" {\n time_added after 2 weeks ago\n}\n</code></pre> <p>This matches all songs added in the last 2 weeks.</p> <pre><code>\"Recently played audiobooks\" {\n time_played after last week\n and media_kind is audiobook\n}\n</code></pre> <p>This matches all audiobooks played since the start of the last Monday 00:00AM.</p> <p>All dates, except for <code>YYYY-DD-HH</code>, are relative to the day of when the server evaluates the smartpl query; <code>time_added after today</code> run on a Monday would match against items added since Monday 00:00hrs and evaluating the same smartpl on Friday would only match against added on Friday 00:00hrs.</p> <p>Note that <code>time_added after 4 weeks ago</code> and <code>time_added after last month</code> are subtly different; the former is exactly 4 weeks ago (from today) whereas the latter is the first day of the previous month.</p>"},{"location":"smart-playlists/#differences-with-mt-daapd-smart-playlists","title":"Differences with MT-daapd Smart Playlists","text":"<p>The syntax is really close to the mt-daapd smart playlist syntax (see Multi-Threaded DAAP Daemon Code.</p> <p>Even this documentation is based on the document linked above.</p> <p>Some differences are:</p> <ul> <li>only one smart playlist per file</li> <li>the not operator must be placed before an expression and not before the operator</li> <li><code>||</code>, <code>&amp;&amp;</code>, <code>!</code> are not supported (use <code>or</code>, <code>and</code>, <code>not</code>)</li> <li>comments are not supported</li> </ul>"},{"location":"advanced/multiple-instances/","title":"Running Multiple Instances","text":"<p>To run multiple instances of OwnTone on a server, you should copy <code>/etc/owntone.conf</code> to <code>/etc/owntone-zone.conf</code> (for each <code>zone</code>) and modify the following to be unique across all instances:</p> <ul> <li> <p>the three port settings (<code>general</code> -&gt; <code>websocket_port</code>, <code>library</code> -&gt; <code>port</code>, and <code>mpd</code> -&gt; <code>port</code>)</p> </li> <li> <p>the database paths (<code>general</code> -&gt; <code>db_path</code>, <code>db_backup_path</code>, and <code>db_cache_path</code>)</p> </li> <li> <p>the service name (<code>library</code> -&gt; <code>name</code>).</p> </li> <li> <p>you probably also want to disable local output (set <code>audio</code> -&gt; <code>type = \"disabled\"</code>).</p> </li> </ul> <p>Then run <code>owntone -c /etc/owntone-zone.conf</code> to run owntone with the new zone configuration.</p> <p>OwnTone has a <code>systemd</code> template which lets you run this automatically on systems that use systemd. You can start or enable the service for a <code>zone</code> by <code>sudo systemctl start owntone@zone</code> and check that it is running with <code>sudo systemctl status owntone@zone</code>. Use <code>sudo systemctl enable owntone@zone</code> to get the service to start on reboot.</p>"},{"location":"advanced/outputs-alsa/","title":"ALSA","text":"<p>ALSA is one of the main output configuration options for local audio; when using ALSA you will typically let the system select the sound card on your machine as the <code>default</code> device/sound card - a mixer associated with the ALSA device is used for volume control. However if your machine has multiple sound cards and your system chooses the wrong playback device, you will need to manually select the card and mixer to complete the OwnTone configuration.</p>"},{"location":"advanced/outputs-alsa/#quick-introduction-to-alsa-devices","title":"Quick introduction to ALSA devices","text":"<p>ALSA devices can be addressed in a number ways but traditionally we have referred to them using the hardware prefix, card number and optionally device number with something like <code>hw:0</code> or <code>hw:0,1</code>. In ALSA configuration terms <code>card X, device Y</code> is known as <code>hw:X,Y</code>.</p> <p>ALSA has other prefixes for each card and most importantly <code>plughw</code>. The <code>plughw</code> performs transparent sample format and sample rate conversions and maybe a better choice for many users rather than <code>hw:</code> which would fail when provided unsupported audio formats/sample rates.</p> <p>Alternative ALSA names can be used to refer to physical ALSA devices and can be useful in a number of ways:</p> <ul> <li>more descriptive rather than being a card number</li> <li>consistent for USB numeration - USB ALSA devices may not have the same card number across reboots/reconnects</li> </ul> <p>The ALSA device information required for configuration the server can be determined using <code>aplay</code>, as described in the rest of this document, but OwnTone can also assist; when configured to log at <code>INFO</code> level the following information is provided during startup:</p> <pre><code>laudio: Available ALSA playback mixer(s) on hw:0 CARD=Intel (HDA Intel): 'Master' 'Headphone' 'Speaker' 'PCM' 'Mic' 'Beep'\nlaudio: Available ALSA playback mixer(s) on hw:1 CARD=E30 (E30): 'E30 '\nlaudio: Available ALSA playback mixer(s) on hw:2 CARD=Seri (Plantronics Blackwire 3210 Seri): 'Sidetone' 'Headset'\n</code></pre> <p>The <code>CARD=</code> string is the alternate ALSA name for the device and can be used in place of the traditional <code>hw:x</code> name.</p> <p>On this machine the server reports that it can see the onboard HDA Intel sound card and two additional sound cards: a Topping E30 DAC and a Plantronics Headset which are both USB devices. We can address the first ALSA device as <code>hw:0</code> or <code>hw:CARD=Intel</code> or <code>hw:Intel</code> or <code>plughw:Intel</code>, the second ALSA device as <code>hw:1</code> or <code>hw:E30</code> and so forth. The latter 2 devices being on USB will mean that <code>hw:1</code> may not always refer to <code>hw:E30</code> and thus in such a case using the alternate name is useful.</p>"},{"location":"advanced/outputs-alsa/#configuring-the-server","title":"Configuring the server","text":"<p>OwnTone can support a single ALSA device or multiple ALSA devices.</p> <pre><code># example audio section for server for a single sound card\naudio {\n nickname = \"Computer\"\n type = \"alsa\"\n\n card = \"hw:1\" # defaults to 'default'\n mixer = \"Analogue\" # defaults to 'PCM' or 'Master'\n mixer_device = \"hw:1\" # defaults to same as 'card' value\n}\n</code></pre> <p>Multiple devices can be made available to OwnTone using separate <code>alsa { .. }</code> sections.</p> <pre><code>audio {\n type = \"alsa\"\n}\n\nalsa \"hw:1\" {\n nickname = \"Computer\"\n mixer = \"Analogue\"\n mixer_device = \"hw:1\"\n}\n\nalsa \"hw:2\" {\n nickname = \"Second ALSA device\"\n}\n</code></pre> <p>NB: When introducing <code>alsa { .. }</code> section(s) the ALSA specific configuration in the <code>audio { .. }</code> section will be ignored.</p> <p>If there is only one sound card, verify if the <code>default</code> sound device is correct for playback, we will use the <code>aplay</code> utility.</p> <pre><code># generate some audio if you don't have a wav file to hand\nsox -n -c 2 -r 44100 -b 16 -C 128 /tmp/sine441.wav synth 30 sin 500-100 fade h 0.2 30 0.2\n\naplay -Ddefault /tmp/sine441.wav\n</code></pre> <p>If you can hear music played then you are good to use <code>default</code> for the server configuration. If you can not hear anything from the <code>aplay</code> firstly verify (using <code>alsamixer</code>) that the sound card is not muted. If the card is not muted AND there is no sound you can try the options below to determine the card and mixer for configuring the server.</p>"},{"location":"advanced/outputs-alsa/#automatically-determine-all-relevant-the-sound-card-information","title":"Automatically Determine ALL relevant the sound card information","text":"<p>As shown above, OwnTone can help, consider the information that logged:</p> <pre><code>laudio: Available ALSA playback mixer(s) on hw:0 CARD=Intel (HDA Intel): 'Master' 'Headphone' 'Speaker' 'PCM' 'Mic' 'Beep'\nlaudio: Available ALSA playback mixer(s) on hw:1 CARD=E30 (E30): 'E30 '\nlaudio: Available ALSA playback mixer(s) on hw:2 CARD=Seri (Plantronics Blackwire 3210 Seri): 'Sidetone' 'Headset'\n</code></pre> <p>Using the information above, we can see 3 sound cards that we could use with OwnTone with the first sound card having a number of separate mixer devices (volume control) for headphone and the internal speakers - we'll configure the server to use both these and also the E30 device. The server configuration for these multiple outputs would be:</p> <pre><code># using ALSA device alias where possible\n\nalsa \"hw:Intel\" {\n nickname = \"Computer - Speaker\"\n mixer = \"Speaker\"\n}\n\nalsa \"hw:Intel\" {\n nickname = \"Computer - Headphones\"\n mixer = \"Headphone\"\n}\n\nalsa \"plughw:E30\" {\n # this E30 device only support S32_LE so we can use the 'plughw' prefix to\n # add transparent conversion support of more common S16/S24_LE formats\n\n nickname = \"E30 DAC\"\n mixer = \"E30 \"\n mixer_device = \"hw:E30\"\n}\n</code></pre> <p>NB: it is troublesome to use <code>hw</code> or <code>plughw</code> ALSA addressing when running OwnTone on a machine with <code>pulseaudio</code> and if you wish to use refer to ALSA devices directly that you stop <code>pulseaudio</code>.</p>"},{"location":"advanced/outputs-alsa/#manually-determining-the-sound-cards-you-have-alsa-can-see","title":"Manually Determining the sound cards you have / ALSA can see","text":"<p>The example below is how I determined the correct sound card and mixer values for a Raspberry Pi that has an additional DAC card (hat) mounted. Of course using the log output from the server would have given the same results.</p> <p>Use <code>aplay -l</code> to list all the sound cards and their order as known to the system - you can have multiple <code>card X, device Y</code> entries; some cards can also have multiple playback devices such as the RPI's onboard sound card which feeds both headphone (card 0, device 0) and HDMI (card 0, device 1).</p> <pre><code>$ aplay -l\n\n**** List of PLAYBACK Hardware Devices ****\ncard 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]\n Subdevices: 6/7\n Subdevice #0: subdevice #0\n Subdevice #1: subdevice #1\n Subdevice #2: subdevice #2\n Subdevice #3: subdevice #3\n Subdevice #4: subdevice #4\n Subdevice #5: subdevice #5\n Subdevice #6: subdevice #6\ncard 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]\n Subdevices: 1/1\n Subdevice #0: subdevice #0\ncard 1: IQaudIODAC [IQaudIODAC], device 0: IQaudIO DAC HiFi pcm512x-hifi-0 []\n Subdevices: 1/1\n Subdevice #0: subdevice #0\n</code></pre> <p>On this machine we see the second sound card installed, an IQaudIODAC dac hat, and identified as <code>card 1 device 0</code>. This is the playback device we want to be used by the server.</p> <p><code>hw:1,0</code> is the IQaudIODAC that we want to use - we verify audible playback through that sound card using <code>aplay -Dhw:1 /tmp/sine441.wav</code>. If the card has only one device, we can simply refer to the sound card using <code>hw:X</code> so in this case where the IQaudIODAC only has one device, we can refer to this card as <code>hw:1</code> or <code>hw:1,0</code>.</p> <p>Use <code>aplay -L</code> to get more information about the PCM devices defined on the system.</p> <pre><code>$ aplay -L\n\nnull\n Discard all samples (playback) or generate zero samples (capture)\ndefault:CARD=ALSA\n bcm2835 ALSA, bcm2835 ALSA\n Default Audio Device\nsysdefault:CARD=ALSA\n bcm2835 ALSA, bcm2835 ALSA\n Default Audio Device\ndmix:CARD=ALSA,DEV=0\n bcm2835 ALSA, bcm2835 ALSA\n Direct sample mixing device\ndmix:CARD=ALSA,DEV=1\n bcm2835 ALSA, bcm2835 IEC958/HDMI\n Direct sample mixing device\ndsnoop:CARD=ALSA,DEV=0\n bcm2835 ALSA, bcm2835 ALSA\n Direct sample snooping device\ndsnoop:CARD=ALSA,DEV=1\n bcm2835 ALSA, bcm2835 IEC958/HDMI\n Direct sample snooping device\nhw:CARD=ALSA,DEV=0\n bcm2835 ALSA, bcm2835 ALSA\n Direct hardware device without any conversions\nhw:CARD=ALSA,DEV=1\n bcm2835 ALSA, bcm2835 IEC958/HDMI\n Direct hardware device without any conversions\nplughw:CARD=ALSA,DEV=0\n bcm2835 ALSA, bcm2835 ALSA\n Hardware device with all software conversions\nplughw:CARD=ALSA,DEV=1\n bcm2835 ALSA, bcm2835 IEC958/HDMI\n Hardware device with all software conversions\ndefault:CARD=IQaudIODAC\n IQaudIODAC, \n Default Audio Device\nsysdefault:CARD=IQaudIODAC\n IQaudIODAC, \n Default Audio Device\ndmix:CARD=IQaudIODAC,DEV=0\n IQaudIODAC, \n Direct sample mixing device\ndsnoop:CARD=IQaudIODAC,DEV=0\n IQaudIODAC, \n Direct sample snooping device\nhw:CARD=IQaudIODAC,DEV=0\n IQaudIODAC, \n Direct hardware device without any conversions\nplughw:CARD=IQaudIODAC,DEV=0\n IQaudIODAC, \n Hardware device with all software conversions\n</code></pre> <p>For the server configuration, we will use:</p> <pre><code>audio {\n nickname = \"Computer\"\n type = \"alsa\"\n card=\"hw:1\"\n # mixer=TBD\n # mixer_device=TBD\n}\n</code></pre>"},{"location":"advanced/outputs-alsa/#mixer-name","title":"Mixer name","text":"<p>Once you have the card number (determined from <code>aplay -l</code>) we can inspect/confirm the name of the mixer that can be used for playback (it may NOT be <code>PCM</code> as expected by the server). In this example, the card <code>1</code> is of interest and thus we use <code>-c 1</code> with the following command:</p> <pre><code>$ amixer -c 1 \nSimple mixer control 'DSP Program',0\n Capabilities: enum\n Items: 'FIR interpolation with de-emphasis' 'Low latency IIR with de-emphasis' 'High attenuation with de-emphasis' 'Fixed process flow' 'Ringing-less low latency FIR'\n Item0: 'Ringing-less low latency FIR'\nSimple mixer control 'Analogue',0\n Capabilities: pvolume\n Playback channels: Front Left - Front Right\n Limits: Playback 0 - 1\n Mono:\n Front Left: Playback 1 [100%] [0.00dB]\n Front Right: Playback 1 [100%] [0.00dB]\nSimple mixer control 'Analogue Playback Boost',0\n Capabilities: volume\n Playback channels: Front Left - Front Right\n Capture channels: Front Left - Front Right\n Limits: 0 - 1\n Front Left: 0 [0%] [0.00dB]\n Front Right: 0 [0%] [0.00dB]\n...\n</code></pre> <p>This card has multiple controls but we want to find a mixer control listed with a <code>pvolume</code> (playback) capability - in this case that mixer value required for the server configuration is called <code>Analogue</code>.</p> <p>For the server configuration, we will use:</p> <pre><code>audio {\n nickname = \"Computer\"\n type = \"alsa\"\n card=\"hw:1\"\n mixer=\"Analogue\"\n # mixer_device=TBD\n}\n</code></pre>"},{"location":"advanced/outputs-alsa/#mixer-device","title":"Mixer device","text":"<p>This is the name of the underlying physical device used for the mixer - it is typically the same value as the value of <code>card</code> in which case a value is not required by the server configuration. An example of when you want to change explicitly configure this is if you need to use a <code>dmix</code> device (see below).</p>"},{"location":"advanced/outputs-alsa/#handling-devices-that-cannot-concurrently-play-multiple-audio-streams","title":"Handling Devices that cannot concurrently play multiple audio streams","text":"<p>Some devices such as various RPI DAC boards (IQaudio DAC, Allo Boss DAC...) cannot have multiple streams opened at the same time/cannot play multiple sound files at the same time. This results in <code>Device or resource busy</code> errors. You can confirm if your sound card has this problem by using the example below once have determined the names/cards information as above.</p> <p>Using our <code>hw:1</code> device we try:</p> <pre><code># generate some audio\n$ sox -n -c 2 -r 44100 -b 16 -C 128 /tmp/sine441.wav synth 30 sin 500-100 fade h 0.2 30 0.2\n\n# attempt to play 2 files at the same time\n$ aplay -v -Dhw:1 /tmp/sine441.wav &amp;\nPlaying WAVE '/tmp/sine441.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo\nHardware PCM card 1 'IQaudIODAC' device 0 subdevice 0\nIts setup is:\n stream : PLAYBACK\n access : RW_INTERLEAVED\n format : S16_LE\n subformat : STD\n channels : 2\n rate : 44100\n exact rate : 44100 (44100/1)\n msbits : 16\n buffer_size : 22052\n period_size : 5513\n period_time : 125011\n tstamp_mode : NONE\n tstamp_type : MONOTONIC\n period_step : 1\n avail_min : 5513\n period_event : 0\n start_threshold : 22052\n stop_threshold : 22052\n silence_threshold: 0\n silence_size : 0\n boundary : 1445199872\n appl_ptr : 0\n hw_ptr : 0\n$ aplay -v -Dhw:1 /tmp/sine441.wav\naplay: main:788: audio open error: Device or resource busy\n</code></pre> <p>In this instance this device cannot open multiple streams - OwnTone can handle this situation transparently with some audio being truncated from the end of the current file as the server prepares to play the following track. If this handling is causing you problems you may wish to use ALSA's <code>dmix</code> functionally which provides a software mixing module. We will need to define a <code>dmix</code> component and configure the server to use that as it's sound card.</p> <p>The downside to the <code>dmix</code> approach will be the need to fix a sample rate (48000 being the default) for this software mixing module meaning any files that have a mismatched sample rate will be resampled.</p>"},{"location":"advanced/outputs-alsa/#alsa-dmix-configurationsetup","title":"ALSA dmix configuration/setup","text":"<p>A <code>dmix</code> device can be defined in <code>/etc/asound.conf</code> or <code>~/.asoundrc</code> for the same user running OwnTone. We will need to know the underlying physical sound card to be used: in our examples above, <code>hw:1,0</code> / <code>card 1, device 0</code> representing our IQaudIODAC as per output of <code>aplay -l</code>. We also take the <code>buffer_size</code> and <code>period_size</code> from the output of playing a sound file via <code>aplay -v</code>.</p> <pre><code># use 'dac' as the name of the device: \"aplay -Ddac ....\"\npcm.!dac {\n type plug\n slave.pcm \"dmixer\"\n hint.description \"IQAudio DAC s/w dmix enabled device\"\n}\n\npcm.dmixer {\n type dmix\n ipc_key 1024 # need to be uniq value\n ipc_key_add_uid false # multiple concurrent different users\n ipc_perm 0666 # multi-user sharing permissions\n\n slave {\n pcm \"hw:1,0\" # points at the underlying device - could also simply be hw:1\n period_time 0\n period_size 4096 # from the output of aplay -v\n buffer_size 22052 # from the output of aplay -v\n rate 44100 # locked in sample rate for resampling on dmix device\n }\n hint.description \"IQAudio DAC s/w dmix device\"\n}\n\nctl.dmixer {\n type hw\n card 1 # underlying device\n device 0\n}\n</code></pre> <p>Running <code>aplay -L</code> we will see our newly defined devices <code>dac</code> and <code>dmixer</code></p> <pre><code>$ aplay -L\nnull\n Discard all samples (playback) or generate zero samples (capture)\ndac\n IQAudio DAC s/w dmix enabled device\ndmixer\n IQAudio DAC s/w dmix device\ndefault:CARD=ALSA\n bcm2835 ALSA, bcm2835 ALSA\n Default Audio Device\n...\n</code></pre> <p>At this point we are able to rerun the concurrent <code>aplay</code> commands (adding <code>-Ddac</code> to specify the playback device to use) to verify ALSA configuration.</p> <p>If there is only one card on the machine you may use <code>pcm.!default</code> instead of <code>pcm.!dac</code> - there is less configuration to be done later since many ALSA applications will use the device called <code>default</code> by default. Furthermore on RPI you can explicitly disable the onboard sound card to leave us with only the IQaudIODAC board enabled (won't affect HDMI sound output) by commenting out <code>#dtparam=audio=on</code> in <code>/boot/config.txt</code> and rebooting.</p>"},{"location":"advanced/outputs-alsa/#config-with-dmix","title":"Config with dmix","text":"<p>We will use the newly defined card named <code>dac</code> which uses the underlying <code>hw:1</code> device as per <code>/etc/asound.conf</code> or <code>~/.asoundrc</code> configuration. Note that the <code>mixer_device</code> is now required and must refer to the real device (see the <code>slave.pcm</code> value) and not the named device (ie <code>dac</code>) that we created and are using for the <code>card</code> configuration value.</p> <p>For the final server configuration, we will use:</p> <pre><code>audio {\n nickname = \"Computer\"\n type = \"alsa\"\n card=\"dac\"\n mixer=\"Analogue\"\n mixer_device=\"hw:1\"\n}\n</code></pre>"},{"location":"advanced/outputs-alsa/#setting-up-an-audio-equalizer","title":"Setting up an Audio Equalizer","text":"<p>There exists an ALSA equalizer plugin. On <code>debian</code> (incl Raspberry Pi) systems you can install this plugin by <code>apt install libasound2-plugin-equal</code>; this is not currently available on Fedora (FC31) but can be easily built from source after installing the dependant <code>ladspa</code> package.</p> <p>Once installed the user must setup a virtual device and use this device in the server configuration.</p> <p>If you wish to use your <code>hw:0</code> device for output:</p> <pre><code># /etc/asound.conf\nctl.equal {\n type equal;\n\n # library /usr/lib64/ladspa/caps.so\n}\n\npcm.equal {\n type plug;\n slave.pcm {\n type equal;\n\n ## must be plughw:x,y and not hw:x,y\n slave.pcm \"plughw:0,0\";\n\n # library /usr/lib64/ladspa/caps.so\n }\n hint.description \"equalised device\"\n}\n</code></pre> <p>and in <code>owntone.conf</code></p> <pre><code>alsa \"equal\" {\n nickname = \"Equalised Output\"\n # adjust accordingly for mixer with pvolume capability\n mixer = \"PCM\"\n mixer_device = \"hw:0\"\n}\n</code></pre> <p>Using the web UI and on the outputs selection you should see an output called <code>Equalised Output</code> which you should select and set the volume.</p> <p>When starting playback for any audio tracks you should hopefully hear the output. In a terminal, run <code>alsamixer -Dequal</code> and you'll see the eqaliser - to test that this is all working, go and drop the upper frequencies and boosting the bass frequencies and give it a second - if this changes the sound profile from your speakers, well done, its done and you can adjust the equalizer as you desire.</p> <p>Note however, the equalizer appears to require a <code>plughw</code> device which means you cannnot use this equalizer with a <code>dmix</code> output chain.</p>"},{"location":"advanced/outputs-alsa/#troubleshooting","title":"Troubleshooting","text":"<ul> <li>Errors in log <code>Failed to open configured mixer element</code> when selecting output device</li> <li> <p>Errors in log <code>Invalid CTL</code> or <code>Failed to attach mixer</code> when playing/adjusting volume</p> <p><code>mixer</code> value is wrong. Verify name of <code>mixer</code> value in server config against the names from all devices capable of playback using <code>amixer -c &lt;card number&gt;</code>. Assume the device is card 1:</p> <pre><code>(IFS=$'\\n'\n CARD=1\n for i in $(amixer -c ${CARD} scontrols | awk -F\\' '{ print $2 }'); do \n amixer -c ${CARD} sget \"$i\" | grep Capabilities | grep -q pvolume &amp;&amp; echo $i\n done\n)\n</code></pre> <p>Look at the names output and choose the one that fits. The outputs can be something like:</p> <pre><code># laptop\nMaster\nHeadphone\nSpeaker\nPCM\nMic\nBeep\n\n# RPI with no additional DAC, card = 0\nPCM\n\n# RPI with additional DAC hat (IQAudioDAC, using a pcm512x chip)\nAnalogue\nDigital\n</code></pre> </li> <li> <p>No sound during playback - valid mixer/verified by aplay</p> <p>Check that the mixer is not muted or volume set to 0. Using the value of <code>mixer</code> as per server config and unmute or set volume to max. Assume the device is card 1 and <code>mixer = Analogue</code>:</p> <pre><code>amixer -c 1 set Analogue unmute ## some mixers can not be muted resulting in \"invalid command\"\namixer -c 1 set Analogue 100%\n</code></pre> <p>An example of a device with volume turned all the way down - notice the <code>Playback</code> values are <code>0</code>[0%]`:</p> <pre><code>Simple mixer control 'Analogue',0\nCapabilities: pvolume\nPlayback channels: Front Left - Front Right\nLimits: Playback 0 - 1\nMono:\nFront Left: Playback 0 [0%] [-6.00dB]\nFront Right: Playback 0 [0%] [-6.00dB]\n</code></pre> </li> <li> <p>Server stops playing after moving to new track in paly queue, Error in log <code>Could not open playback device</code> The log contains these log lines:</p> <pre><code>[2019-06-19 20:52:51] [ LOG] laudio: open '/dev/snd/pcmC0D0p' failed (-16)[2019-06-19 20:52:51] [ LOG] laudio: Could not open playback device: Device or resource busy\n[2019-06-19 20:52:51] [ LOG] laudio: Device 'hw' does not support quality (48000/16/2), falling back to default\n[2019-06-19 20:52:51] [ LOG] laudio: open '/dev/snd/pcmC0D0p' failed (-16)[2019-06-19 20:52:51] [ LOG] laudio: Could not open playback device: Device or resource busy\n[2019-06-19 20:52:51] [ LOG] laudio: ALSA device failed setting fallback quality[2019-06-19 20:52:51] [ LOG] player: The ALSA device 'Computer' FAILED\n</code></pre> <p>If you have a RPI with a DAC hat with a <code>pcm512x</code> chip will affect you. This is because the server wants to open the audio device for the next audio track whilst current track is still playing but the hardware does not allow this - see the comments above regarding determining concurrrent playback.</p> <p>This error will occur for output hardware that do not support concurrent device open and the server plays 2 files of different bitrate (44.1khz and 48khz) back to back.</p> <p>If you observe the error, you will need to use the <code>dmix</code> configuration as mentioned above.</p> </li> </ul>"},{"location":"advanced/outputs-pulse/","title":"PulseAudio","text":"<p>You have the choice of running PulseAudio either in system mode or user mode. For headless servers, i.e. systems without desktop users, system mode is recommended.</p> <p>If there is a desktop user logged in most of the time, a setup with network access via localhost only for daemons is a more appropriate solution, since the normal user administration (with, e.g., <code>pulseaudio -k</code>) works as advertised. Also, the user specific configuration for PulseAudio is preserved across sessions as expected.</p> <ul> <li>System mode</li> <li>User mode</li> </ul>"},{"location":"advanced/outputs-pulse/#system-mode-with-bluetooth-support","title":"System Mode with Bluetooth support","text":"<p>Credit: Rob Pope</p> <p>This guide was written based on headless Debian Jessie platforms. Most of the instructions will require that you are root.</p>"},{"location":"advanced/outputs-pulse/#step-1-setting-up-pulseaudio","title":"Step 1: Setting up PulseAudio","text":"<p>If you see a \"Connection refused\" error when starting the server, then you will probably need to setup PulseAudio to run in system mode [1]. This means that the PulseAudio daemon will be started during boot and be available to all users.</p> <p>How to start PulseAudio depends on your distribution, but in many cases you will need to add a <code>pulseaudio.service</code> file to <code>/etc/systemd/system</code> with the following content:</p> <pre><code># systemd service file for PulseAudio running in system mode\n[Unit]\nDescription=PulseAudio sound server\nBefore=sound.target\n\n[Service]\nExecStart=/usr/bin/pulseaudio --system --disallow-exit\n\n[Install]\nWantedBy=multi-user.target\n</code></pre> <p>If you want Bluetooth support, you must also configure PulseAudio to load the Bluetooth module. First install it (Debian: <code>apt install pulseaudio-module-bluetooth</code>) and then add the following to /etc/pulse/system.pa:</p> <pre><code>#### Enable Bluetooth\n.ifexists module-bluetooth-discover.so\nload-module module-bluetooth-discover\n.endif\n</code></pre> <p>Now you need to make sure that PulseAudio can communicate with the Bluetooth daemon through D-Bus. On Raspbian this is already enabled, and you can skip this step. Otherwise do one of the following:</p> <ol> <li>Add the pulse user to the bluetooth group: <code>adduser pulse bluetooth</code></li> <li>Edit /etc/dbus-1/system.d/bluetooth.conf and change the policy for <code>&lt;policy context=\"default\"\\&gt;</code> to \"allow\"</li> </ol> <p>Phew, almost done with PulseAudio! Now you should:</p> <ol> <li>enable system mode on boot with <code>systemctl enable pulseaudio</code></li> <li>reboot (or at least restart dbus and pulseaudio)</li> <li>check that the Bluetooth module is loaded with <code>pactl list modules short</code></li> </ol>"},{"location":"advanced/outputs-pulse/#step-2-setting-up-the-server","title":"Step 2: Setting up the server","text":"<p>Add the user the server is running as (typically \"owntone\") to the \"pulse-access\" group:</p> <pre><code>adduser owntone pulse-access\n</code></pre> <p>Now (re)start the server.</p>"},{"location":"advanced/outputs-pulse/#step-3-adding-a-bluetooth-device","title":"Step 3: Adding a Bluetooth device","text":"<p>To connect with the device, run <code>bluetoothctl</code> and then:</p> <pre><code>power on\nagent on\nscan on\n**Note MAC address of BT Speaker**\npair [MAC address]\n**Type Pin if prompted**\ntrust [MAC address]\nconnect [MAC address]\n</code></pre> <p>Now the speaker should appear. You can also verify that PulseAudio has detected the speaker with <code>pactl list sinks short</code>.</p>"},{"location":"advanced/outputs-pulse/#user-mode-with-network-access","title":"User Mode with Network Access","text":"<p>Credit: wolfmanx and this blog</p>"},{"location":"advanced/outputs-pulse/#step-1-copy-system-pulseaudio-configuration-to-the-users-home-directory","title":"Step 1: Copy system pulseaudio configuration to the users home directory","text":"<pre><code>mkdir -p ~/.pulse\ncp /etc/pulse/default.pa ~/.pulse/\n</code></pre>"},{"location":"advanced/outputs-pulse/#step-2-enable-tcp-access-from-localhost-only","title":"Step 2: Enable TCP access from localhost only","text":"<p>Edit the file <code>~/.pulse/default.pa</code> , adding the following line at the end:</p> <pre><code>load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1\n</code></pre>"},{"location":"advanced/outputs-pulse/#step-3-restart-the-pulseaudio-daemon","title":"Step 3: Restart the PulseAudio daemon","text":"<pre><code>pulseaudio -k\n# OR\npulseaudio -D\n</code></pre>"},{"location":"advanced/outputs-pulse/#step-4-adjust-the-configuration-file","title":"Step 4: Adjust the Configuration File","text":"<p>In the <code>audio</code> section of <code>/etc/owntone.conf</code>, set <code>server</code> to <code>localhost</code>:</p> <pre><code>server = \"localhost\"\n</code></pre> <p>[1] Note that PulseAudio will warn against system mode. However, in this use case it is actually the solution recommended by the PulseAudio folks themselves.</p>"},{"location":"advanced/radio-streams/","title":"Radio Streams","text":"<p>Radio streams have many different ways in how metadata is sent. Many should just work as expected, but a few may require some tweaking. If you are not seeing expected title, track, artist, artwork in clients or web UI, the following may help.</p> <p>First, understand what and how the particular stream is sending information. <code>ffprobe</code> is a command that can be used to integrate most of the stream information. <code>ffprobe &lt;http://stream.url&gt;</code> should give you some useful output, look at the Metadata section, below is an example.</p> <pre><code> Metadata:\n icy-br : 320\n icy-description : DJ-mixed blend of modern and classic rock, electronica, world music, and more. Always 100% commercial-free\n icy-genre : Eclectic\n icy-name : Radio Paradise (320k aac)\n icy-pub : 1\n icy-url : https://radioparadise.com\n StreamTitle : Depeche Mode - Strangelove\n StreamUrl : http://img.radioparadise.com/covers/l/B000002LCI.jpg\n</code></pre> <p>In the example above, all tags are populated with correct information, no modifications to the server configuration should be needed. Note that StreamUrl points to the artwork image file.</p> <p>Below is another example that will require some tweaks to the server, Notice <code>icy-name</code> is blank and <code>StreamUrl</code> doesn't point to an image.</p> <pre><code>Metadata:\n icy-br : 127\n icy-pub : 0\n icy-description : Unspecified description\n icy-url : \n icy-genre : various\n icy-name : \n StreamTitle : Pour Some Sugar On Me - Def Leppard\n StreamUrl : https://radio.stream.domain/api9/eventdata/49790578\n</code></pre> <p>In the above, first fix is the blank name, second is the image artwork.</p>"},{"location":"advanced/radio-streams/#1-set-stream-nametitle-via-the-m3u-file","title":"1) Set stream name/title via the M3U file","text":"<p>Set the name with an EXTINF tag in the m3u playlist file:</p> <pre><code>#EXTM3U\n#EXTINF:-1, - My Radio Stream Name\nhttp://radio.stream.domain/stream.url\n</code></pre> <p>The format is basically <code>#EXTINF:&lt;length&gt;, &lt;Artist Name&gt; - &lt;Artist Title&gt;</code>. Length is -1 since it's a stream, <code>&lt;Artist Name&gt;</code> was left blank since <code>StreamTitle</code> is accurate in the Metadata but <code>&lt;Artist Title&gt;</code> was set to <code>My Radio Stream Name</code> since <code>icy-name</code> was blank.</p>"},{"location":"advanced/radio-streams/#2-streamurl-is-a-json-file-with-metadata","title":"2) StreamUrl is a JSON file with metadata","text":"<p>If <code>StreamUrl</code> does not point directly to an artwork file then the link may be to a json file that contains an artwork link. If so, you can make the server download the file automatically and search for an artwork link, and also track duration.</p> <p>Try to download the file, e.g. with <code>curl \"https://radio.stream.domain/api9/eventdata/49790578\"</code>. Let's assume you get something like this:</p> <pre><code>{\n \"eventId\": 49793707,\n \"eventStart\": \"2020-05-08 16:23:03\",\n \"eventFinish\": \"2020-05-08 16:27:21\",\n \"eventDuration\": 254,\n \"eventType\": \"Song\",\n \"eventSongTitle\": \"Pour Some Sugar On Me\",\n \"eventSongArtist\": \"Def Leppard\",\n \"eventImageUrl\": \"https://radio.stream.domain/artist/1-1/320x320/562.jpg?ver=1465083491\",\n \"eventImageUrlSmall\": \"https://radio.stream.domain/artist/1-1/160x160/562.jpg?ver=1465083491\",\n \"eventAppleMusicUrl\": \"https://geo.itunes.apple.com/dk/album/530707298?i=530707313\"\n}\n</code></pre> <p>In this case, you would need to tell the server to look for \"eventDuration\" and \"eventImageUrl\" (or just \"duration\" and \"url\"). You can do that like this:</p> <pre><code>curl -X PUT \"http://localhost:3689/api/settings/misc/streamurl_keywords_length\" --data \"{\\\"name\\\":\\\"streamurl_keywords_length\\\",\\\"value\\\":\\\"duration\\\"}\"\ncurl -X PUT \"http://localhost:3689/api/settings/misc/streamurl_keywords_artwork_url\" --data \"{\\\"name\\\":\\\"streamurl_keywords_artwork_url\\\",\\\"value\\\":\\\"url\\\"}\n</code></pre> <p>If you want multiple search phrases then comma separate, e.g. \"duration,length\".</p>"},{"location":"advanced/radio-streams/#3-set-metadata-with-a-custom-script","title":"3) Set metadata with a custom script","text":"<p>If your radio station publishes metadata via another method than the above, e.g. just on their web site, then you will have to write a script that pulls the metadata and then pushes it to the server. To update metadata for the currently playing radio station use something like this JSON API request:</p> <pre><code>curl -X PUT \"http://localhost:3689/api/queue/items/now_playing?title=Awesome%20title&amp;artwork_url=http%3A%2F%2Fgyfgafguf.dk%2Fimages%2Fpige3.jpg\"\n</code></pre> <p>If your radio station is not returning any artwork links, you can also just make a static artwork by placing a png/jpg in the same directory as the m3u, and with the same name, e.g. <code>My Radio Stream.jpg</code> for <code>My Radio Stream.m3u</code>.</p>"},{"location":"advanced/remote-access/","title":"Remote Access","text":"<p>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.</p> <p>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:</p> <pre><code>dns-sd -P iTunesServer _daap._tcp local 3689 localhost.local 127.0.0.1 \"ffid=12345\"\n</code></pre> <p>The <code>ffid</code> key is required but its value does not matter.</p> <p>Your library will now appear as 'iTunesServer' in iTunes.</p> <p>You can also access your library remotely using something like Zerotier. See this guide for details.</p>"},{"location":"advanced/remote-access/#accessing-from-internet-for-authenticated-users","title":"Accessing from Internet for authenticated users","text":"<p>If you intend to access OwnTone directly from Internet, it is recommended to protect it against unauthenticated users.</p> <p>This guide has a detailed setup tutorial to achieve this securely.</p>"},{"location":"clients/cli/","title":"Command Line","text":"<p>You can choose between:</p> <ul> <li>a MPD command line client (easiest) like <code>mpc</code></li> <li>curl with OwnTone's JSON API (see JSON API docs)</li> <li>curl with DAAP/DACP commands (hardest)</li> </ul> <p>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:</p> <ol> <li>Run <code>sqlite3 [your OwnTone db]</code>. Use <code>select id,title from files</code> to get the id of the radio station, and use <code>select id,title from playlists</code> to get the id of the playlist.</li> <li>Convert the two ids to hex.</li> <li>Put the following lines in the script with the relevant ids inserted (also observe that you must use a session-id &lt; 100, and that you must login and logout):</li> </ol> <pre><code>curl \"http://localhost:3689/login?pairing-guid=0x1&amp;request-session-id=50\"\ncurl \"http://localhost:3689/ctrl-int/1/playspec?database-spec='dmap.persistentid:0x1'&amp;container-spec='dmap.persistentid:0x[PLAYLIST-ID]'&amp;container-item-spec='dmap.containeritemid:0x[FILE ID]'&amp;session-id=50\"\ncurl \"http://localhost:3689/logout?session-id=50\"\n</code></pre>"},{"location":"clients/mpd/","title":"MPD Clients","text":"<p>You can - to some extent - use clients for MPD to control OwnTone.</p> <p>By default OwnTone listens on port 6600 for MPD clients. You can change this in the configuration file.</p> <p>Currently only a subset of the commands offered by MPD (see MPD Protocol) are supported.</p> <p>Due to some differences between OwnTone and MPD not all commands will act the same way they would running MPD:</p> <ul> <li>crossfade, mixrampdb, mixrampdelay and replaygain will have no effect</li> <li>single, repeat: unlike MPD, OwnTone does not support setting single and repeat separately 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.</li> </ul> <p>The following table shows what is working for a selection of MPD clients:</p> Client Type Status 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 Web Everything except \"add stream\" should work"},{"location":"clients/remote/","title":"Using Remote","text":"<p>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, \u2026 It also includes the local audio output, that is, the sound card on the server (even if there is no sound card).</p> <p>OwnTone remembers your selection and the individual volume for each output device; selected devices will be automatically re-selected, except if they return online during playback.</p>"},{"location":"clients/remote/#pairing","title":"Pairing","text":"<ol> <li>Open the web interface</li> <li>Start Remote, go to Settings, Add Library</li> <li>Enter the pair code in the web interface (reload the browser page if it does not automatically pick up the pairing request)</li> </ol> <p>If Remote does not connect to OwnTone after you entered the pairing code something went wrong. Check the log file to see the error message. Here are some common reasons:</p> <ul> <li>You did not enter the correct pairing code</li> </ul> <p>You will see an error in the log about pairing failure with a HTTP response code that is not 0.</p> <p>Solution: Try again.</p> <ul> <li>No response from Remote, possibly a network issue</li> </ul> <p>If you see an error in the log with either:</p> <ul> <li>a HTTP response code that is 0</li> <li>\"Empty pairing request callback\"</li> </ul> <p>it means that OwnTone could not establish a connection to Remote. This might be a network issue, your router may not be allowing multicast between the Remote device and the host OwnTone is running on.</p> <p>Solution 1: Sometimes it resolves the issue if you force Remote to quit, restart it and do the pairing process again. Another trick is to establish some other connection (eg SSH) from the iPod/iPhone/iPad to the host.</p> <p>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.</p> <ul> <li> <p>Otherwise try using <code>avahi-browse</code> for troubleshooting:</p> </li> <li> <p>in a terminal, run:</p> <pre><code>avahi-browse -r -k _touch-remote._tcp\n</code></pre> </li> <li> <p>start Remote, goto Settings, Add Library</p> </li> <li> <p>after a couple seconds at most, you should get something similar to this:</p> <pre><code>+ ath0 IPv4 59eff13ea2f98dbbef6c162f9df71b784a3ef9a3 _touch-remote._tcp local\n= ath0 IPv4 59eff13ea2f98dbbef6c162f9df71b784a3ef9a3 _touch-remote._tcp local\n hostname = [Foobar.local]\n address = [192.168.1.1]\n port = [49160]\n txt = [\"DvTy=iPod touch\" \"RemN=Remote\" \"txtvers=1\" \"RemV=10000\" \"Pair=FAEA410630AEC05E\" \"DvNm=Foobar\"]\n</code></pre> <p>Hit Ctrl+C to terminate <code>avahi-browse</code>.</p> </li> <li> <p>To check for network issues you can try to connect to the server address and port with <code>nc</code> or <code>telnet</code> commands.</p> </li> </ul>"},{"location":"clients/supported-clients/","title":"Supported Clients","text":"<p>OwnTone supports these kinds of clients:</p> <ul> <li>DAAP clients, like iTunes or Rhythmbox</li> <li>Remote clients, like Apple Remote or compatibles for Android/Windows Phone</li> <li>AirPlay devices, like AirPort Express, Shairport and various AirPlay speakers</li> <li>Chromecast devices</li> <li>MPD clients, like mpc</li> <li>MP3 network stream clients, like VLC and almost any other music player</li> <li>RSP clients, like Roku Soundbridge</li> </ul> <p>Like iTunes, you can control OwnTone with Remote and stream your music to AirPlay devices.</p> <p>A single OwnTone instance can handle several clients concurrently, regardless of the protocol.</p> <p>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.</p> <p>Here is a list of working and non-working DAAP and Remote clients. The list is probably obsolete when you read it :-)</p> Client Developer Type Platform Working (vers.) iTunes Apple DAAP Win Yes (12.10.1) Apple Music Apple DAAP macOS Yes 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/macOS 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)"},{"location":"clients/web-interface/","title":"Web Interface","text":"<p>The web interface is a mobile-friendly music player and browser for OwnTone.</p> <p>You can reach it at http://owntone.local:3689 or depending on the OwnTone installation at <code>http://&lt;server-address&gt;:&lt;port&gt;</code>.</p> <p>This interface becomes useful when you need to control playback, trigger manual library rescans, pair with remotes, select speakers, grant access to Spotify, and for many other operations.</p>"},{"location":"clients/web-interface/#screenshots","title":"Screenshots","text":"<p>Below you have a selection of screenshots that shows different part of the interface.</p> <p> </p>"},{"location":"clients/web-interface/#usage","title":"Usage","text":"<p>The web interface is usually reachable at http://owntone.local:3689. But depending on the setup of OwnTone you might need to adjust the server name and port of the server accordingly <code>http://&lt;server-name&gt;:&lt;port&gt;</code>.</p>"},{"location":"clients/web-interface/#building-and-serving","title":"Building and Serving","text":"<p>The web interface is built with Vite and Bulma.</p> <p>Its source code is located in the <code>web-src</code> folder and therefore all <code>npm</code> commands must be run under this folder.</p> <p>To switch to this folder, run the command hereafter.</p> <pre><code>cd web-src\n</code></pre>"},{"location":"clients/web-interface/#dependencies-installation","title":"Dependencies Installation","text":"<p>First of all, the dependencies to libraries must be installed with the command below.</p> <pre><code>npm install\n</code></pre> <p>Once the libraries installed, you can either build, format, and lint the source code, or serve the web interface locally.</p>"},{"location":"clients/web-interface/#source-code-building","title":"Source Code Building","text":"<p>The following command builds the web interface for production with minification and stores it under the folder <code>../htdocs</code>.</p> <pre><code>npm run build\n</code></pre>"},{"location":"clients/web-interface/#source-code-formatting","title":"Source Code Formatting","text":"<p>The source code follows certain formatting conventions for maintainability and readability. To ensure that the source code follows these conventions, Prettier is used.</p> <p>The command below applies formatting conventions to the source code based on a preset configuration. Note that a additional configuration is made in the file <code>.prettierrc.json</code>.</p> <pre><code>npm run format\n</code></pre>"},{"location":"clients/web-interface/#source-code-linting","title":"Source Code Linting","text":"<p>In order to flag programming errors, bugs, stylistic errors and suspicious constructs in the source code, ESLint is used.</p> <p>Note that ESLint has been configured following this guide.</p> <p>The following command lints the source code and fixes all automatically fixable errors.</p> <pre><code>npm run lint\n</code></pre>"},{"location":"clients/web-interface/#serving","title":"Serving","text":"<p>In order to serve locally the web interface, the following command can be run.</p> <pre><code>npm run serve\n</code></pre> <p>After running <code>npm run serve</code> the web interface is reachable at localhost:3000.</p> <p>By default the above command expects the OwnTone server to be running at localhost:3689 and proxies API calls to this location.</p> <p>If the server is running at a different location you have to set the environment variable <code>VITE_OWNTONE_URL</code>, like in the example below.</p> <pre><code>export VITE_OWNTONE_URL=http://owntone.local:3689\nnpm run serve\n</code></pre>"},{"location":"integrations/lastfm/","title":"LastFM","text":"<p>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.</p> <p>OwnTone will not store your LastFM username/password, only the session key. The session key does not expire.</p>"},{"location":"integrations/spotify/","title":"Spotify","text":"<p>OwnTone has built-in support for playback of the tracks in your Spotify library.</p> <p>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.</p> <p>You must also make sure that your browser can reach OwnTone's web interface via the address 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.</p> <p>To authorize OwnTone, open the web interface, locate Settings &gt; 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.</p> <p>Spotify no longer automatically notifies clients about library updates, so you have to trigger updates manually. You can for instance set up a cron job that runs <code>/usr/bin/curl http://localhost:3689/api/update</code></p> <p>To logout and remove Spotify tracks + credentials make a request to http://owntone.local:3689/api/spotify-logout.</p> <p>Limitations: You will not be able to do any playlist management through OwnTone - use a Spotify client for that. You also can only listen to your music by letting OwnTone do the playback - so that means you can't stream to DAAP clients (e.g. iTunes) and RSP clients.</p>"},{"location":"integrations/spotify/#via-librespotspocon","title":"Via librespot/spocon","text":"<p>You can also use OwnTone with one of the various incarnations of 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 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.</p> <p>The easiest way of accomplishing this may be with Spocon, since it requires minimal configuration. After installing, create two pipes (with mkfifo) and set the configuration in the player section:</p> <pre><code># Audio output device (MIXER, PIPE, STDOUT)\noutput = \"PIPE\"\n# Output raw (signed) PCM to this file (`player.output` must be PIPE)\npipe = \"/srv/music/spotify\"\n# Output metadata in Shairport Sync format (https://github.com/mikebrady/shairport-sync-metadata-reader)\nmetadataPipe = \"/srv/music/spotify.metadata\"\n</code></pre>"},{"location":"outputs/airplay/","title":"AirPlay devices/speakers","text":"<p>OwnTone will discover the AirPlay devices available on your network. For devices that are password-protected, the device's AirPlay name and password must be given in the configuration file. See the sample configuration file for the syntax.</p> <p>If your Apple TV requires device verification (always required by Apple TV4 with tvOS 10.2) then you can do that through Settings &gt; Remotes &amp; Outputs in the web interface: Select the device and then enter the PIN that the Apple TV displays.</p> <p>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).</p> <p>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 &gt; Allow Speakers &amp; TV Access &gt; Anyone On the Same Network (or Everyone).</p>"},{"location":"outputs/chromecast/","title":"Chromecast","text":"<p>OwnTone will discover Chromecast devices available on your network, and you can then select the device as a speaker. There is no configuration required.</p>"},{"location":"outputs/local-audio/","title":"Local audio","text":""},{"location":"outputs/local-audio/#local-audio-through-alsa","title":"Local audio through ALSA","text":"<p>In the config file, you can select ALSA for local audio. This is the default.</p> <p>When using ALSA, the server will try to synchronize playback with AirPlay. You can adjust the synchronization in the config file.</p> <p>For most setups the default values in the config file should work. If they don't, there is help here</p>"},{"location":"outputs/local-audio/#local-audio-bluetooth-and-more-through-pulseaudio","title":"Local audio, Bluetooth and more through PulseAudio","text":"<p>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 with some help on that: PulseAudio</p> <p>Note that if you select PulseAudio the \"card\" setting in the config file has no effect. Instead all sound cards detected by PulseAudio will be listed as speakers by OwnTone.</p> <p>You can adjust the latency of PulseAudio playback in the config file.</p>"},{"location":"outputs/streaming/","title":"Streaming","text":"<p>You can listen to audio being played by OwnTone by opening this network stream address in pretty much any music player:</p> <p>http://owntone.local:3689/stream.mp3 or http://SERVER_ADDRESS:3689/stream.mp3</p> <p>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 cannot be supported by OwnTone. So what you can do instead is install a music player app like VLC, connect to the stream and control playback with Remote.</p> <p>In the speaker selection list, clicking on the icon should start the stream playing in the background on browsers that support that.</p> <p>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\".</p>"}]}