Mopidy Documentation Release 3.2.0-17-G2cc7d953
Total Page:16
File Type:pdf, Size:1020Kb
Mopidy Documentation Release 3.2.0-17-g2cc7d953 Stein Magnus Jodal and contributors 2021 USAGE 1 Installation 3 1.1 Debian/Ubuntu..............................................3 1.2 Arch Linux................................................4 1.3 Fedora..................................................5 1.4 macOS..................................................6 1.5 Install from PyPI.............................................7 1.6 Raspberry Pi...............................................9 2 Running 11 2.1 Running in a terminal.......................................... 11 2.2 Running as a service........................................... 12 3 Configuration 17 3.1 Configuration file location........................................ 17 3.2 Editing the configuration......................................... 17 3.3 View effective configuration....................................... 17 3.4 Core configuration............................................ 18 3.5 Extension configuration......................................... 21 3.6 Adding new configuration values.................................... 21 4 Clients 23 4.1 Web clients................................................ 23 4.2 MPD clients............................................... 24 4.3 MPRIS clients.............................................. 24 5 Troubleshooting 25 5.1 Getting help............................................... 25 5.2 Show effective configuration....................................... 25 5.3 Show installed dependencies....................................... 25 5.4 Debug logging.............................................. 26 5.5 Track metadata.............................................. 26 5.6 Debugging deadlocks.......................................... 27 5.7 Debugging GStreamer.......................................... 27 6 Mopidy-File 29 6.1 Configuration............................................... 29 7 Mopidy-M3U 31 7.1 Editing playlists............................................. 31 7.2 Configuration............................................... 31 i 8 Mopidy-Stream 33 8.1 Configuration............................................... 33 9 Mopidy-HTTP 35 9.1 Hosting web clients............................................ 35 9.2 Configuration............................................... 35 10 Mopidy-SoftwareMixer 37 10.1 Configuration............................................... 37 11 Audio sinks 39 12 Icecast 41 12.1 Known issues............................................... 42 12.2 Fallback stream.............................................. 42 13 UPnP 43 13.1 UPnP MediaRenderer.......................................... 43 13.2 UPnP clients............................................... 44 14 Changelog 45 14.1 v3.2.1 (UNRELEASED)......................................... 45 14.2 v3.2.0 (2021-07-08)........................................... 45 14.3 v3.1.1 (2020-12-26)........................................... 45 14.4 v3.1.0 (2020-12-16)........................................... 46 14.5 v3.0.2 (2020-04-02)........................................... 46 14.6 v3.0.1 (2019-12-22)........................................... 46 14.7 v3.0.0 (2019-12-22)........................................... 46 15 History 53 15.1 Changelog 2.x series........................................... 53 15.2 Changelog 1.x series........................................... 60 15.3 Changelog 0.x series........................................... 73 16 Versioning 111 16.1 Release schedule............................................. 111 17 Authors 113 18 Sponsors 117 18.1 Discourse................................................. 117 19 Contributing 119 19.1 Asking questions............................................. 119 19.2 Helping users............................................... 119 19.3 Issue guidelines............................................. 119 19.4 Pull request guidelines.......................................... 120 20 Development environment 121 20.1 Initial setup................................................ 122 20.2 Running Mopidy from Git........................................ 125 20.3 Running tests............................................... 125 20.4 Writing documentation.......................................... 127 20.5 Working on extensions.......................................... 128 20.6 Contribution workflow.......................................... 129 ii 21 Extension development 131 21.1 Anatomy of an extension......................................... 131 21.2 cookiecutter project template...................................... 132 21.3 Example README.rst.......................................... 132 21.4 Example setup.py............................................. 133 21.5 Example __init__.py........................................... 134 21.6 Example frontend............................................ 136 21.7 Example backend............................................. 136 21.8 Example command............................................ 137 21.9 Example web application......................................... 137 21.10 Running an extension.......................................... 137 21.11 Python conventions............................................ 137 21.12 Use of Mopidy APIs........................................... 138 21.13 Logging in extensions.......................................... 138 21.14 Making HTTP requests from extensions................................. 138 21.15 Testing extensions............................................ 140 22 Code style 145 23 Release procedures 147 23.1 Releasing extensions........................................... 147 23.2 Releasing Mopidy itself......................................... 148 24 API reference 151 24.1 Concepts................................................. 151 24.2 Basics................................................... 161 24.3 Web/JavaScript.............................................. 183 24.4 Audio................................................... 188 24.5 Utilities.................................................. 194 25 mopidy command 201 25.1 Synopsis................................................. 201 25.2 Description................................................ 201 25.3 Options.................................................. 201 25.4 Built in commands............................................ 202 25.5 Extension commands........................................... 202 25.6 Files................................................... 202 25.7 Examples................................................. 202 25.8 Reporting bugs.............................................. 203 26 Glossary 205 27 Indices and tables 207 Python Module Index 209 Index 211 iii iv Mopidy Documentation, Release 3.2.0-17-g2cc7d953 Mopidy is an extensible music server written in Python. Mopidy plays music from local disk, Spotify, SoundCloud, Google Play Music, and more. You edit the playlist from any phone, tablet, or computer using a variety of MPD and web clients. Stream music from the cloud Vanilla Mopidy only plays music from files and radio streams. Through extensions, Mopidy can play music from cloud services like Spotify, SoundCloud, and Google Play Music. With Mopidy’s extension support, backends for new music sources can be easily added. Mopidy is just a server Mopidy is a Python application that runs in a terminal or in the background on Linux computers or Macs that have network connectivity and audio output. Out of the box, Mopidy is an HTTP server. If you install the Mopidy-MPD extension, it becomes an MPD server too. Many additional frontends for controlling Mopidy are available as extensions. Pick your favorite client You and the people around you can all connect their favorite MPD or web client to the Mopidy server to search for music and manage the playlist together. With a browser or MPD client, which is available for all popular operating systems, you can control the music from any phone, tablet, or computer. Mopidy on Raspberry Pi The Raspberry Pi is an popular device to run Mopidy on, either using Raspbian, Ubuntu, or Arch Linux. Pimoroni recommends Mopidy for use with their Pirate Audio audio gear for Raspberry Pi. Mopidy is also a significant building block in the Pi Musicbox integrated audio jukebox system for Raspberry Pi. Mopidy is hackable Mopidy’s extension support and Python, JSON-RPC, and JavaScript APIs make Mopidy a perfect base for your projects. In one hack, a Raspberry Pi was embedded in an old cassette player. The buttons and volume control are wired up with GPIO on the Raspberry Pi, and is used to control playback through a custom Mopidy extension. The cassettes have NFC tags used to select playlists from Spotify. Getting started To get started with Mopidy, begin by reading Installation. Getting help If you get stuck, you can get help at the our Discourse forum or in the #mopidy-users stream on Zulip chat. If you stumble into a bug or have a feature request, please create an issue in the issue tracker. If you’re unsure if it’s a bug or not, ask for help in the forum or the chat first. The source code may also be of help. If you want to stay up to date on Mopidy developments, you can follow the #mopidy-dev stream on Zulip chat or watch out for announcements on the Discourse forum. USAGE 1 Mopidy Documentation, Release 3.2.0-17-g2cc7d953 2 USAGE CHAPTER ONE INSTALLATION There are several ways to install Mopidy. What way is best depends upon your operating system and/or distribution: 1.1 Debian/Ubuntu If you run a Debian based Linux distribution,