├── README.md ├── Dockerfile ├── mopidy.conf └── default.pa /README.md: -------------------------------------------------------------------------------- 1 | See https://hub.docker.com/r/malted/mopidy-pulseaudio-server/ for details 2 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Pull base image 2 | FROM resin/rpi-raspbian:jessie 3 | MAINTAINER Malte Delfs 4 | 5 | # Install dependencies 6 | RUN apt-get update && apt-get install -y wget 7 | RUN wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/wheezy.list 8 | RUN apt-get update && apt-get install -y \ 9 | mopidy mopidy-spotify mopidy-spotify-tunigo \ 10 | pulseaudio pulseaudio-utils gstreamer1.0 gstreamer0.10-pulseaudio libsdl1.2debian \ 11 | python python-pip 12 | 13 | RUN pip install mopidy-musicbox-webclient Mopidy-Local-SQLite 14 | 15 | # Copy config files 16 | COPY default.pa /etc/pulse/default.pa 17 | COPY mopidy.conf /etc/mopidy/mopidy.conf 18 | 19 | RUN mkdir -p ~/.config/pulse 20 | RUN touch ~/.config/pulse/cookie 21 | 22 | EXPOSE 6600 6680 23 | 24 | # Run 25 | CMD pulseaudio --start && printf "\n[spotify]\nusername = %s\npassword = %s\n" "$USER" "$PASS" >> /etc/mopidy/mopidy.conf & mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf local scan & mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf 26 | -------------------------------------------------------------------------------- /mopidy.conf: -------------------------------------------------------------------------------- 1 | [mpd] 2 | hostname = :: 3 | 4 | [http] 5 | hostname = :: 6 | 7 | [core] 8 | cache_dir = /var/cache/mopidy 9 | config_dir = /etc/mopidy 10 | data_dir = /var/lib/mopidy 11 | 12 | [logging] 13 | config_file = /etc/mopidy/logging.conf 14 | debug_file = /var/log/mopidy/mopidy-debug.log 15 | 16 | [local] 17 | library = sqlite 18 | scan_flush_threshold = 100 19 | data_dir = /var/lib/mopidy/local 20 | media_dir = /var/lib/mopidy/media 21 | 22 | [local-sqlite] 23 | enabled = true 24 | 25 | # top-level directories for browsing, as 26 | directories = 27 | Albums local:directory?type=album 28 | Artists local:directory?type=artist 29 | Composers local:directory?type=artist&role=composer 30 | Genres local:directory?type=genre 31 | Performers local:directory?type=artist&role=performer 32 | Release Years local:directory?type=date&format=%25Y 33 | Tracks local:directory?type=track 34 | 35 | # database connection timeout in seconds 36 | timeout = 10 37 | 38 | # whether to use an album's musicbrainz_id for generating its URI 39 | use_album_mbid_uri = true 40 | 41 | # whether to use an artist's musicbrainz_id for generating its URI; 42 | # disabled by default, since some taggers do not handle this well for 43 | # multi-artist tracks [https://github.com/sampsyo/beets/issues/907] 44 | use_artist_mbid_uri = false 45 | 46 | # whether to use the sortname field for sorting artist browse results; 47 | # set to false to sort according to displayed name only 48 | use_artist_sortname = true 49 | 50 | [m3u] 51 | playlists_dir = /var/lib/mopidy/playlists 52 | 53 | [audio] 54 | output = pulsesink server=127.0.0.1 55 | -------------------------------------------------------------------------------- /default.pa: -------------------------------------------------------------------------------- 1 | #!/usr/bin/pulseaudio -nF 2 | # 3 | # This file is part of PulseAudio. 4 | # 5 | # PulseAudio is free software; you can redistribute it and/or modify it 6 | # under the terms of the GNU Lesser General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # PulseAudio is distributed in the hope that it will be useful, but 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public License 16 | # along with PulseAudio; if not, write to the Free Software Foundation, 17 | # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 18 | 19 | # This startup script is used only if PulseAudio is started in system 20 | # mode. 21 | 22 | ### Automatically load driver modules depending on the hardware available 23 | .ifexists module-udev-detect.so 24 | load-module module-udev-detect 25 | .else 26 | ### Use the static hardware detection module (for systems that lack udev/hal support) 27 | load-module module-detect 28 | .endif 29 | 30 | ### Load several protocols 31 | .ifexists module-esound-protocol-unix.so 32 | load-module module-esound-protocol-unix 33 | .endif 34 | load-module module-native-protocol-unix 35 | 36 | ### Automatically restore the volume of streams and devices 37 | load-module module-stream-restore 38 | load-module module-device-restore 39 | 40 | ### Automatically restore the default sink/source when changed by the user 41 | ### during runtime 42 | ### NOTE: This should be loaded as early as possible so that subsequent modules 43 | ### that look up the default sink/source get the right value 44 | load-module module-default-device-restore 45 | 46 | ### Automatically move streams to the default sink if the sink they are 47 | ### connected to dies, similar for sources 48 | load-module module-rescue-streams 49 | 50 | ### Make sure we always have a sink around, even if it is a null sink. 51 | load-module module-always-sink 52 | 53 | ### Automatically suspend sinks/sources that become idle for too long 54 | # load-module module-suspend-on-idle -1 55 | 56 | ### Enable positioned event sounds 57 | load-module module-position-event-sounds 58 | load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 59 | load-module module-null-sink sink_name=rtp 60 | load-module module-rtp-send source=rtp.monitor port=45678 61 | set-default-sink rtp --------------------------------------------------------------------------------