Setup mpd » Historie » Version 1
Jeremias Keihsler, 12.01.2017 16:55
| 1 | 1 | Jeremias Keihsler | h1. Install MPD |
|---|---|---|---|
| 2 | |||
| 3 | this is based on http://www.forum-raspberrypi.de/Thread-tutorial-music-player-daemon-mpd-und-mpc-auf-dem-raspberry-pi |
||
| 4 | |||
| 5 | h2. update package-list |
||
| 6 | |||
| 7 | <pre><code class="bash"> |
||
| 8 | sudo apt-get update |
||
| 9 | </code></pre> |
||
| 10 | |||
| 11 | h2. install needed packages |
||
| 12 | |||
| 13 | <pre><code class="bash"> |
||
| 14 | sudo apt-get install mpd mpc alsa-utils |
||
| 15 | </code></pre> |
||
| 16 | |||
| 17 | h2. sound settings |
||
| 18 | |||
| 19 | <pre><code class="bash"> |
||
| 20 | sudo modprobe snd_bcm2835 |
||
| 21 | sudo amixer cset numid=3 1 |
||
| 22 | </code></pre> |
||
| 23 | |||
| 24 | h2. configuration |
||
| 25 | |||
| 26 | <pre><code class="bash"> |
||
| 27 | sudo vim /etc/mpd.conf |
||
| 28 | </code></pre> |
||
| 29 | to use MPD via network you need to comment following line out |
||
| 30 | <pre> |
||
| 31 | ... |
||
| 32 | #bind_to_address |
||
| 33 | ... |
||
| 34 | </pre> |
||
| 35 | |||
| 36 | adjust output |
||
| 37 | <pre> |
||
| 38 | ... |
||
| 39 | audio_output { |
||
| 40 | type "alsa" |
||
| 41 | name "My ALSA Device" |
||
| 42 | device "hw:0,0" # optional |
||
| 43 | # format "44100:16:2" # optional |
||
| 44 | # mixer_device "default" # optional |
||
| 45 | # mixer_control "PCM" # optional |
||
| 46 | # mixer_index "0" # optional |
||
| 47 | } |
||
| 48 | ... |
||
| 49 | </pre> |
||
| 50 | |||
| 51 | h2. load modules after reboot |
||
| 52 | |||
| 53 | <pre><code class="bash"> |
||
| 54 | sudo vim /etc/modules |
||
| 55 | </code></pre> |
||
| 56 | <pre> |
||
| 57 | # /etc/modules: kernel modules to load at boot time. |
||
| 58 | # |
||
| 59 | # This file contains the names of kernel modules that should be loaded |
||
| 60 | # at boot time, one per line. Lines beginning with "#" are ignored. |
||
| 61 | # Parameters can be specified after the module name. |
||
| 62 | |||
| 63 | snd-bcm2835 |
||
| 64 | </pre> |
||
| 65 | |||
| 66 | h2. set permissions |
||
| 67 | |||
| 68 | <pre><code class="bash"> |
||
| 69 | sudo chmod g+w /var/lib/mpd/music/ /var/lib/mpd/playlists/ |
||
| 70 | sudo chgrp audio /var/lib/mpd/music/ /var/lib/mpd/playlists/ |
||
| 71 | </code></pre> |
||
| 72 | |||
| 73 | h2. add music |
||
| 74 | |||
| 75 | ==== files ==== |
||
| 76 | put .mp3's into directory @/var/lib/mpd/music@ |
||
| 77 | |||
| 78 | ==== playlists for online streams ==== |
||
| 79 | put .pls or .m3u into directory @/var/lib/mpd/playlists@ |
||
| 80 | |||
| 81 | http://wiki.ubuntuusers.de/Internetradio/Stationen#Radiosender-Deutschland |
||
| 82 | h2. restart and database update |
||
| 83 | |||
| 84 | <pre><code class="bash"> |
||
| 85 | sudo /etc/init.d/mpd restart |
||
| 86 | sudo mpc update |
||
| 87 | </code></pre> |