owntone-server/search/search_index.json

1 line
189 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> <ul> <li> Remote apps like Apple Remote (iOS) or Retune (Android)</li> <li> Integrated mobile friendly web interface</li> <li> MPD clients</li> </ul> </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 libxml2-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 libxml2-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 libxml2\n</code></pre> <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>libxml2 </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.</p> <p>To serve the web interface locally you can run <code>npm run serve</code>, which will make it reachable at localhost:3000. The command expects the server be running at localhost:3689 and proxies API calls to this location. If the server is running at a different location you can use <code>export VITE_OWNTONE_URL=http://owntone.local:3689</code>.</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/#web-source-formattinglinting","title":"Web source formatting/linting","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 <code>npm run format</code> 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> <p>To flag programming errors, bugs, stylistic errors and suspicious constructs in the source code, ESLint is used.</p> <p>ESLint has been configured following this guide.</p> <p><code>npm run lint</code> lints the source code and fixes all automatically fixable errors.</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":"changelog/","title":"Changelog","text":""},{"location":"changelog/#version-2811-2025-01-26","title":"Version 28.11 - 2025-01-26","text":"<ul> <li>fix: retrieval of artwork from online sources</li> <li>fix: mpd speaker selection</li> <li>fix: autoconf warnings</li> <li>fix: Apple Music/iTunes not working on Airplay host</li> <li>web UI: Now Playing does not stop play progress updates when pausing</li> <li>web UI: add ability to access the server externally</li> <li>new: internet radio \"Streamurl\" options</li> <li>new: support libevent as WS server instead of libwebsockets</li> <li>new: template for VSCode</li> <li>new: mpd updates, version 0.23.0, e.g. getvol, readpicture, albumart</li> <li>new: API for setting skip_count and play_count directly</li> </ul>"},{"location":"changelog/#version-2810-2024-09-12","title":"Version 28.10 - 2024-09-12","text":"<ul> <li>fix: playlist scanner ignoring lines starting with non-ascii chars</li> <li>fix: last seconds of a track sometimes being skipped</li> <li>fix: Apple Music password-based auth</li> <li>fix: missing file scan when modified multiple times within a second</li> <li>fix: Roku M1001 crash</li> <li>fix: speakers changing IP addresses (error \"Got RR type A size 16\")</li> <li>fix: playlist rename not registered</li> <li>fix: problems with DAAP and old dates (\"Integer value too large\")</li> <li>fix: compability with ffmpeg 7 (fixes build error)</li> <li>web UI: many smaller improvements, e.g. sort by release date</li> <li>web UI: traditional Chinese translation</li> <li>new: ALAC transcoding for RSP/DAAP streaming</li> <li>new: ability to save id3 metadata</li> <li>config: change \"trusted_networks\" to have new value \"lan\" as default</li> <li>config: new option to announce a MPD httpd plugin (stream from server)</li> <li>config: set ipv6 to disabled by default due to unknown Airplay issue</li> <li>config: deprecate \"cache_path\", replaced by \"cache_dir\"</li> <li>dependency: libxml2 instead of mxml</li> </ul>"},{"location":"changelog/#version-289-2024-01-18","title":"Version 28.9 - 2024-01-18","text":"<ul> <li>web UI improvements:<ul> <li>display lyrics metadata</li> <li>toggle Spotify on/off in some views</li> <li>many minor improvements</li> </ul> </li> <li>use compressed ALAC for Airplay for bandwidth + fixes esp32 issue</li> <li>don't merge Spotify albums with local albums</li> <li>handle playlist with Unicode BOM</li> <li>json API add tracks to queue returns info on added tracks</li> <li>replace syscall with gettid, syscall deprecated on MacOS</li> <li>fix issue where m3u genre doesn't override despite m3u_override = true</li> <li>fix possible crash from use-after-free</li> <li>fix FreeBSD possible crash</li> <li>fix crash when keys of incorrect length are used for legacy pairing</li> </ul>"},{"location":"changelog/#version-288","title":"Version 28.8","text":"<ul> <li>fix MacOS bind error: \"Protocol wrong type for socket\"</li> <li>fix BSD build error (no SYS_gettid)</li> <li>fix ALAC missing end tag causing ffmpeg decoder warnings</li> <li>fix crash if Spotify AP resolver is unavailable</li> <li>fix duplicates if file within library is replaced</li> <li>fix fatal error due to mutex being zeroed</li> </ul>"},{"location":"changelog/#version-287","title":"Version 28.7","text":"<ul> <li>fix compability with ffmpeg 6</li> <li>web UI improvements:<ul> <li>easier volume sliders</li> <li>incorrect display of genre</li> <li>Chinese translation</li> <li>fix removing RSS podcasts</li> <li>sort by rating for composer, genre and artist tracks</li> <li>(and much more)</li> </ul> </li> <li>changes to artwork search orders (easier static artwork for pipes)</li> <li>major refactor of the http server improving mp3 streaming</li> <li>support for m3u8 playlist files</li> <li>allow mixed ipv4/ipv6 mdns</li> <li>fix issue with device name capitalization (TuneAero issue)</li> <li>drop support for libevent &lt; 2.1.4</li> </ul>"},{"location":"changelog/#version-286","title":"Version 28.6","text":"<ul> <li>German translation of web UI</li> <li>web UI: fix error messages not displaying</li> <li>fix low resolution Spotify artwork</li> <li>fix incorrect display of date released pre 1970</li> <li>fix for Denon speakers when pausing</li> <li>support password authentication for Airplay 2</li> <li>support for user config ffmpeg audio filters</li> </ul>"},{"location":"changelog/#version-285","title":"Version 28.5","text":"<ul> <li>French translation of web UI</li> <li>improved web UI loading of images</li> <li>add support for Airplay 2 password based auth</li> <li>fix some Airplay speakers turning on by themselves</li> <li>fix parsing of CRLF and NOT in smart playlists and allow larger sizes</li> <li>fix possible crash after Avahi restart</li> <li>fix for Remote - play item from 'up next' when stopped</li> <li>use configured bind_address to set mdns network interface</li> </ul>"},{"location":"changelog/#version-284","title":"Version 28.4","text":"<ul> <li>fix broken Spotify after libspotify sunset</li> <li>remove antlr3 dependency, use bison/flex instead</li> <li>improve search by supporting diacritics and Unicode case folding</li> <li>add support for new output: Roku/Soundbridge RCP</li> <li>switch to MkDocs for documentation</li> <li>smart playlists fixups and new \"this week\" param</li> <li>fix 'add next' when in queue shuffle mode</li> <li>web UI improvements:<ul> <li>migration to Vue 3 and Vite</li> <li>honor \"radio_playlists\" config setting</li> <li>display of search results for composers and playlists</li> <li>add album / track count to genre and composer pages</li> <li>fix incorrect sorting of album/artist searches</li> <li>minor UI fixes</li> </ul> </li> <li>fix for Spotify config option album_override</li> <li>improved Spotify scan performance</li> <li>generic browse endpoints for the json api</li> <li>fix slow shutdown with some libwebsocket versions</li> </ul>"},{"location":"changelog/#version-283","title":"Version 28.3","text":"<ul> <li>web UI improvements, e.g.:<ul> <li>composer views</li> <li>partial scan (e.g. only update RSS feeds)</li> <li>fix http stream button not clickable in mobile view</li> <li>fix Spotify playlists not showing</li> <li>handling of not playable Spotify tracks</li> <li>handling of podcast play counts</li> </ul> </li> <li>support for Spotify podcasts</li> <li>updates for ffmpeg 5</li> <li>better Spotify logout</li> <li>user \"usermark\" field for user flagging of various track states</li> <li>fix for 0-byte files crashing ffmpeg</li> <li>fix metadata pipe deadlock and artwork memleak-on-error</li> <li>better handling of Spotify disconnects</li> <li>fix rare Airplay pairing error</li> <li>many minor error handling fixes</li> </ul>"},{"location":"changelog/#version-282","title":"Version 28.2","text":"<ul> <li>add Spotify integration that doesn't depend on libspotify</li> <li>partial support for AirPlay events (Homepod buttons)</li> <li>web UI upgraded, now 1.1.0:<ul> <li>show \"comment\" field in track details</li> <li>drop double login to Spotify when not using libspotify</li> </ul> </li> <li>easier install by letting 'make install' add user and service files</li> <li>preserve existing conf file when running 'make install'</li> <li>support for \"comment\" field when making smart playlists</li> <li>fix support for dacp device-volume</li> <li>fix issue where source file sort tags where ignored</li> <li>fix for Roku (RSP) artist display issue</li> <li>fix bug when 'bind_address' option is used</li> <li>fix for CVE-2021-38383</li> <li>fix some minor time-of-check time-of-use bugs</li> </ul>"},{"location":"changelog/#version-281","title":"Version 28.1","text":"<ul> <li>fix incompability in 28.0 with Debian Buster's libwebsockets 2.0</li> </ul>"},{"location":"changelog/#version-280","title":"Version 28.0","text":"<ul> <li>rename forked-daapd to OwnTone + new logo</li> <li>fix web UI slow updates due to websockets 3.x changes</li> <li>support for ALAC sort tags</li> <li>support for remote pls/m3u with https streams</li> <li>add /api/queue?id=now_playing json API shortcut</li> <li>fix possible crash on Pulseaudio error callback</li> <li>fix possible segfault-on-exit</li> <li>fix websockets not working on FreeBSD</li> <li>refactor how the server binds to sockets (use dual stack ipv4/6)</li> <li>configurable interface/address binding</li> </ul>"},{"location":"changelog/#version-274","title":"Version 27.4","text":"<ul> <li>fix web server path traversal vulnerability</li> </ul>"},{"location":"changelog/#version-273","title":"Version 27.3","text":"<ul> <li>support for AirPlay 2 speakers, incl. compressed ALAC</li> <li>web UI upgraded, now v0.8.5:<ul> <li>new design/layout</li> <li>optimize \"Recently added\"</li> <li>Spotify search dialogue improvements</li> <li>drop separate admin web page, now integrated in main web</li> <li>podcast deletion</li> <li>make Radio a top level item</li> <li>show release dates</li> <li>new sorting options</li> <li>prevent browser caching of playlists</li> <li>additional settings</li> </ul> </li> <li>improved Chromecast streaming (retransmisson, adaptive etc.)</li> <li>JSON api support for updating metadata of queue items</li> <li>JSON api new fields, e.g. time_added, time_played and seek</li> <li>fix for some Chromecasts disconnecting</li> <li>new algorithm for more natural ALSA volume adjustments</li> <li>new nickname option for AirPlay and Chromecast</li> <li>mpd fixes (nextsong, multiple commands)</li> <li>charset flexibility when getting ICY metadata from streams</li> <li>adaptive probing of radio streams</li> <li>libplist and libsodium now required</li> <li>fixes for library update events</li> <li>fixes to speaker selection and unintentional volume changes</li> <li>fix some minor memleaks</li> <li>support shairport-sync metadata pipe flush event</li> <li>misc logging fixup</li> </ul>"},{"location":"changelog/#version-272","title":"Version 27.2","text":"<ul> <li>web UI upgraded to v0.7.2:<ul> <li>show cover artwork in album pages and lazy loading of artwork</li> <li>show playlist folders</li> <li>use sass/scss for css files</li> <li>add \"Radio\" tab to the music section</li> <li>add settings for artwork sources</li> <li>add pop up dialog for Remote pairing requests</li> <li>support adding/removing podcast subscriptions</li> <li>support marking all new podcast episodes/all episodes as played</li> <li>support searching by smart pl queries</li> <li>skip buttons for audiobooks and podcasts</li> <li>show localized times/dates</li> <li>generate colored placeholder image if cover artwork is missing</li> <li>show \"cast\" icon for Chromecast outputs</li> <li>styling changes of the navbars and moving the volume controls</li> </ul> </li> <li>new speaker selection logic (persist user choice even after failure)</li> <li>speaker autoselect no longer enabled by default</li> <li>removed old admin page, not necessary any more</li> <li>fix/workaround for Apple TV's and HomePods that disconnect</li> <li>support for RSS feeds</li> <li>support for nested smart playlists (playlist folders)</li> <li>support for online artwork sources e.g. Discogs, Coverartarchive</li> <li>support for radio StreamUrl's that point to json with metadata</li> <li>fix incorrect artwork shown for unknown album/artists</li> <li>fix issue parsing shairport-sync progress metadata</li> <li>fix missing Spofity logout option</li> <li>fix for embedded artwork not working with ffmpeg 4.3+</li> <li>some smart PL improvements, e.g. support for more tags</li> <li>config option for Airplay timing/control ports (eases firewalling)</li> <li>quicker loading of radio streams (smaller probing)</li> <li>workaround for mxml 2.10 significant memleak</li> <li>some fixes for Roku (RSP)</li> <li>drop libspotify for artwork, doesn't work any more</li> <li>documentation improvements</li> </ul>"},{"location":"changelog/#version-271","title":"Version 27.1","text":"<ul> <li>web UI upgraded to v0.6.0: settings page, display more Spotify data</li> <li>support for volumeup, volumedown and mutetoggle DACP commands</li> <li>support for multiple ALSA devices</li> <li>suppress repeated logging of same message to avoid log file bloat</li> <li>fix opening too many files due to looping with shairport-sync</li> <li>fix for genres with single quotes in name</li> <li>fix for incorrect update of time_added metadata</li> <li>fix some small memleaks and missing cleanup</li> </ul>"},{"location":"changelog/#version-270","title":"Version 27.0","text":"<ul> <li>no fixed resampling to 44100/16, play source quality if possible</li> <li>Chromecast: quick start, better quality (48000/16 Opus encoded)</li> <li>performance enhancements: Remote and iTunes will load quicker</li> <li>alsa sync with variable sample rate, avoiding audible \"clicks\"</li> <li>web UI upgraded to v0.5.6, e.g. play non-library tracks, saving queue</li> <li>fix for Pebble mpd client (and possibly others)</li> <li>fix issue with some HLS radio stations</li> <li>support for https streams</li> <li>fix for artwork showing dithered</li> <li>ICY metadata in forked-daapd's mp3 stream</li> <li>support for Spotify collaborative playlists</li> <li>support for Shairport artwork via pipe</li> <li>configurable mp3 streaming quality</li> <li>json api improvements, e.g. for toggling speakers</li> <li>json api/web ui: Relative seeking</li> <li>support for some http seeking</li> <li>fix for macOS Catalina\u2019s Apple Music</li> </ul>"},{"location":"changelog/#version-265","title":"Version 26.5","text":"<ul> <li>json api/web ui: file view</li> <li>web ui: artwork support</li> <li>web ui: \"Add next\" and genre tab</li> <li>Airplay connection test improvements</li> <li>support for https streams in m3u's</li> <li>use Spotify web api for artwork instead of libspotify</li> <li>option to make Airplay devices permanent or excluded</li> <li>support for tracks and disc items in smart playlists</li> <li>db refactor, fix issues with play count, time played etc</li> <li>json api: more options available when adding items to the queue</li> <li>json api: player/toggle</li> <li>mpd version 0.20 support + support for \"listfiles\" command</li> <li>fix double http auth decline issue</li> </ul>"},{"location":"changelog/#version-264","title":"Version 26.4","text":"<ul> <li>automatic rating</li> <li>fix issue in 26.3 causing invalid time_skipped values in the db</li> <li>improved fallback to ipv4 if ipv6 fails</li> <li>fix issue returning too many queue items to clients</li> <li>fix missing prompt for library password</li> </ul>"},{"location":"changelog/#version-263","title":"Version 26.3","text":"<ul> <li>fix AirPlay 2 devices (e.g. Sonos Beam and Airport Express)</li> <li>fix mdns problems with ATV4 and ipv6</li> <li>fix possible segfault if null user-agent</li> <li>new metadata: Skip Count and Times Skipped (incl iTunes XML mapping)</li> <li>iTunes XML mapping of Play Count and Play Date</li> <li>fix for crashes when client provides no User-Agent</li> <li>logging improvements</li> </ul>"},{"location":"changelog/#version-262","title":"Version 26.2","text":"<ul> <li>fix for db indexes not being used on fresh installs</li> </ul>"},{"location":"changelog/#version-261","title":"Version 26.1","text":"<ul> <li>player web interface</li> <li>support for Airplay speaker control commands</li> <li>add non-library items (e.g. radio stations) to the queue</li> <li>fix for keeping connection alive towards some devices e.g. old ApEx's</li> <li>extension of the JSON API</li> <li>under-the-hood improvements of Spotify integration</li> <li>fix for Android \"Remote for iTunes\"</li> <li>fix ffmpeg segfault when jpeg encoding</li> <li>performance improvements + misc</li> </ul>"},{"location":"changelog/#version-260","title":"Version 26.0","text":"<ul> <li>added web interface</li> <li>added JSON API</li> <li>new mpd commands (e.g. sticker, urlhandlers, playlistfind)</li> <li>support for adding non-library urls to the playback queue</li> <li>support for id3 grouping tags</li> <li>support for filesystems with ACL's</li> <li>use Spotify web api to load all playlists</li> <li>improved client authentication options</li> <li>only rescan playlists if changed -&gt; faster startup</li> <li>fix bug related to dacp/daap client revision number handling</li> <li>fix bugs related to import of iTunes XML playlists</li> <li>restore ATV4/tvOS11 support by removing requirement for timing_port</li> <li>fixes for Hyperfine Remote</li> <li>improve database performance</li> <li>make sure daemons listen on both ipv4 and ipv6 (for BSD)</li> <li>ffmpeg/transcoding refactored for new ffmpeg API</li> <li>and more...</li> </ul>"},{"location":"changelog/#version-250","title":"Version 25.0","text":"<ul> <li>improved playback resilience</li> <li>substitute packet skipping (producing audio \"clicks\") with start/stop</li> <li>support for MacOSX with macports and Bonjour mDNS</li> <li>Airplay device verification for Apple TV 4 w/tvOS 10.2 (uses libsodium)</li> <li>support for Spotify web api (saved tracks/albums + Discover Weekly)</li> <li>automatic playback of pipes + support for Shairport metadata pipes</li> <li>added pipe audio output (fifo)</li> <li>persistent queues (queue remains across server restart)</li> <li>support for browser based clients</li> <li>mpd sendmessage: set individual speaker volume, remote pairing</li> <li>mpd add http://path-to-radiostream (i.e. add non-library items)</li> <li>new options, e.g. exclude speakers from list</li> <li>fix for shuffle mode</li> <li>fix broken PNG artwork rescaling</li> <li>use friendly Chromecast name in speaker list</li> <li>support for libav/ffmpeg dual installs</li> <li>refactoring - added the input and library interface</li> <li>performance improvements</li> <li>and other fixing up...</li> </ul>"},{"location":"changelog/#version-242","title":"Version 24.2","text":"<ul> <li>Pulseaudio support (can be used for Bluetooth speakers)</li> <li>new pipe/\"fifo\" audio output</li> <li>fix misc Chromecast audio bugs</li> <li>fix for Apple tvOS10 disconnecting after some minutes</li> <li>enable CORS headers</li> <li>LastFM scrobbling during regular DAAP streaming</li> <li>smart playlist support for file modification time</li> <li>misc MPD improvements, e.g. new outputsvolume command</li> <li>ignore ipv6 link-local addresses (announced by e.g. ATV4)</li> <li>better inter-thread command handling</li> <li>improved cache performance and use of gzip</li> <li>fix possible segfault on http timeouts</li> <li>fix possible segfault when adding items during playback</li> </ul>"},{"location":"changelog/#version-241","title":"Version 24.1","text":"<ul> <li>support for Monkey's audio</li> <li>fix build problems on some platforms (e.g. OpenWrt)</li> </ul>"},{"location":"changelog/#version-240","title":"Version 24.0","text":"<ul> <li>support for Chromecast audio</li> <li>support more idv3 tags (eg. date released)</li> <li>support more DAAP tags (eg. datereleased, hasbeenplayed)</li> <li>fix problem with playlists not shown in correct order in Remote</li> <li>autoselect devices based on priorities + keep devices selected</li> <li>fix multiple FreeBSD filescanner bugs (like too many open files)</li> <li>ALSA audio refurbished (prevent underrun/overrun, better AirPlay sync)</li> <li>improved mpd command support (eg. lsinfo, move, queue autoplay start)</li> <li>better mpd performance</li> <li>timing changes to keep input and output in sync with player timer</li> <li>prevent cache bloat (unscaled artwork or artwork for deleted tracks)</li> <li>more intelligent Spotify artwork retrieval</li> <li>artwork handling refactored</li> <li>add generic output interface</li> <li>add systemd service file</li> <li>support for OSS4 dropped</li> <li>support for old ffmpeg dropped</li> <li>misc minor bugfixing</li> </ul>"},{"location":"changelog/#version-234","title":"Version 23.4","text":"<ul> <li>fix freeze problem on network stream disconnects</li> <li>support for mp3 streaming</li> <li>better ipv6 handling</li> <li>option to hide singles from album/artist lists</li> <li>misc MPD improvements, incl. new commands and zeroconf support</li> <li>queue handling and transcoding refactored</li> <li>libavresample/libswresample dependency changed to libavfilter</li> <li>improved pairinghelper.sh script</li> </ul>"},{"location":"changelog/#version-233","title":"Version 23.3","text":"<ul> <li>fix issue where volume gets set to -1 on startup of raop devices</li> <li>plug various minor memleaks</li> <li>audiobook improvements, eg resuming playback from saved position</li> <li>live icy metadata</li> <li>libevent 1 support removed</li> <li>LastFM performance improvement</li> <li>drop legacy ffmpeg stuff</li> <li>drop legacy flac, musepack and wma scanner</li> </ul>"},{"location":"changelog/#version-232","title":"Version 23.2","text":"<ul> <li>fix db lock, m3u and Windows Phone bugs</li> <li>improvements for Spotify and mpd</li> <li>fixing bugs as always</li> <li>sorting of genres and composers</li> </ul>"},{"location":"changelog/#version-231","title":"Version 23.1","text":"<ul> <li>support for more mpd commands</li> </ul>"},{"location":"changelog/#version-230","title":"Version 23.0","text":"<ul> <li>add support for the mpd protocol</li> <li>add support for smart playlists</li> <li>playlist and internet stream overhaul</li> </ul>"},{"location":"changelog/#version-222","title":"Version 22.2","text":"<ul> <li>fix for iTunes 12.1</li> <li>fix misc bugs</li> </ul>"},{"location":"changelog/#version-221","title":"Version 22.1","text":"<ul> <li>artwork cache</li> <li>some Spotify fixing up</li> </ul>"},{"location":"changelog/#version-220","title":"Version 22.0","text":"<ul> <li>queue handling improvements</li> <li>added DAAP cache, good for low-power devices like the RPi</li> <li>support for LastFM scrobbling</li> <li>support for .pls playlists</li> <li>added compability with ffmpeg libswresample</li> <li>added options to modify the operation of the SQLite database</li> <li>stop init-rescan/full-rescan from running twice</li> <li>fix misc local audio problems</li> <li>fix some FreeBSD sound timing problems</li> <li>fix segfault on invalid utf8 while sorting</li> <li>fix misc bugs</li> </ul>"},{"location":"changelog/#version-210","title":"Version 21.0","text":"<ul> <li>filescanner performance enhancements (db transactions)</li> <li>support for queue editing</li> <li>support for showing history</li> <li>compability with libevent 2</li> <li>compability with libav 10</li> <li>support for Spotify</li> <li>fix for Seafile libraries</li> <li>support for permission changes in a library (IN_ATTRIB)</li> <li>some DAAP changes to align with iTunes</li> <li>properly show media kind shares in iTunes</li> <li>support for named pipes/fifos</li> <li>natural sorting and better handling of capitalization</li> <li>introduce .init-rescan and .full-rescan triggers</li> <li>fix for XBMC (libshairplay) crash</li> <li>fix missing songartistid (fixes some remotes)</li> <li>fix bug in m3u scanner</li> <li>ICY metadata fixes</li> </ul>"},{"location":"changelog/#version-200","title":"Version 20.0","text":"<ul> <li>includes patch against timeouts</li> <li>configurable artwork file names</li> <li>support for Remote 3 and 4</li> <li>preference for album artist if it is available</li> <li>bug fix for certain Airport Express models</li> <li>bug fix for AirFoil Speakers</li> <li>added support for internet radio with m3u</li> <li>fixed fatal error when stopping player</li> <li>m3u and iTunes playlist scanner improvements</li> <li>improved compability with Hyperfine Remote for Android</li> <li>speaker selection and m3u bug fixes</li> <li>Shoutcast (icy) metadata support for internet radio</li> <li>fix for Apple TV update 6.0</li> <li>fix artwork memory leak</li> <li>basic support for podcasts, compilations and audiobooks</li> <li>user can tell file scanner to ignore certain file types</li> <li>fix for metadata on non-Apple airplay devices</li> <li>configurable library names</li> <li>sorting changes, ignore The/A/An</li> <li>fix for TunesRemote SE</li> <li>force library rescan with .force-rescan</li> <li>fix for the Retune remote on Android</li> <li>fix for AirBubble speakers (shairport)</li> <li>support for artwork in iTunes</li> <li>fixed ffmpeg/libav logging</li> <li>logging and documentation adjustments</li> <li>autoselect AirPlay device if none selected</li> <li>support for embedded artwork</li> <li>config option to disable startup scan</li> <li>config option for max volume for AirPlay devices</li> <li>support for embedded platforms without hi-res timers</li> <li>fix for WMA files</li> <li>fixes for video playback</li> <li>other fixes: non apple players, ffmpeg/libav updates...</li> </ul>"},{"location":"changelog/#version-019","title":"Version 0.19","text":"<ul> <li>more libav 0.7 updates.</li> <li>database speedups.</li> <li>fix for iTunes 30-minute timeout.</li> <li>fixes, big and small.</li> </ul>"},{"location":"changelog/#version-018","title":"Version 0.18","text":"<ul> <li>add config knob for ALSA mixer channel name.</li> <li>do not elevate privileges for reopening the log file; log file will now be owned by the user forked-daapd runs as.</li> <li>fixes, big and small.</li> </ul>"},{"location":"changelog/#version-017","title":"Version 0.17","text":"<ul> <li>support for libav 0.7</li> <li>fixes, big and small.</li> </ul>"},{"location":"changelog/#version-016","title":"Version 0.16","text":"<ul> <li>fix issue with non-UTF-8 metadata while scanning.</li> <li>use proper file size in HTTP streaming code.</li> <li>fix DAAP songlist bug with sort tags.</li> <li>small code fixes.</li> </ul>"},{"location":"changelog/#version-015","title":"Version 0.15","text":"<ul> <li>add support for sending metadata to AppleTV during AirTunes streaming.</li> <li>support DOS-encoded Remote pairing files.</li> <li>rework album_artist_sort handling.</li> <li>enable RAOP to queue RTSP requests.</li> <li>speedup DAAP &amp; RSP filters processing.</li> <li>speedup DAAP songlist generation.</li> <li>artwork can handle and send out both PNG and JPEG.</li> <li>fixes, big and small.</li> </ul>"},{"location":"changelog/#version-014","title":"Version 0.14","text":"<ul> <li>sort headers/tags handling improvements.</li> <li>better handling of tags for TV shows.</li> <li>better handling of DRM-afflicted files.</li> <li>configurable IPv6 support.</li> <li>fix scanning of URL files.</li> <li>fixes, big and small.</li> </ul>"},{"location":"changelog/#version-013","title":"Version 0.13","text":"<ul> <li>add Remote v2 support; Remote v1 is not supported anymore.</li> <li>add per-speaker volume support.</li> <li>implement RAOP retransmission.</li> <li>implement per-device quirks in RAOP.</li> <li>improve compatibility with 802.11g AirPort Express.</li> <li>improve mDNS address resolution, making IPv4 usable again.</li> <li>fix Murmur Hash bug on 32bit platforms.</li> <li>add support for JPEG artwork and alternative filenames.</li> <li>disable session expiration that was causing issues.</li> <li>FFmpeg 0.6 support.</li> <li>fixes, big and small.</li> </ul>"},{"location":"changelog/#version-012","title":"Version 0.12","text":"<ul> <li>add AirTunes v2 streaming.</li> <li>add Remote support.</li> <li>add gzipped replies.</li> <li>add IPv6 support.</li> <li>check for UTF-8 correctness of metadata.</li> <li>fixes, big and small.</li> </ul>"},{"location":"changelog/#version-011","title":"Version 0.11","text":"<ul> <li>support iTunes 9.</li> <li>add iTunes XML playlist scanner.</li> <li>add support for TV shows.</li> <li>add FreeBSD and GNU/kFreeBSD support.</li> <li>add support for DAAP groups.</li> <li>add support for artwork.</li> <li>rework metdata extraction, better support for ID3 tags.</li> <li>database code rework.</li> <li>preliminary support for Remote (pairing, browsing).</li> <li>fixes, big and small.</li> </ul>"},{"location":"changelog/#version-010","title":"Version 0.10","text":"<ul> <li>initial release.</li> </ul>"},{"location":"configuration/","title":"Configuration","text":"<p>The configuration of OwnTone is usually located in <code>/etc/owntone.conf</code>.</p>"},{"location":"configuration/#format","title":"Format","text":"<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>Some settings are device specific, in which case you add a section where you specify the device name in the heading. Say you're tired of loud death metal coming from your teenager's room:</p> <pre><code>airplay \"Jared's Room\" {\n max_volume = 3\n}\n</code></pre>"},{"location":"configuration/#most-important-settings","title":"Most important settings","text":""},{"location":"configuration/#general-uid","title":"general: uid","text":"<p>Identifier of the user running OwnTone.</p> <p>Make sure that this user has read access to your configuration of <code>directories</code> in the <code>library</code> config section, and has write access to the database (<code>db_path</code>), cache directory (<code>cache_dir</code>) and log file (<code>logfile</code>). If you plan on using local audio then the user must also have access to that.</p>"},{"location":"configuration/#library-directories","title":"library: directories","text":"<p>Path to the directory or directories containing the media to index (your library).</p>"},{"location":"configuration/#other-settings","title":"Other settings","text":"<p>See the template configuration file for a description of all the settings.</p>"},{"location":"development/","title":"Development","text":""},{"location":"development/#dev-containers-and-vscode","title":"Dev Containers and VSCode","text":"<p>To set up a development environment for OwnTone, the project includes an example Dev Containers configuration.</p> <p>Dev Containers</p> <p>To learn more about Dev Containers and how to use them check out the documentation at:</p> <ul> <li>https://code.visualstudio.com/docs/devcontainers/containers</li> <li>https://containers.dev/</li> </ul> <p>Dev Containers config for OwnTone includes all the necessary and some nice to have tooling:</p> <ul> <li>C-tools to build and develop for owntone-server, including autotools, dependencies, etc.</li> <li>Javascript-tools to build and develop the OwnTone web interface.</li> <li>Python-tools to build and run the OwnTone documentation with mkdocs.</li> </ul>"},{"location":"development/#prerquisites","title":"Prerquisites","text":"<ol> <li>Install Docker.</li> <li>Install Visual Studio Code.</li> <li>Install the Remote - Containers extension for Visual Studio Code.</li> </ol>"},{"location":"development/#initial-setup","title":"Initial setup","text":"<p>The Dev Container and VSCode example configuration files are located in the project folder <code>.dev/devcontainer</code> and <code>.dev/vscode</code>.</p> <p>To make use of them follow these steps:</p> <ol> <li>Copy the directories or run <code>make vscode</code> from inside the <code>.dev</code> folder.</li> <li>Open your project in Visual Studio Code.</li> <li>Open the Command Palette (<code>Ctrl+Shift+P</code>) and select <code>Dev Containers: Reopen in Container</code>.</li> <li>VSCode will build the container and reopen the project inside the container. Be patient, the first run will take several minutes to complete.</li> </ol>"},{"location":"development/#usage","title":"Usage","text":"<p>Inside the container you can follow the build instructions (see Building):</p> <ul> <li> <p>Build owntone-server</p> <pre><code>autoreconf -i\n./configure\nmake\n</code></pre> </li> <li> <p>Build web interface</p> <pre><code>cd web-src\nnpm run build\n</code></pre> </li> </ul> <p>Running <code>owntone-server</code> from inside the container with the predefined run/debug configuration will use the conf file <code>.devcontainer/data/devcontainer-owntone.conf</code> as <code>owntone.conf</code>.</p> <p>Configure the mount configuration in <code>.devcontainer/devcontainer.json</code> to use a different music folder or mount the log folder to a local directory.</p> <pre><code> // Mounts volumes to keep files / state between container rebuilds\n \"mounts\": [\n //...\n\n // Bind mounts for owntone config file and logs, cache, music directories\n //\"source=&lt;path-to-local-logs-dir&gt;,target=/data/logs,type=bind,consistency=cached\",\n //\"source=&lt;path-to-local-cache-dir&gt;,target=/data/cache,type=bind,consistency=cached\",\n //\"source=&lt;path-to-local-music-dir&gt;,target=/data/music,type=bind,consistency=cached\",\n \"source=${localWorkspaceFolder}/.devcontainer/data/devcontainer-owntone.conf,target=/data/conf/owntone.conf,type=bind,consistency=cached\"\n ],\n</code></pre>"},{"location":"development/#dev-container-configuration","title":"Dev Container configuration","text":"<p>The Dev Container example uses an Ubuntu image as base. It contains some additional (opinionated) tools to customize the shell prompt and some terminal niceties:</p> <ul> <li>Starship to customize the shell prompt.</li> <li>eza as <code>ls</code> replacement.</li> <li>Atuin for the shell history.</li> </ul> <p>Take a look at <code>.devcontainer/devcontainer.env</code> if you want to disable any of those.</p> <p>Additional terminal tools installed are:</p> <ul> <li>zoxide - a smarter <code>cd</code></li> <li>bat - a <code>cat</code> clone with syntax highlighting</li> </ul>"},{"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 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) format string Stream format supported_formats array Array of formats supported by output <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 \"format\": \"alac\",\n \"supported_formats\": [ \"alac\" ]\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 \"format\": \"pcm\",\n \"supported_formats\": [ \"pcm\" ]\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 \"format\": \"pcm\",\n \"supported_formats\": [ \"pcm\" ]\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 \"format\": \"pcm\",\n \"supported_formats\": [ \"pcm\" ]\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 format string (Optional) Stream format <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.</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>See query parameters for update of a single track for a list of properties that can be modified.</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 -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> or the new count. <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> skip_count The new skip count usermark The new usermark (&gt;= 0) time_played Modify last played timestamp time_skipped Modify last skipped timestamp <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":"media-clients/","title":"Media Clients","text":"<p>Media Clients are applications that download the media from the server and do the playback themselves. OwnTone supports media clients via the DAAP and RSP protocols (so not UPNP).</p> <p>Some Media Clients are also able to play video from OwnTone.</p> <p>OwnTone can't serve Spotify, internet radio and streams to Media Clients. For that you must let OwnTone do the playback.</p> <p>Here is a list of working and non-working DAAP 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 <p>Technically, devices like the Roku Soundbridge are both media clients and audio outputs. You can find information about them here.</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":"audio-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 for some reason don't work with OwnTone.</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":"audio-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> <p>Take note that:</p> <ul> <li>Chromecast playback can't be precisely sync'ed with other outputs e.g. AirPlay</li> <li>Playback to Google Nest Hub doesn't work (Nest Mini does work)</li> </ul>"},{"location":"audio-outputs/local-audio/","title":"Local audio","text":""},{"location":"audio-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":"audio-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":"audio-outputs/mobile/","title":"Listening on your Mobile Device","text":""},{"location":"audio-outputs/mobile/#ios","title":"iOS","text":"<p>On iOS, the options are limited because there are no Media Client apps with DAAP support and because Apple doesn't allow AirPlay receiver apps. OwnTone also can't share music via Home Sharing, which is the protocol Apple uses for sharing media between devices.</p> <p>That leaves the following options, which all rely on OwnTone's streaming:</p> <ul> <li>listen via the web interface</li> <li>use a MPD client app that supports local playback</li> <li>connect to the streaming endpoint with a media player like VLC</li> </ul>"},{"location":"audio-outputs/mobile/#android","title":"Android","text":"<p>On Android, you can use the same streaming methods described for iOS, but you can also find apps that act as AirPlay receivers.</p>"},{"location":"audio-outputs/roku/","title":"Roku devices/speakers","text":"<p>OwnTone can stream audio to classic RSP/RCP-based devices like Roku Soundbridge M1001 and M2000.</p> <p>If the source file is in a non-supported format, like flac, OwnTone will transcode to wav. Transmitting wav requires some bandwidth and the legacy network interfaces of these devices may struggle with that. If so, you can change the transcoding format for the speaker to alac via the JSON API.</p>"},{"location":"audio-outputs/streaming/","title":"Streaming","text":"<p>The streaming option is useful when you want to listen to audio played by OwnTone in a browser or a media player of your choice <sup>1</sup>,<sup>2</sup>.</p> <p>You can control playback via the web interface or any of the supported control clients.</p>"},{"location":"audio-outputs/streaming/#listening-to-audio-in-a-media-player","title":"Listening to Audio in a Media Player","text":"<p>To listen to audio being played by OwnTone in a media player, follow these steps:</p> <ol> <li>Start playing audio in OwnTone.</li> <li>In the web interface, activate the stream in the output menu by clicking on the icon next to HTTP Stream. After a few seconds, the audio should play in the background.</li> <li>Copy the URL behind the icon next to HTTP Stream.</li> <li>Open the copied URL with the media player, e.g., VLC. The URL is usually http://owntone.local:3689/stream.mp3 or http://SERVER_ADDRESS:3689/stream.mp3</li> </ol>"},{"location":"audio-outputs/streaming/#notes","title":"Notes","text":"<ol> <li> <p>On iOS devices, the streaming option is the only way of listening to your audio, since Apple does not allow AirPlay receiver apps, and because Home Sharing cannot be supported by OwnTone.\u00a0\u21a9</p> </li> <li> <p>For the streaming option to work, MP3 encoding must be supported by <code>libavcodec</code>. If it is not, a message will appear in the log file. For example, on Debian or Ubuntu, MP3 encoding support is provided by the package <code>libavcodec-extra</code>.\u00a0\u21a9</p> </li> </ol>"},{"location":"audio-outputs/web/","title":"Listening to Audio in a Browser","text":"<p>To listen to audio being played by OwnTone in a browser, follow these steps:</p> <ol> <li>Start playing audio in OwnTone.</li> <li>In the web interface, activate the stream in the output menu by clicking on the icon next to HTTP Stream. After a few seconds, the audio should play in the background <sup>1</sup>.</li> </ol> <p></p> <p>For the streaming option to work, MP3 encoding must be supported by <code>libavcodec</code>. If it is not, a message will appear in the log file. For example, on Debian or Ubuntu, MP3 encoding support is provided by the package <code>libavcodec-extra</code>.</p> <ol> <li> <p>On iOS devices, playing audio in the background when the device is locked is not supported in a private browser tab.\u00a0\u21a9</p> </li> </ol>"},{"location":"control-clients/cli-api/","title":"API and Command Line","text":"<p>You can choose between:</p> <ul> <li>The JSON API</li> <li>A MPD command line client like mpc</li> <li>DAAP/DACP commands</li> </ul> <p>The JSON API is the most versatile and the recommended method, but for simple command line operations, mpc is easier. DAAP/DACP is only for masochists.</p>"},{"location":"control-clients/cli-api/#json-api","title":"JSON API","text":"<p>See the JSON API docs</p>"},{"location":"control-clients/cli-api/#mpc","title":"mpc","text":"<p>mpc is easy to use for simple operations like enabling speakers, changing volume and getting status.</p> <p>Due to differences in implementation between OwnTone and MPD, some mpc commands will work differently or not at all.</p>"},{"location":"control-clients/cli-api/#daapdacp","title":"DAAP/DACP","text":"<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":"control-clients/desktop/","title":"Desktop Remote Control","text":"<p>To control OwnTone from Linux, Windows or Mac, you can use:</p> <ul> <li>The web interface</li> <li>A remote for iTunes/Apple Music</li> <li>A MPD client</li> </ul> <p>The web interface is the most feature complete and works on all platforms, so on desktop there isn't much reason to use anything else.</p> <p>However, instead of a remote control application, you can also connect to OwnTone via a Media Client e.g. iTunes or Apple Music. Media clients will get the media from OwnTone and do the playback themselves (remotes just control OwnTone playback). See Media Clients for more information.</p>"},{"location":"control-clients/desktop/#the-web-interface","title":"The web interface","text":"<p>See web interface.</p>"},{"location":"control-clients/desktop/#remotes-for-itunesapple-music","title":"Remotes for iTunes/Apple Music","text":"<p>There are only a few of these, see the below table.</p> Client Developer Type Platform Working (vers.) TunesRemote SE Remote Java Yes (r108) rtRemote for Windows bizmodeller Remote Windows Yes (1.2.0.67)"},{"location":"control-clients/desktop/#mpd-clients","title":"MPD clients","text":"<p>There's a range of MPD clients available that also work with OwnTone e.g. Cantata and Plattenalbum.</p> <p>The better ones support local playback, speaker control, artwork and automatic discovery of OwnTone's MPD server.</p> <p>By default OwnTone listens on port 6600 for MPD clients. You can change this in the configuration file.</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>"},{"location":"control-clients/mobile/","title":"Mobile Remote Control","text":"<p>To control OwnTone from your mobile device, you can use:</p> <ul> <li>The web interface</li> <li>(iOS) The Remote app from Apple</li> <li>(Android) An iTunes/Apple Music remote app</li> <li>A MPD client app</li> </ul> <p>The web interface is the most feature complete, but apps may have UX advantages. The table below shows how some features compare.</p> Feature Remote MPD client Web Browse library yes yes yes Control playback and queue yes yes yes Artwork yes yes yes Individual speaker selection yes some yes Individual speaker volume yes no yes Volume control using phone buttons no ? no Listen on phone no some yes Access non-library Spotify tracks no no yes Edit and save m3u playlists no some yes <p>While OwnTone supports playing tracks from Spotify, there is no support for Spotify Connect, so you can't control from the Spotify app.</p>"},{"location":"control-clients/mobile/#the-web-interface","title":"The web interface","text":"<p>See web interface.</p>"},{"location":"control-clients/mobile/#apple-remote-app-ios","title":"Apple Remote app (iOS)","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":"control-clients/mobile/#pairing","title":"Pairing","text":"<ol> <li>Open the web interface at either http://owntone.local:3689 or <code>http://SERVER-IP-ADDRESS:3689</code></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":"control-clients/mobile/#remotes-for-itunesapple-music-android","title":"Remotes for iTunes/Apple Music (Android)","text":"<p>The below Android remote apps work with OwnTone.</p> Client Developer Type Working (vers.) Retune SquallyDoc Remote Yes (3.5.23) TunesRemote+ Melloware Remote Yes (2.5.3) Remote for iTunes Hyperfine Remote Yes <p>For usage and troubleshooting details, see the instructions for Apple Remote.</p>"},{"location":"control-clients/mobile/#mpd-client-apps","title":"MPD client apps","text":"<p>There's a range of MPD clients available from app store that also work with OwnTone e.g. MPD Pilot, MaximumMPD, Rigelian and Stylophone.</p> <p>The better ones support local playback, speaker control, artwork and automatic discovery of OwnTone's MPD server.</p> <p>By default OwnTone listens on port 6600 for MPD clients. You can change this in the configuration file.</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>"},{"location":"control-clients/web/","title":"Web Interface","text":"<p>The built-in 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> <p>Alternatively, you can use a MPD web client like for instance ympd.</p>"},{"location":"control-clients/web/#screenshots","title":"Screenshots","text":"<p>Below you have a selection of screenshots that shows different part of the interface.</p> <p> </p>"},{"location":"control-clients/web/#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":"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>"}]}