Advertisement
xseeks

How to get MPD working in Ubuntu 11.10 (fixed)

Nov 26th, 2011
1,128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.11 KB | None | 0 0
  1. This is my little how-to file on getting MPD to finally goddamn work.
  2.  
  3. For reference, I'm running Ubuntu 11.10 64-bit, using PulseAudio.
  4.  
  5. - First step, make sure you've got mpd, mpc and pavucontrol installed.
  6.  
  7. - Second, copy /etc/mpd.conf to ~/.mpdconf
  8.  
  9. - Create a ~/.mpd directory. Inside that directory, create the files mpd.log,
  10. mpd.pid, mpdstate and mpddb. You could probably name mpddb something else.
  11. The command I used was 'touch {mpddb,mpd.log,mpd.pid,mpdstate}'
  12.  
  13. - Create a playlist directory. I created mine in ~/audio/mp3/playlists, but
  14. you could just as easily (as well as perhaps more appropriately) create
  15. yours in ~/.mpd/playlists.
  16.  
  17. - I'm not sure if this is necessary, as I did this before I commented out the
  18. relevant line in mpdconf. Regardless, if things don't work otherwise, give
  19. it a shot: If you're using a firewall/router, make sure you're forwarding
  20. port 6600 for mpd. My machine's on 192.168.1.104, so I did it for that IP
  21. address.
  22.  
  23. - Editing .mpdconf: Most things in the conf file can be left alone. There
  24. are a few things that need to be changed, however. Open ~/.mpdconf in your
  25. text editor of choice and change the music_directory, playlist_directory,
  26. db_file, log_file, pid_file and state_file settings to their appropriate
  27. settings. music_directory might be /home/YOU/Music, for instance. If you've
  28. been following this text, then log_file (for example) would be in
  29. '/home/YOU/.mpd/mpd.log'.
  30.  
  31. Make sure everything is commented out as you scroll down, until you get to the
  32. Input section. Mine was uncommented by default, so I just left it as-is. The
  33. exceptions being (and I can't quite remember 100%) the sections related to
  34. binding an address and what user MPD should run as. Make sure those are
  35. commented out.
  36.  
  37. Scroll a little further to the Audio Output section. Comment out the ALSA
  38. section (all of it) and scroll down to the PulseAudio example. Uncomment the
  39. line with 'audio_output {', as well as the two below it. The lines with
  40. 'server' and 'sink' can stay commented. Uncomment the closing bracket and
  41. you're good. Here's what my section looks like:
  42.  
  43.  
  44. audio_output {
  45. type "pulse"
  46. name "MPD"
  47. # server "remote_server" # optional
  48. # sink "remote_server_sink" # optional
  49. }
  50.  
  51.  
  52. After that, scroll down to the Volume control mixer settings. You can leave
  53. this alone if you want, but I prefer to uncomment the software mixter_type line.
  54. This lets you adjust the volume with mpc.
  55.  
  56. And now... you're done! There are a couple of other misc options (character
  57. encoding, etc.), but I just leave those alone.
  58.  
  59.  
  60. - Run mpd. Just typing 'mpd' should do the trick. It'll crunch some numbers
  61. for a few seconds while it's populating your database with songs from the
  62. directory you supplied in .mpdconf. It might give you some guff about
  63. 'corrupt database' or something. Just ignore that.
  64.  
  65. - After it stops eating your CPU, see if mpc works. Try 'mpc listall'. If it
  66. lists some stuff, the battle's almost won. Now you need to add some of
  67. these things to a playlist.
  68.  
  69. - To find an artist's songs, type 'mpc find artist <artist>'. For example, to
  70. find Radiohead songs, type mpc find artist Radiohead. To find and add these
  71. to a playlist at the same time, type mpc findadd artist Radiohead.
  72.  
  73. - Type mpc play. It should start playing music now, though you probably won't
  74. hear anything. If you do: awesome. If you're like me, you need to run
  75. 'pavucontrol', look in the Playback tab, make sure it's showing Applications
  76. (drop-down menu near the bottom of the window), and adjust the Music Play Daemon
  77. section. What I had to do was click the box next to the little volume meter for
  78. that channel, and select 'Internal Audio Analog Stereo', though you might need
  79. to pick something else.
  80.  
  81. And now... you should hear the music playing. Congratulations, you're done.
  82.  
  83. Check 'man mpc' to get an idea of the other commands and how to manipulate
  84. playlists. I'm still new to this myself, so I barely know what I'm doing.
  85.  
  86.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement