Last.fm playback with lastfmproxy

lastfmproxy is a python script that streams a last.fm music stream to another media player. To setup, install from AUR: Template:Codeline and then edit Template:Filename. If you plan to only stream to mpd on the same host, just edit the login info.

Note: Since it installs to a read only directory but it requires read/write access for features like saving previously listened to stations, it would be wise to copy Template:Filename to your home directory.

This will change the player status to "paused", if it was stopped while playing. Next, you want this file to be preserved, so mpd updates won't erase this edit. Add (or edit) this line to your Template:Filename:

NoUpgrade = etc/rc.d/mpd

Or Simple method add mpd to your rc.conf daemons array and add mpc stop to rc.local loacated in /etc (Remember you must got mpc installed to have this method working).

Searching on Internet I found the reason for why that happens in Gentoo's wiki:

The sound card does not support hardware mixing (uses dmix plugin)

An application does not work with ALSA with it's default settings

High CPU usage with ALSA

When using MPD with ALSA, users may experience MPD taking up lots of CPU (around 20-30%). This is caused by most sound cards supporting 48kHz and most music being 44kHz, thus forcing MPD to resample it. This operation takes lots of CPU cycles and results into high usage.

Some users might also want to tell dmix to use 44kHz as well. More info about tuning performance of your MPD can be found from: MPD wiki

Control mpd with lirc

There are already some clients designe for communications between lircd and mpd, however, as far as the practical use, they aren't very useful since their functions are limited.

It's recommended to use mpc with irexec. mpc is a command line player which only sends the command to mpd and exits immediately, which is perfect for irexec, the command runner included in lirc. What irexec does is that it runs a specified command once received a remote control button.

First of all, please setup your remotes as referred to the Lirc article.

run remuco on your phone, define a new bluetooth remuco connection (pair first if you haven't done this previously) and explore its capabilities

More information about remuco including troubleshooting to be found at its homepage

MPD & PulseAudio

First, install (mpd-pulse) in the Arch User Repository as opposed to the regular mpd client in the Extra repository.

Then, edit Template:Filename, and uncomment the audio_output section for the type "pulse". The server and sink lines of it should be commented unless you know what you're doing.

Then, add the mpd user (and yours if you haven't done so already) to the necessary pulse groups. The pulse-access group should be sufficient but you may want to add pulse-rt as well. The group "pulse" doesn't appear to be necessary.

# gpasswd -a mpd pulse-access
# gpasswd -a mpd pulse-rt

Lastly, you may or may not need to copy Template:Filename from your current (pulse working) user's dir to your mpd user's home directory. It is likely to be Template:Filename if you followed the first part of this wiki. This would probably only allow your current user to listen in on mpd's pulse. You may consider running pulse system-wide if that's insufficient.

Cannot connect to mpd: host "localhost" not found: Temporary failure in name resolution

Cannot connect to mpd (with ncmpcpp), if you are disconnected from network. Solution is disable IPv6 or add line to /etc/hosts

::1 localhost.localdomain localhost

Port 6600 already in use

MPD needs to bind to port 6600 and cannot start if it's already in use. The most common reason for this is that the user has started mpd once and then subsequently tried mpd --create-db. New mpd behavior is the --create-db option also attempts to start the daemon; if it's already been started, this will fail. If this is the case, try the following:

$ mpd --kill
$ mpd --create-db

A more brute-force approach:

$ killall mpd
$ mpd --create-db

Note: If you typically run mpd as root, you will need to run the above commands as root.

In the git version of mpd, --create-db is completely deprecated. The database will be created automagically on first run and can subsequently be updated via your client (i.e. mpc update). Eventually, inotify support will offer fully automatic database updates as you add content to your music folders

If port 6600 is tied up for some other reason, one can use the following command to find the offending process:

# netstat -tulpan | grep 6600

This will list IP:Port and the process name holding the connection (root privileges are required to see all processes).

Crackling sound with some audio files

This is usually a playback speed problem and can be fixed by uncommenting the audio_output_format line in: