|
| 1 | +# mopidy-mpd |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +[Mopidy](https://mopidy.com/) extension for controlling Mopidy from MPD |
| 8 | +clients. |
| 9 | + |
| 10 | +MPD stands for Music Player Daemon, which is also the name of the |
| 11 | +[original MPD server project](https://www.musicpd.org/). Mopidy does not |
| 12 | +depend on the original MPD server, but implements the MPD protocol |
| 13 | +itself, and is thus compatible with most clients built for the original |
| 14 | +MPD server. |
| 15 | + |
| 16 | +## Maintainer wanted |
| 17 | + |
| 18 | +Mopidy-MPD is currently kept on life support by the Mopidy core |
| 19 | +developers. It is in need of a more dedicated maintainer. |
| 20 | + |
| 21 | +If you want to be the maintainer of Mopidy-MPD, please: |
| 22 | + |
| 23 | +1. Make 2-3 good pull requests improving any part of the project. |
| 24 | + |
| 25 | +2. Read and get familiar with all of the project's open issues. |
| 26 | + |
| 27 | +3. Send a pull request removing this section and adding yourself as the |
| 28 | + "Current maintainer" in the "Credits" section below. In the pull |
| 29 | + request description, please refer to the previous pull requests and |
| 30 | + state that you've familiarized yourself with the open issues. |
| 31 | + |
| 32 | + As a maintainer, you'll be given push access to the repo and the |
| 33 | + authority to make releases to PyPI when you see fit. |
| 34 | + |
| 35 | +## Installation |
| 36 | + |
| 37 | +Install by running: |
| 38 | + |
| 39 | +```sh |
| 40 | +python3 -m pip install mopidy-mpd |
| 41 | +``` |
| 42 | + |
| 43 | +See https://mopidy.com/ext/mpd/ for alternative installation methods. |
| 44 | + |
| 45 | +## Configuration |
| 46 | + |
| 47 | +Before starting Mopidy, you must add configuration for |
| 48 | +mopidy-mpd to your Mopidy configuration file: |
| 49 | + |
| 50 | +```ini |
| 51 | +[mpd] |
| 52 | +hostname = :: |
| 53 | +``` |
| 54 | + |
| 55 | +> [!WARNING] |
| 56 | +> As a simple security measure, the MPD server is by default only available from |
| 57 | +> localhost. To make it available from other computers, change the |
| 58 | +> `mpd/hostname` config value. |
| 59 | +> |
| 60 | +> Before you do so, note that the MPD server does not support any form of |
| 61 | +> encryption and only a single clear text password (see `mpd/password`) for weak |
| 62 | +> authentication. Anyone able to access the MPD server can control music |
| 63 | +> playback on your computer. Thus, you probably only want to make the MPD server |
| 64 | +> available from your local network. You have been warned. |
| 65 | +
|
| 66 | +The following configuration values are available: |
| 67 | + |
| 68 | +- `mpd/enabled`: If the MPD extension should be enabled or not. |
| 69 | +- `mpd/hostname`: Which address the MPD server should bind to. This |
| 70 | + can be a network address or the path toa Unix socket: |
| 71 | + - `127.0.0.1`: Listens only on the IPv4 loopback interface |
| 72 | + (default). |
| 73 | + - `::1`: Listens only on the IPv6 loopback interface. |
| 74 | + - `0.0.0.0`: Listens on all IPv4 interfaces. |
| 75 | + - `::`: Listens on all interfaces, both IPv4 and IPv6. |
| 76 | + - `unix:/path/to/unix/socket.sock`: Listen on the Unix socket at |
| 77 | + the specified path. Must be prefixed with `unix:`. |
| 78 | +- `mpd/port`: Which TCP port the MPD server should listen to. Default: 6600. |
| 79 | +- `mpd/password`: The password required for connecting to the MPD |
| 80 | + server. If blank, no password is required. Default: blank. |
| 81 | +- `mpd/max_connections`: The maximum number of concurrent connections |
| 82 | + the MPD server will accept. Default: 20. |
| 83 | +- `mpd/connection_timeout`: Number of seconds an MPD client can stay |
| 84 | + inactive before the connection is closed by the server. Default: 60. |
| 85 | +- `mpd/zeroconf`: Name of the MPD service when published through |
| 86 | + Zeroconf. The variables `$hostname` and `$port` can be used in the |
| 87 | + name. Set to an empty string to disable Zeroconf for MPD. Default: |
| 88 | + `Mopidy MPD server on $hostname` |
| 89 | +- `mpd/command_blacklist`: List of MPD commands which are disabled by |
| 90 | + the server. By default this blacklists `listall` and `listallinfo`. |
| 91 | + These commands don't fit well with many of Mopidy's backends and |
| 92 | + are better left disabled unless you know what you are doing. |
| 93 | +- `mpd/default_playlist_scheme`: The URI scheme used if the server |
| 94 | + cannot find a backend appropriate for creating a playlist from the |
| 95 | + given tracks. Default: `m3u` |
| 96 | + |
| 97 | +## Limitations |
| 98 | + |
| 99 | +This is a non-exhaustive list of MPD features that Mopidy doesn't |
| 100 | +support. |
| 101 | + |
| 102 | +- Only a single password is supported. It gives all-or-nothing access. |
| 103 | +- Toggling of audio outputs is not supported. |
| 104 | +- Channels for client-to-client communication are not supported. |
| 105 | +- Stickers are not supported. |
| 106 | +- Crossfade is not supported. |
| 107 | +- Replay gain is not supported. |
| 108 | +- `stats` does not provide any statistics. |
| 109 | +- `decoders` does not provide information about available decoders. |
| 110 | +- Live update of the music database is not supported. |
| 111 | + |
| 112 | +## Clients |
| 113 | + |
| 114 | +Over the years, a huge number of MPD clients have been built for every |
| 115 | +thinkable platform. As always, the quality and state of maintenance |
| 116 | +varies between clients, so you might have to try a couple before you |
| 117 | +find one you like for your purpose. In general, they should all work |
| 118 | +with Mopidy-MPD. |
| 119 | + |
| 120 | +The [Wikipedia article on |
| 121 | +MPD](https://en.wikipedia.org/wiki/Music_Player_Daemon#Clients) has a |
| 122 | +short list of well-known clients. In the MPD wiki there is a [more |
| 123 | +complete list](https://mpd.fandom.com/wiki/Clients) of the available MPD |
| 124 | +clients. Both lists are grouped by user interface, e.g. terminal, |
| 125 | +graphical, or web-based |
| 126 | + |
| 127 | +## Project resources |
| 128 | + |
| 129 | +- [Source code](https://github.com/mopidy/mopidy-mpd) |
| 130 | +- [Issues](https://github.com/mopidy/mopidy-mpd/issues) |
| 131 | +- [Releases](https://github.com/mopidy/mopidy-mpd/releases) |
| 132 | + |
| 133 | +## Development |
| 134 | + |
| 135 | +### Set up development environment |
| 136 | + |
| 137 | +Clone the repo using, e.g. using [gh](https://cli.github.com/): |
| 138 | + |
| 139 | +```sh |
| 140 | +gh repo clone mopidy/mopidy-mpd |
| 141 | +``` |
| 142 | + |
| 143 | +Enter the directory, and install dependencies using [uv](https://docs.astral.sh/uv/): |
| 144 | + |
| 145 | +```sh |
| 146 | +cd mopidy-mpd/ |
| 147 | +uv sync |
| 148 | +``` |
| 149 | + |
| 150 | +### Running tests |
| 151 | + |
| 152 | +To run all tests and linters in isolated environments, use |
| 153 | +[tox](https://tox.wiki/): |
| 154 | + |
| 155 | +```sh |
| 156 | +tox |
| 157 | +``` |
| 158 | + |
| 159 | +To only run tests, use [pytest](https://pytest.org/): |
| 160 | + |
| 161 | +```sh |
| 162 | +pytest |
| 163 | +``` |
| 164 | + |
| 165 | +To format the code, use [ruff](https://docs.astral.sh/ruff/): |
| 166 | + |
| 167 | +```sh |
| 168 | +ruff format . |
| 169 | +``` |
| 170 | + |
| 171 | +To check for lints with ruff, run: |
| 172 | + |
| 173 | +```sh |
| 174 | +ruff check . |
| 175 | +``` |
| 176 | + |
| 177 | +To check for type errors, use [pyright](https://microsoft.github.io/pyright/): |
| 178 | + |
| 179 | +```sh |
| 180 | +pyright . |
| 181 | +``` |
| 182 | + |
| 183 | +### Making a release |
| 184 | + |
| 185 | +To make a release to PyPI, go to the project's [GitHub releases |
| 186 | +page](https://github.com/mopidy/mopidy-mpd/releases) |
| 187 | +and click the "Draft a new release" button. |
| 188 | + |
| 189 | +In the "choose a tag" dropdown, select the tag you want to release or create a |
| 190 | +new tag, e.g. `v0.1.0`. Add a title, e.g. `v0.1.0`, and a description of the changes. |
| 191 | + |
| 192 | +Decide if the release is a pre-release (alpha, beta, or release candidate) or |
| 193 | +should be marked as the latest release, and click "Publish release". |
| 194 | + |
| 195 | +Once the releease is created, the `release.yml` GitHub Action will automatically |
| 196 | +build and publish the release to |
| 197 | +[PyPI](https://pypi.org/project/mopidy-mpd/). |
| 198 | + |
| 199 | +## Credits |
| 200 | + |
| 201 | +- Original author: [Stein Magnus Jodal](https://github.com/jodal) and |
| 202 | + [Thomas Adamcik](https://github.com/adamcik) for the Mopidy-MPD |
| 203 | + extension in Mopidy core. |
| 204 | +- Current maintainer: None. Maintainer wanted, see section above. |
| 205 | +- [Contributors](https://github.com/mopidy/mopidy-mpd/graphs/contributors) |
0 commit comments