RaspyFIを試す(Last.fm編)

  • 投稿日:
  • by
  • カテゴリ:
  • タグ:

RaspyFiや RuneAudio、Volumioの利点は Web UIですが、聴いてる曲を Last.fmに scrobbleさせるにはどうしたら良いでしょうか?

フォーラムに回答が出ていますので、やってみましょう。

その前に apt-get updateをしてください。 でも upgradeはしないように。
まず mpdscribbleを導入します。

root@Raspyfi:~# apt-get install mpdscribble
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
dconf-gsettings-backend dconf-service glib-networking glib-networking-common
glib-networking-services gsettings-desktop-schemas libdconf0 libmozjs10d
libnspr4 libproxy0 libsoup2.4-1
The following NEW packages will be installed:
dconf-gsettings-backend dconf-service glib-networking glib-networking-common
glib-networking-services gsettings-desktop-schemas libdconf0 libmozjs10d
libnspr4 libproxy0 libsoup2.4-1 mpdscribble
0 upgraded, 12 newly installed, 0 to remove and 124 not upgraded.
Need to get 1,657 kB of archives.
After this operation, 6,013 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libdconf0 armhf 0.12.1-3 [21.0 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libnspr4 armhf 2:4.9.2-1+deb7u1 [115 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libproxy0 armhf 0.3.1-6 [30.0 kB]
Get:4 http://mirrordirector.raspbian.org/raspbian/ wheezy/main glib-networking-common all 2.32.3-1 [49.4 kB]
Get:5 http://mirrordirector.raspbian.org/raspbian/ wheezy/main glib-networking-services armhf 2.32.3-1 [12.8 kB]
Get:6 http://mirrordirector.raspbian.org/raspbian/ wheezy/main dconf-service armhf 0.12.1-3 [20.2 kB]
Get:7 http://mirrordirector.raspbian.org/raspbian/ wheezy/main dconf-gsettings-backend armhf 0.12.1-3 [18.4 kB]
Get:8 http://mirrordirector.raspbian.org/raspbian/ wheezy/main gsettings-desktop-schemas all 3.4.2-3 [114 kB]
Get:9 http://mirrordirector.raspbian.org/raspbian/ wheezy/main glib-networking armhf 2.32.3-1 [48.4 kB]
Get:10 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libsoup2.4-1 armhf 2.38.1-2 [194 kB]
Get:11 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libmozjs10d armhf 10.0.12esr-1+rpi2 [998 kB]
Get:12 http://mirrordirector.raspbian.org/raspbian/ wheezy/main mpdscribble armhf 0.22-3 [36.4 kB]
Fetched 1,657 kB in 5s (300 kB/s)
Preconfiguring packages ...
Selecting previously unselected package libdconf0:armhf.
(Reading database ... 34334 files and directories currently installed.)
Unpacking libdconf0:armhf (from .../libdconf0_0.12.1-3_armhf.deb) ...
Selecting previously unselected package libnspr4:armhf.
Unpacking libnspr4:armhf (from .../libnspr4_2%3a4.9.2-1+deb7u1_armhf.deb) ...
Selecting previously unselected package libproxy0:armhf.
Unpacking libproxy0:armhf (from .../libproxy0_0.3.1-6_armhf.deb) ...
Selecting previously unselected package glib-networking-common.
Unpacking glib-networking-common (from .../glib-networking-common_2.32.3-1_all.deb) ...
Selecting previously unselected package glib-networking-services.
Unpacking glib-networking-services (from .../glib-networking-services_2.32.3-1_armhf.deb) ...
Selecting previously unselected package dconf-service.
Unpacking dconf-service (from .../dconf-service_0.12.1-3_armhf.deb) ...
Selecting previously unselected package dconf-gsettings-backend:armhf.
Unpacking dconf-gsettings-backend:armhf (from .../dconf-gsettings-backend_0.12.1-3_armhf.deb) ...
Selecting previously unselected package gsettings-desktop-schemas.
Unpacking gsettings-desktop-schemas (from .../gsettings-desktop-schemas_3.4.2-3_all.deb) ...
Selecting previously unselected package glib-networking:armhf.
Unpacking glib-networking:armhf (from .../glib-networking_2.32.3-1_armhf.deb) ...
Selecting previously unselected package libsoup2.4-1:armhf.
Unpacking libsoup2.4-1:armhf (from .../libsoup2.4-1_2.38.1-2_armhf.deb) ...
Selecting previously unselected package libmozjs10d.
Unpacking libmozjs10d (from .../libmozjs10d_10.0.12esr-1+rpi2_armhf.deb) ...
Selecting previously unselected package mpdscribble.
Unpacking mpdscribble (from .../mpdscribble_0.22-3_armhf.deb) ...
Processing triggers for libglib2.0-0:armhf ...
Setting up libdconf0:armhf (0.12.1-3) ...
Setting up libnspr4:armhf (2:4.9.2-1+deb7u1) ...
Setting up libproxy0:armhf (0.3.1-6) ...
Setting up glib-networking-common (2.32.3-1) ...
Setting up glib-networking-services (2.32.3-1) ...
Setting up dconf-service (0.12.1-3) ...
Setting up dconf-gsettings-backend:armhf (0.12.1-3) ...
Setting up gsettings-desktop-schemas (3.4.2-3) ...
Setting up glib-networking:armhf (2.32.3-1) ...
Setting up libsoup2.4-1:armhf (2.38.1-2) ...
Setting up libmozjs10d (10.0.12esr-1+rpi2) ...
Setting up mpdscribble (0.22-3) ...

Creating config file /etc/default/mpdscribble with new version

Creating config file /etc/mpdscribble.conf with new version
insserv: warning: script 'K02shairport' missing LSB tags and overrides
insserv: warning: script 'shairport' missing LSB tags and overrides
[....] Not starting Music Player Daemon Last.fm Client, disabled via /etc/defaul[warnscribble ... (warning).
localepurge: Disk space freed in /usr/share/locale: 852 KiB
localepurge: Disk space freed in /usr/share/man: 0 KiB

Total disk space freed by localepurge: 852 KiB
root@Raspyfi:~#

設定ファイル(/etc/mpdscribble.conf)に Last.fmのユーザー名とパスワードを記述します。

root@Raspyfi:~# vi /etc/mpdscribble.conf
(略)
root@Raspyfi:~# cat /etc/mpdscribble.conf
## mpdscribble - an audioscrobbler for the Music Player Daemon.
## http://mpd.wikia.com/wiki/Client:mpdscribble

# HTTP proxy URL.
#proxy = http://the.proxy.server:3128

# The location of the pid file. mpdscribble saves its process id there.
#pidfile = /var/run/mpdscribble.pid

# Change to this system user after daemonization.
#daemon_user = mpdscribble

# The location of the mpdscribble log file. The special value
# "syslog" makes mpdscribble use the local syslog daemon. On most
# systems, log messages will appear in /var/log/daemon.log then.
# "-" means log to stderr (the current terminal).
log = syslog

# How verbose mpdscribble's logging should be. Default is 1.
verbose = 1

# How often should mpdscribble save the journal file? [seconds]
#journal_interval = 600

# The host running MPD, possibly protected by a password
# ([PASSWORD@]HOSTNAME). Defaults to $MPD_HOST or localhost.
#host = localhost

# The port that the MPD listens on and mpdscribble should try to
# connect to. Defaults to $MPD_PORT or 6600.
#port = 6600

[last.fm]
url = http://post.audioscrobbler.com/
username = hogehoge
password = himitsu

# The file where mpdscribble should store its Last.fm journal in case
# you do not have a connection to the Last.fm server.
journal = /var/cache/mpdscribble/lastfm.journal

#[libre.fm]
#url = http://turtle.libre.fm/
#username = my_username
#password = my_password
#journal = /var/cache/mpdscribble/librefm.journal

#[jamendo]
#url = http://postaudioscrobbler.jamendo.com/
#username = my_username
#password = my_password
#journal = /var/cache/mpdscribble/jamendo.journal

#[file]
#file = /var/log/mpdscribble/log
root@Raspyfi:~#

/etc/default/mpdscribbleを編集します。

root@Raspyfi:~# vi /etc/default/mpdscribble
(略)
root@Raspyfi:~# cat /etc/default/mpdscribble
# Defaults for mpdscribble initscript
# sourced by /etc/init.d/mpdscribble
# installed at /etc/default/mpdscribble by the maintainer scripts

#
# This is a POSIX shell fragment
#

# Whether to enable system wide daemon
MPD_SYSTEMWIDE=1

# Additional options that are passed to the Daemon.
DAEMON_OPTS=""

# user/group to use (mpdscribble:mpdscribble are default)
#USER=mpdscribble
#GROUP=mpdscribble
root@Raspyfi:~#

mpdscribbleデーモンを起動します。

root@Raspyfi:~# /etc/init.d/mpdscribble start
[ ok ] Starting Music Player Daemon Last.fm Client: mpdscribble.
root@Raspyfi:~#

これで再生した曲が Last.fmに載るようになりました。