Raspberry Pi +MPD+myMPD音楽再生環境
Raspberry Pi 3A+の使い方として音楽ファイルを再生する環境を試してみました。
この手でよく見かけたのがMPD(Music Player Daemon)で調べてみると分かりやすい手順で紹介されていたので参考にさせていただきました。
手順はまさにそのままなのですが自分の備忘録して実際の操作を書いてます。
MPDインストール
最新バージョンでなければパッケージをただインストール
$sudo apt update
$sudo apt install mpd
ALSAのデバイス番号確認
aplayコマンドで確認、ヘッドフォン端子とHDMIが表示されました
$aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 1: vc4hdmi [vc4-hdmi], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
設定ファイル変更(/etc/mpd.conf)
mpd.confのデフォルト設定と自分の環境に合わせて修正しました
音楽ファイル保存フォルダ
music_directory "/mnt/usb/nas/Multimedia"
MPDデータベースの自動更新有効化
auto_update "yes"
Raspberry Piのアドレス設定
bind_to_address "xxx.xxx.xxx.xxx"
接続ポート
port "6600"
出力デバイス
deviceにaplayコマンドで確認したカード番号:デバイス番号を指定、自分の環境ではplughw:(カード番号):(デバイス番号)で鳴りましたが鳴らない場合はhw:(カード番号):(デバイス番号)を試してみるとなるかもしれないようです。
デバイスはヘッドフォンとHDMIがありましたが今回はヘッドフォン端子にスピーカーを接続しているので上段のカード番号0、デバイス番号0を指定しています。
またMPDクライアントからボリューム調整ができるようにmixer_typeも指定しました。
audio_output {
type "alsa"
name "My ALSA Device"
device "plughw:0,0"
mixer_type "software"
}
音量の設定
MPD経由での再生時はalsamixerでの変更は効果がない(使用されない)
amixerで設定
amixer -c[デバイス番号]で音量レベルを確認、下記は音量レベルが60%の状態
$ amixer -c0
Simple mixer control 'Headphone',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback -10239 - 400
Mono: Playback -3856 [60%] [-38.56dB] [on]
ボリュームレベルは数字や%で設定できるようで自分は%で指定をしました
$ amixer sset Headphone 50% -c0
MPD起動
自動起動を有効(enable)しかつ実行させるために--nowオプションを指定しています。初回の起動メッセージにtag_cacheファイルがない旨のエラーが表示しましたが自動的に作られました。
sudo systemctl enable --now mpd
Synchronizing state of mpd.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable mpd
hoto@pi3a:/etc $ sudo systemctl status mpd.service
● mpd.service - Music Player Daemon
Loaded: loaded (/lib/systemd/system/mpd.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2023-05-02 23:08:49 JST; 14s ago
TriggeredBy: ● mpd.socket
Docs: man:mpd(1)
man:mpd.conf(5)
file:///usr/share/doc/mpd/html/user.html
Main PID: 2873 (mpd)
Tasks: 5 (limit: 191)
CPU: 1.543s
CGroup: /system.slice/mpd.service
└─2873 /usr/bin/mpd --no-daemon
May 02 23:08:48 pi3a systemd[1]: Starting Music Player Daemon...
May 02 23:08:49 pi3a mpd[2873]: May 02 23:08 : exception: Failed to open '/var/lib/mpd/tag_cache': No such file or directory
May 02 23:08:49 pi3a systemd[1]: Started Music Player Daemon.
接続テスト
CLIのmpcをインストール
$ sudo apt install mpc
$ mpc --host=[Raspberry Pi IPアドレス] ls
楽曲名1
楽曲名2
・・・
表示しない場合はmpc --host=[Raspberry Pi IPアドレス] updateでアップデートするとよいようです
MPD GUIインタフェース
MPDをPCやスマートフォンから操作するために専用ソフトをインストールしてもよかったのですがいちいちインストールすのが手間なのでWEBベースを探してみるとympdというのがあるようですが更新が止まっているということで派生(?)したmyMPDにしてみました。
myMPDインストール
今回はコンパイルしてインストールしました
cmaikeインストール
インストールしていなかったのでインストール
$sudo apt install cmake
$ cd /tmp
$ git clone https://github.com/jcorporation/myMPD.git
$ cd myMPD
$ sudo ./build.sh releaseinstall
ERROR: jq not foundエラーで失敗、jqパッケージを追加インストール
$ sudo apt install jq
PCRE2エラー
CMake Error at /usr/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find PCRE2 (missing: PCRE2_LIBRARY PCRE2_INCLUDE_DIR)
libpcre2-devをインストール
sudo apt install libpcre2-dev
インストール成功時のログ
sudo ./build.sh releaseinstall
Compiling myMPD v10.3.1
Cmake version: 3.18.4
Cmake src dir: /tmp/myMPD
Cmake build dir: /tmp/myMPD/release
Cmake build type: Release
Compiler: GNU 10.2.1
CMAKE_C_FLAGS:
CMAKE_EXE_LINKER_FLAGS:
Executables in: /usr/bin
Workdir: /var/lib/mympd
Cachedir: /var/cache/mympd
Embedding assets in binary
Creating assets in /tmp/myMPD/release
Creating i18n json
Minifying /tmp/myMPD/release/htdocs/js/i18n.js
Minifying javascript
Creating mympd.js
Minifying htdocs/sw.js
Minifying /tmp/myMPD/release/htdocs/js/mympd.js
Combining and compressing javascript
/tmp/myMPD/release/htdocs/js/combined.js: 79.2% -- replaced with /tmp/myMPD/release/htdocs/js/combined.js.gz
/tmp/myMPD/release/htdocs/sw.min.js: 61.7%
Minifying stylesheets
Minifying htdocs/css/mympd.css
Minifying htdocs/css/theme-dark.css
Minifying htdocs/css/theme-light.css
Combining and compressing stylesheets
/tmp/myMPD/release/htdocs/css/combined.css: 86.0% -- replaced with /tmp/myMPD/release/htdocs/css/combined.css.gz
Compressing i18n json
Minifying /tmp/myMPD/src/i18n/json/de-DE.json
/tmp/myMPD/release/htdocs/assets/i18n/de-DE.min.json: 70.8%
Minifying /tmp/myMPD/src/i18n/json/en-US.json
/tmp/myMPD/release/htdocs/assets/i18n/en-US.min.json: 63.1%
Minifying /tmp/myMPD/src/i18n/json/es-AR.json
/tmp/myMPD/release/htdocs/assets/i18n/es-AR.min.json: 71.3%
Minifying /tmp/myMPD/src/i18n/json/fr-FR.json
/tmp/myMPD/release/htdocs/assets/i18n/fr-FR.min.json: 71.4%
Minifying /tmp/myMPD/src/i18n/json/it-IT.json
/tmp/myMPD/release/htdocs/assets/i18n/it-IT.min.json: 70.8%
Minifying /tmp/myMPD/src/i18n/json/ja-JP.json
/tmp/myMPD/release/htdocs/assets/i18n/ja-JP.min.json: 72.7%
Minifying /tmp/myMPD/src/i18n/json/nl-NL.json
/tmp/myMPD/release/htdocs/assets/i18n/nl-NL.min.json: 69.6%
Minifying /tmp/myMPD/src/i18n/json/ru-RU.json
/tmp/myMPD/release/htdocs/assets/i18n/ru-RU.min.json: 73.6%
Minifying /tmp/myMPD/src/i18n/json/zh-Hans.json
/tmp/myMPD/release/htdocs/assets/i18n/zh-Hans.min.json: 66.6%
Minifying and compressing html
Minifying htdocs/index.html
/tmp/myMPD/release/htdocs/index.html: 87.9%
Creating other compressed assets
htdocs/mympd.webmanifest: 59.7%
htdocs/assets/coverimage-booklet.svg: 45.1%
htdocs/assets/coverimage-mympd.svg: 51.5%
htdocs/assets/coverimage-notavailable.svg: 47.9%
htdocs/assets/coverimage-stream.svg: 47.0%
htdocs/assets/mympd-background-dark.svg: 50.5%
htdocs/assets/mympd-background-light.svg: 52.0%
Copy images
'htdocs/assets/appicon-192.png' -> '/tmp/myMPD/release/htdocs/assets/appicon-192.png'
'htdocs/assets/appicon-512.png' -> '/tmp/myMPD/release/htdocs/assets/appicon-512.png'
Copy webfont
'dist/material-icons/MaterialIcons-Regular.woff2' -> '/tmp/myMPD/release/htdocs/assets/MaterialIcons-Regular.woff2'
dist/material-icons/ligatures.json: 66.3%
Copy integrated lua libraries
'contrib/lualibs/json.lua' -> '/tmp/myMPD/release/contrib/lualibs/json.lua'
'contrib/lualibs/mympd.lua' -> '/tmp/myMPD/release/contrib/lualibs/mympd.lua'
Document root: /var/lib/mympd/empty
-- Found PCRE2: /usr/lib/aarch64-linux-gnu/libpcre2-8.so
Searching for openssl
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)
OpenSSL is disabled because it was not found
Searching for libid3tag
-- Could NOT find LIBID3TAG (missing: LIBID3TAG_LIBRARY LIBID3TAG_INCLUDE_DIR)
Libid3tag is disabled because it was not found
Searching for flac
-- Could NOT find FLAC (missing: FLAC_LIBRARY FLAC_INCLUDE_DIR)
Flac is disabled because it was not found
Searching for lua
-- Could NOT find Lua (missing: LUA_LIBRARIES LUA_INCLUDE_DIR)
Lua is disabled because it was not found
Checking for compiler flag -std=gnu17
-- Performing Test COMPILER_SUPPORTS_FLAG
-- Performing Test COMPILER_SUPPORTS_FLAG - Success
Checking for compiler flag -fstack-clash-protection
-- Performing Test COMPILER_SUPPORTS_FLAG
-- Performing Test COMPILER_SUPPORTS_FLAG - Success
Checking for compiler flag -fcf-protection
-- Performing Test COMPILER_SUPPORTS_FLAG
-- Performing Test COMPILER_SUPPORTS_FLAG - Failed
Checking for compiler flag -fno-plt
-- Performing Test COMPILER_SUPPORTS_FLAG
-- Performing Test COMPILER_SUPPORTS_FLAG - Success
Generating stripped binary
Mongoose: IPv6 is enabled
Mongoose: SSL is disabled
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/myMPD/release
make: Entering directory '/tmp/myMPD/release'
make[1]: Entering directory '/tmp/myMPD/release'
make[2]: Entering directory '/tmp/myMPD/release'
Scanning dependencies of target libmympdclient
make[2]: Leaving directory '/tmp/myMPD/release'
make[2]: Entering directory '/tmp/myMPD/release'
[ 0%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/albumart.c.o
[ 1%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/async.c.o
[ 2%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/audio_format.c.o
[ 2%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/binary.c.o
[ 3%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/capabilities.c.o
[ 4%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/cmessage.c.o
[ 4%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/cmount.c.o
[ 5%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/cneighbor.c.o
[ 6%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/connection.c.o
[ 6%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/coutput.c.o
[ 7%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/cpartition.c.o
[ 8%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/cplaylist.c.o
[ 8%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/cstats.c.o
[ 9%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/cstatus.c.o
[ 10%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/database.c.o
[ 10%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/directory.c.o
[ 11%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/entity.c.o
[ 12%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/error.c.o
[ 12%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/fd_util.c.o
[ 13%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/fingerprint.c.o
[ 14%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/idle.c.o
[ 14%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/ierror.c.o
[ 15%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/iso8601.c.o
[ 16%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/kvlist.c.o
[ 16%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/list.c.o
[ 17%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/message.c.o
[ 18%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/mixer.c.o
[ 18%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/mount.c.o
[ 19%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/neighbor.c.o
[ 20%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/output.c.o
[ 20%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/parser.c.o
[ 21%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/partition.c.o
[ 22%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/password.c.o
[ 22%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/player.c.o
[ 23%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/playlist.c.o
[ 24%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/position.c.o
[ 25%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/queue.c.o
[ 25%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/quote.c.o
[ 26%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/replay_gain.c.o
[ 27%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/rdirectory.c.o
[ 27%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/readpicture.c.o
[ 28%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/recv.c.o
[ 29%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/resolver.c.o
[ 29%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/response.c.o
[ 30%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/rplaylist.c.o
[ 31%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/run.c.o
[ 31%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/search.c.o
[ 32%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/send.c.o
[ 33%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/settings.c.o
[ 33%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/socket.c.o
[ 34%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/song.c.o
[ 35%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/stats.c.o
[ 35%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/status.c.o
[ 36%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/sticker.c.o
[ 37%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/sync.c.o
[ 37%] Building C object dist/libmympdclient/CMakeFiles/libmympdclient.dir/src/tag.c.o
[ 38%] Linking C static library liblibmympdclient.a
make[2]: Leaving directory '/tmp/myMPD/release'
[ 38%] Built target libmympdclient
make[2]: Entering directory '/tmp/myMPD/release'
Scanning dependencies of target mjson
make[2]: Leaving directory '/tmp/myMPD/release'
make[2]: Entering directory '/tmp/myMPD/release'
[ 39%] Building C object dist/mjson/CMakeFiles/mjson.dir/mjson.c.o
[ 39%] Linking C static library libmjson.a
make[2]: Leaving directory '/tmp/myMPD/release'
[ 39%] Built target mjson
make[2]: Entering directory '/tmp/myMPD/release'
Scanning dependencies of target mongoose
make[2]: Leaving directory '/tmp/myMPD/release'
make[2]: Entering directory '/tmp/myMPD/release'
[ 40%] Building C object dist/mongoose/CMakeFiles/mongoose.dir/mongoose.c.o
[ 41%] Linking C static library libmongoose.a
make[2]: Leaving directory '/tmp/myMPD/release'
[ 41%] Built target mongoose
make[2]: Entering directory '/tmp/myMPD/release'
Scanning dependencies of target rax
make[2]: Leaving directory '/tmp/myMPD/release'
make[2]: Entering directory '/tmp/myMPD/release'
[ 42%] Building C object dist/rax/CMakeFiles/rax.dir/rax.c.o
[ 43%] Linking C static library librax.a
make[2]: Leaving directory '/tmp/myMPD/release'
[ 43%] Built target rax
make[2]: Entering directory '/tmp/myMPD/release'
Scanning dependencies of target sds
make[2]: Leaving directory '/tmp/myMPD/release'
make[2]: Entering directory '/tmp/myMPD/release'
[ 43%] Building C object dist/sds/CMakeFiles/sds.dir/sds.c.o
[ 44%] Linking C static library libsds.a
make[2]: Leaving directory '/tmp/myMPD/release'
[ 44%] Built target sds
make[2]: Entering directory '/tmp/myMPD/release'
Scanning dependencies of target tinymt
make[2]: Leaving directory '/tmp/myMPD/release'
make[2]: Entering directory '/tmp/myMPD/release'
[ 45%] Building C object dist/tinymt/CMakeFiles/tinymt.dir/tinymt32.c.o
[ 46%] Linking C static library libtinymt.a
make[2]: Leaving directory '/tmp/myMPD/release'
[ 46%] Built target tinymt
make[2]: Entering directory '/tmp/myMPD/release'
Scanning dependencies of target mympd
make[2]: Leaving directory '/tmp/myMPD/release'
make[2]: Entering directory '/tmp/myMPD/release'
[ 46%] Building C object src/CMakeFiles/mympd.dir/main.c.o
[ 47%] Building C object src/CMakeFiles/mympd.dir/lib/album_cache.c.o
[ 48%] Building C object src/CMakeFiles/mympd.dir/lib/api.c.o
[ 48%] Building C object src/CMakeFiles/mympd.dir/lib/config.c.o
[ 49%] Building C object src/CMakeFiles/mympd.dir/lib/covercache.c.o
[ 50%] Building C object src/CMakeFiles/mympd.dir/lib/env.c.o
[ 50%] Building C object src/CMakeFiles/mympd.dir/lib/filehandler.c.o
[ 51%] Building C object src/CMakeFiles/mympd.dir/lib/handle_options.c.o
[ 52%] Building C object src/CMakeFiles/mympd.dir/lib/http_client.c.o
[ 52%] Building C object src/CMakeFiles/mympd.dir/lib/jsonrpc.c.o
[ 53%] Building C object src/CMakeFiles/mympd.dir/lib/list.c.o
[ 54%] Building C object src/CMakeFiles/mympd.dir/lib/log.c.o
[ 55%] Building C object src/CMakeFiles/mympd.dir/lib/lua_mympd_state.c.o
[ 55%] Building C object src/CMakeFiles/mympd.dir/lib/m3u.c.o
[ 56%] Building C object src/CMakeFiles/mympd.dir/lib/mimetype.c.o
[ 57%] Building C object src/CMakeFiles/mympd.dir/lib/pin.c.o
[ 57%] Building C object src/CMakeFiles/mympd.dir/lib/msg_queue.c.o
[ 58%] Building C object src/CMakeFiles/mympd.dir/lib/mympd_state.c.o
[ 59%] Building C object src/CMakeFiles/mympd.dir/lib/random.c.o
[ 59%] Building C object src/CMakeFiles/mympd.dir/lib/rax_extras.c.o
[ 60%] Building C object src/CMakeFiles/mympd.dir/lib/sds_extras.c.o
[ 61%] Building C object src/CMakeFiles/mympd.dir/lib/smartpls.c.o
[ 61%] Building C object src/CMakeFiles/mympd.dir/lib/state_files.c.o
[ 62%] Building C object src/CMakeFiles/mympd.dir/lib/sticker_cache.c.o
[ 63%] Building C object src/CMakeFiles/mympd.dir/lib/utility.c.o
[ 63%] Building C object src/CMakeFiles/mympd.dir/lib/validate.c.o
[ 64%] Building C object src/CMakeFiles/mympd.dir/mpd_client/autoconf.c.o
[ 65%] Building C object src/CMakeFiles/mympd.dir/mpd_client/connection.c.o
[ 65%] Building C object src/CMakeFiles/mympd.dir/mpd_client/errorhandler.c.o
[ 66%] Building C object src/CMakeFiles/mympd.dir/mpd_client/features.c.o
[ 67%] Building C object src/CMakeFiles/mympd.dir/mpd_client/idle.c.o
[ 67%] Building C object src/CMakeFiles/mympd.dir/mpd_client/jukebox.c.o
[ 68%] Building C object src/CMakeFiles/mympd.dir/mpd_client/partitions.c.o
[ 69%] Building C object src/CMakeFiles/mympd.dir/mpd_client/playlists.c.o
[ 69%] Building C object src/CMakeFiles/mympd.dir/mpd_client/presets.c.o
[ 70%] Building C object src/CMakeFiles/mympd.dir/mpd_client/search.c.o
[ 71%] Building C object src/CMakeFiles/mympd.dir/mpd_client/search_local.c.o
[ 71%] Building C object src/CMakeFiles/mympd.dir/mpd_client/tags.c.o
[ 72%] Building C object src/CMakeFiles/mympd.dir/mpd_client/volume.c.o
[ 73%] Building C object src/CMakeFiles/mympd.dir/mpd_worker/mpd_worker.c.o
[ 73%] Building C object src/CMakeFiles/mympd.dir/mpd_worker/api.c.o
[ 74%] Building C object src/CMakeFiles/mympd.dir/mpd_worker/cache.c.o
[ 75%] Building C object src/CMakeFiles/mympd.dir/mpd_worker/smartpls.c.o
[ 75%] Building C object src/CMakeFiles/mympd.dir/mpd_worker/state.c.o
[ 76%] Building C object src/CMakeFiles/mympd.dir/mympd_api/mympd_api.c.o
[ 77%] Building C object src/CMakeFiles/mympd.dir/mympd_api/albumart.c.o
[ 77%] Building C object src/CMakeFiles/mympd.dir/mympd_api/browse.c.o
[ 78%] Building C object src/CMakeFiles/mympd.dir/mympd_api/extra_media.c.o
[ 79%] Building C object src/CMakeFiles/mympd.dir/mympd_api/filesystem.c.o
[ 80%] Building C object src/CMakeFiles/mympd.dir/mympd_api/home.c.o
[ 80%] Building C object src/CMakeFiles/mympd.dir/mympd_api/last_played.c.o
[ 81%] Building C object src/CMakeFiles/mympd.dir/mympd_api/lyrics.c.o
[ 82%] Building C object src/CMakeFiles/mympd.dir/mympd_api/mounts.c.o
[ 82%] Building C object src/CMakeFiles/mympd.dir/mympd_api/mympd_api_handler.c.o
[ 83%] Building C object src/CMakeFiles/mympd.dir/mympd_api/outputs.c.o
[ 84%] Building C object src/CMakeFiles/mympd.dir/mympd_api/partitions.c.o
[ 84%] Building C object src/CMakeFiles/mympd.dir/mympd_api/pictures.c.o
[ 85%] Building C object src/CMakeFiles/mympd.dir/mympd_api/playlists.c.o
[ 86%] Building C object src/CMakeFiles/mympd.dir/mympd_api/queue.c.o
[ 86%] Building C object src/CMakeFiles/mympd.dir/mympd_api/scripts.c.o
[ 87%] Building C object src/CMakeFiles/mympd.dir/mympd_api/settings.c.o
[ 88%] Building C object src/CMakeFiles/mympd.dir/mympd_api/smartpls.c.o
[ 88%] Building C object src/CMakeFiles/mympd.dir/mympd_api/song.c.o
[ 89%] Building C object src/CMakeFiles/mympd.dir/mympd_api/stats.c.o
[ 90%] Building C object src/CMakeFiles/mympd.dir/mympd_api/status.c.o
[ 90%] Building C object src/CMakeFiles/mympd.dir/mympd_api/sticker.c.o
[ 91%] Building C object src/CMakeFiles/mympd.dir/mympd_api/timer.c.o
[ 92%] Building C object src/CMakeFiles/mympd.dir/mympd_api/timer_handlers.c.o
[ 92%] Building C object src/CMakeFiles/mympd.dir/mympd_api/trigger.c.o
[ 93%] Building C object src/CMakeFiles/mympd.dir/mympd_api/volume.c.o
[ 94%] Building C object src/CMakeFiles/mympd.dir/mympd_api/webradios.c.o
[ 94%] Building C object src/CMakeFiles/mympd.dir/web_server/web_server.c.o
[ 95%] Building C object src/CMakeFiles/mympd.dir/web_server/albumart.c.o
[ 96%] Building C object src/CMakeFiles/mympd.dir/web_server/request_handler.c.o
[ 96%] Building C object src/CMakeFiles/mympd.dir/web_server/proxy.c.o
[ 97%] Building C object src/CMakeFiles/mympd.dir/web_server/radiobrowser.c.o
[ 98%] Building C object src/CMakeFiles/mympd.dir/web_server/sessions.c.o
[ 98%] Building C object src/CMakeFiles/mympd.dir/web_server/tagart.c.o
[ 99%] Building C object src/CMakeFiles/mympd.dir/web_server/utility.c.o
[100%] Building C object src/CMakeFiles/mympd.dir/web_server/webradiodb.c.o
[100%] Linking C executable ../bin/mympd
make[2]: Leaving directory '/tmp/myMPD/release'
[100%] Built target mympd
make[1]: Leaving directory '/tmp/myMPD/release'
make: Leaving directory '/tmp/myMPD/release'
Installing myMPD
[ 38%] Built target libmympdclient
[ 39%] Built target mjson
[ 41%] Built target mongoose
[ 43%] Built target rax
[ 44%] Built target sds
[ 46%] Built target tinymt
[100%] Built target mympd
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/bin/mympd
-- Installing: /usr/lib/systemd/system/mympd.service
-- Installing: /usr/share/man/man1/mympd.1.gz
-- Installing: /usr/share/man/man1/mympd-script.1.gz
Systemd found skipping mympd user creation
myMPD installed
自動起動有効化、起動
Systemdを使用しました
$ sudo systemctl enable mympd.service
$ sudo systemctl start mympd.service
$ sudo systemctl status mympd.service
● mympd.service - myMPD server daemon
Loaded: loaded (/lib/systemd/system/mympd.service; disabled; vendor preset: enabled)
Active: active (running) since Thu 2023-05-04 11:09:23 JST; 4h 6min ago
Docs: man:mympd(1)
Main PID: 1115 (mympd)
Tasks: 3 (limit: 191)
CPU: 50.212s
CGroup: /system.slice/mympd.service
└─1115 /usr/bin/mympd
設定変更
今回はデフォルトのままで使用しましたがポートを変更したりする場合は/var/lib/mympd/config/配下の各ファイルを変更するようです
クライアントからの接続
デフォルトは80ポートのためブラウザでサーバにアクセスし問題なければホーム画面が表示するので左にあるメニューから楽曲を選択して再生すればとりあえず成功
備忘
音楽ファイルをNAS上のCIFSからコピーするためにcifs-utilsをインストール
$sudo apt install cifs-utils
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
cifs-utils is already the newest version (2:6.11-3.1+deb11u1).
The following package was automatically installed and is no longer required:
libfuse2
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.
hoto@pi3a:/mnt/usb $ sudo apt autoremove
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
libfuse2
0 upgraded, 0 newly installed, 1 to remove and 15 not upgraded.
After this operation, 354 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 102781 files and directories currently installed.)
Removing libfuse2:arm64 (2.9.9-5) ...
Processing triggers for libc-bin (2.31-13+rpt2+rpi1+deb11u5) ...
Error: Timeout was reached
$sudo mkdir /mnt/nas
$sudo chmod 777 /mnt/nas
sudo mount –t cifs //xxx.xxx.x.xx/share /mnt/nas –o vers=1.0,username=xxx,password=xxx
参考にさせていただいたサイト
Discussion