LoginSignup
0
0

More than 3 years have passed since last update.

Audiophile Linux + Cantata: アルバムカバー (アルバムアート) 表示手順

Last updated at Posted at 2019-05-19

結局 GMPC では出来なかったアルバムカバーの表示が, 試行錯誤の末に出来たのでメモ。

参考文献

Audiophile Linux (NGINX) 設定

そもそも MPD は, アルバムカバーそのもののデータをクライアント渡すのでは無く, HTTP などの代替プロトコルで転送させる方針だ, という文献をどこかで見ていた。
そこで % which httpd nginx したら NGINX がインストールされていることが判明。

httpd not found
/bin/nginx

% sudo systemctl status nginx -l | cat の結果, 初期状態では起動してこない。

● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
   Active: inactive (dead)

そこで, % cd /etc/nginx; pwd して % ls -l した結果が以下の出力。

total 68
-rw-r--r-- 1 root root  1077 May  9 10:11 fastcgi.conf
-rw-r--r-- 1 root root  1007 May  9 10:11 fastcgi_params
-rw-r--r-- 1 root root  2837 May  9 10:11 koi-utf
-rw-r--r-- 1 root root  2223 May  9 10:11 koi-win
-rw-r--r-- 1 root root  3957 Apr 13  2017 mime.types
-rw-r--r-- 1 root root 32278 Nov 23  2017 mime.types.pacnew
-rw-r--r-- 1 root root  2687 May  9 10:11 nginx.conf
-rw-r--r-- 1 root root   636 May  9 10:11 scgi_params
-rw-r--r-- 1 root root   664 May  9 10:11 uwsgi_params
-rw-r--r-- 1 root root  3610 May  9 10:11 win-utf

% sed -e '/^ *$/d' -e '/^ *#/d' nginx.conf で有効となっている設定を抜き出して確認する。

/etc/nginx/nginx.conf
worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    server {
        listen       80;
        server_name  localhost;
        location / {
            root   /usr/share/nginx/html;
            index  index.html index.htm;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/share/nginx/html;
        }
    }
}

ほぼ初期状態? とりあえず, バックアップを取得する。

% sudo cp -aiv nginx.conf nginx.conf.`date +%Y%m%d` 
'nginx.conf' -> 'nginx.conf.20190519'

% ls -l nginx.conf nginx.conf.`date +%Y%m%d`
-rw-r--r-- 1 root root 2687 May  9 10:11 nginx.conf
-rw-r--r-- 1 root root 2687 May  9 10:11 nginx.conf.20190519

ここで一旦, % grep -E '^music_directory' /etc/mpd.conf で NGINX の root 行に設定するディレクトリーを確認する。

music_directory        "/home/muser/Music"

% sudo vi nginx.conf で編集したら % diff -u nginx.conf.YYYYMMDD nginx.conf で差分を確認する。

/etc/nginx/nginx.conf
--- nginx.conf.20190520 2019-05-09 10:11:02.000000000 +0900
+++ nginx.conf  2019-05-20 23:34:52.086666658 +0900
@@ -41,7 +41,7 @@
         #access_log  logs/host.access.log  main;

         location / {
-            root   /usr/share/nginx/html;
+            root   /home/muser/Music;
             index  index.html index.htm;
         }

% sudo nginx -t で構文を確認する。

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

% sudo systemctl enable nginx で NGINX の自動起動を有効化する。

Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /usr/lib/systemd/system/nginx.service.

% sudo systemctl start nginx で NGINX を起動し, % sudo systemctl status nginx -l | cat で状態を確認する。

● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
   Active: active (running) since Sun 2019-05-19 21:16:43 JST; 26s ago
  Process: 531 ExecStart=/usr/bin/nginx -g pid /run/nginx.pid; error_log stderr; (code=exited, status=0/SUCCESS)
 Main PID: 625 (nginx)
    Tasks: 2 (limit: 4687)
   Memory: 1.9M
   CGroup: /system.slice/nginx.service
           ├─625 nginx: master process /usr/bin/nginx -g pid /run/nginx.pid; error_log stderr;
           └─626 nginx: worker process

May 19 21:16:43 apl systemd[1]: Starting A high performance web server and a reverse proxy server...
May 19 21:16:43 apl systemd[1]: Started A high performance web server and a reverse proxy server.

後は Web ブラウザーを起動し, ファイルの一覧が表示されることを確認する。

Cantata 設定

※ 今回は v2.3.2 で試している。

  1. 最初のウィザードは MPD に接続さえ出来れば OK.
  2. 設定画面の右上に表示されているハンバーガーアイコンより, 設定 をクリックする。
  3. コレクションの設定 画面で, 音楽フォルダ 欄に http://<NGINX のホスト名 or IP アドレス>/ と入力する。
    • 適用 ボタンを押下すると, スラッシュが円マークに変換されるが, 気にしなくても OK.
  4. インターフェース 画面の カバー タブで, Fetch missing covers にチェックを入れ, Filename: 欄に folder とだけ入力する。
  5. ついでに プレイキュー タブで, 背景イメージ現在のアルバムカバー にチェックを入れる。
  6. OK ボタンを押下し, Cantata を再起動すると, アルバムカバーが表示されている…はず。

音楽ファイルが格納されているディレクトリーに, folder.jpg もしくは folder.png が格納されていると良いようだ。

どっとはらい。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0