Jan 16, 2017
MinimServerをRaspberry Pi B+で動かしてみた(24日追記)
UPnP関連が続いている。
Raspberry Pi B+ / Raspbianでminimserverを動かしてみた。
以前、NASで扱おうとしてうまくいかなかったのは理解が不十分だったからっぽい。
音質評価はまだしていない。動かすだけでも僕の知識ではなかなか大変だからだ。そのうち追記するつもりだけど、いつになるか分からない。
現状、どんなことになっているか図示してみる。

作業経過をメモしていく。
まずRaspbian Jessie Liteをダウンロード。
https://www.raspberrypi.org/downloads/raspbian/
今回使ったのは、2016-11-25-raspbian-jessie-lite.zip(今日確認したら既に上位バージョンが公開されていた)。
展開してイメージをmicroSDカードに焼く。
sshでログインして操作するつもりだけど、Jessie2016-11-25-raspbian-jessie以降はデフォルトで使えなくなっている。使えるようには、bootパーティションに「ssh」というファイルを置けばいい。カードを手元のPCにマウントして、エディタでファイルを作る。文面は無しでいい。
Raspberry Pi B+を用意して、Raspbianで起動。
sshでログイン。ユーザーはpi、パスはraspberry。
sudo raspi-configで初期設定。
sudo apt-get updateとsudo apt-get upgradeはしていない(というのはjavaのインストールでつまづいたから。しなかったら問題なくインストールできた)。
IPアドレスを固定。
/etc/network/interfacesで設定することが多いようだけど、そこにはman dhcpcd.confを参照しろとあって、/etc/dhcpcd.confを編集しろということらしい。
vi /etc/dhcpcd.conf interface eth0 static ip_address=192.168.1.83/24 static routers=192.168.1.1 static domain_name_servers=192.168.1.1 sudo reboot
こんな感じでIP固定される。
minimserverのサイトを参照。ras piではどうすればいいか書いてある。
http://minimserver.com/install-raspbian.html
minimserverはjavaで動くので、インストール。
sudo apt-get install oracle-java7-jdk java -version pi@raspberrypi:~ $ java -version java version "1.7.0_60" Java(TM) SE Runtime Environment (build 1.7.0_60-b19) Java HotSpot(TM) Client VM (build 24.60-b09, mixed mode)
下記からMinimServer-0.8.4-linux-armhf.tar.gzをダウンロード。
http://minimserver.com/downloads/index.html
Linux ARM用にはsoft floatとhard floatが用意されてるんだけど、ras piはhard float用。
以下、参考のサイト。
How can I tell if I am using the hard-float or the soft-float version of Debian/Raspbian?
http://raspberrypi.stackexchange.com/questions/4677/how-can-i-tell-if-i-am-using-the-hard-float-or-the-soft-float-version-of-debian
Check for the existence of the directory:
/lib/arm-linux-gnueabihf
the soft-float version do not have this directory, they have:
/lib/arm-linux-gnueabi
instead, or you can list the packages installed using:
dpkg -l
and see the platform in the third column (all/armhf/armel)
http://minimserver.com/install-raspbian.htmlに書いている通りに進む。
/home/piに落としたファイルをコピー。僕はFilezillaで転送した。
cd /home/pi tar xf MinimServer-0.8.4-linux-armhf.tar.gz mkdir music minimserver/bin/setup Do you want to change these settings (y/n)? y Enable automatic startup for MinimServer (y/n)? y minimserver/bin/startc MinimServer 0.8.4, Copyright (c) 2012-2016 Simon Nash. All rights reserved. autoUpdate: installed package 'minimserver-0.8-update-96' Enter command (? for help): autoUpdate: relaunching runtime >MinimServer 0.8.4 update 96, Copyright (c) 2012-2017 Simon Nash. All rights reserved. starting MinimServer[raspberrypi] Enter content directory, or null to continue: Enter command (? for help): >#/
ここで、minimserverが管理するディレクトリを設定する。
>#/home/pi/music MinimServer[raspberrypi] is running >
この時点で、minimserverに端末からログインした状態になる。
さて、http://minimserver.com/install-raspbian.htmlからちょっと引用。
11. If MinimServer is running as a terminal application, MinimServer will terminate if the terminal window is closed for any reason. To prevent this happening, press Enter at the command prompt to exit MinimServer, then enter the command:
minimserver/bin/startd
This restarts MinimServer as a daemon background process that will continue to run after the terminal window is closed.
使ってみたらわかるんだけど、exitしたらminimserverも終了するということ。
minimserver/bin/startd
このコマンドで起動させたらデーモンとして動く。
minimserverのサイトはとても詳しく書いてくれているようなんだけど、読むのが大変。
下記コマンドでNASの共有フォルダ/titan/jazzをras piのmusicにマウントできる。
sudo mount -o addr=192.168.1.80,nolock -t nfs 192.168.1.80:/titan/jazz /home/pi/music
次に、minimwatchを手元のPCにインストール。minimserverをデーモン化したのでminimwatchからコントロールすることになる。
minimwatchがなくてもminimserver自体を操作することは出来るんだけど、前述の通り、exitしたら止まるのでminimwatchから操作する方が便利だろう。
ノートPCのFedoraにインストール。linuxなので下記を参照。
http://minimserver.com/install-raspbian.html
http://minimserver.com/install-linux-mwatch.html
書いてある通りに進む。
minimwatchのダウンロード。javaが合ってないといけないよとか書いてある。
うちのFedoraは32bitなのでMinimWatch-0.8.4-linux-x86.tar.gzを使う。
mkdir minim-home cd /home/ab/minim-home tar xf MinimWatch-0.8.4-linux-x86.tar.gz minimwatch/bin/setup MinimWatch desktop integration is disabled MinimWatch automatic startup is disabled Do you want to change these settings (y/n)? n minimwatch/bin/startc [ab@hp6730bHitachi minim-home]$ minimwatch/bin/startc MinimWatch 0.8.4 update 49, Copyright (c) 2012-2017 Simon Nash. All rights reserved. Enter command (? for help): Selected media server: MinimServer[raspberrypi] MinimServer[raspberrypi] is running >? Commands: rescan restarts the media server and rescans the media library props shows current properties for the media server prop n=v sets media server property name n to value v about shows version and status information for the media server stop stops the media server without exiting the server application restart restarts the stopped or running media server close exits the media server application select s selects media server s for display and control refresh refreshes the status of all media servers exit exits this application packages shows installed packages (with status) and available packages install p installs package p remove p removes installed package p undo p undoes a pending change to installed package p relaunch relaunches the runtime and applies pending package changes modules shows installed modules (with status) updates shows available updates for installed packages sleep t delays execution for t seconds (can be useful for scripting) help (or ?) displays this information > >rescan restarting MinimServer[raspberrypi] starting MinimServer[raspberrypi] MinimServer[raspberrypi] is running >
これで、minimwatchはオーケー。
端末からインストールした「minim-home」ディレクトリに入って、そこでコマンドを打つと操作できる。
うちのシステムではなぜかguiでの操作がうまくいかない。
>MinimWatch desktop integration is disabled
この設定がいけないのかと思って直しても見たけど、変わらない。でもシンプルな使い方ならcuiで困らないかな。
rescan でminimserverが再起動され、ライブラリがアップデートされる。
exit しても、minimwatchが終了するだけでminimserverは動き続ける。
レンダラーの操作。
過去のエントリで書いた手順でレンダラーに設定したvolumioを、ncmpcppで操作する。
「u」キーでアップデート。UPnPサーバのライブラリが、mpdのデータベースに反映される。
以下、ちょっと参考サイト。
Upmpdcli: MPD UPnP Renderer Front-End
https://www.lesbonscomptes.com/upmpdcli/upmpdcli.html
もうひとつ。
MPD and UPnP
https://www.lesbonscomptes.com/upmpdcli/upmpdcli-or-mpdupnp.html
引用。
Back-end integration: mpd-upnp
This is implemented as an MPD Database plugin. Instead of reading files and building its own catalog, MPD accesses an UPnP Media Server both for tag and audio data. Tags are accessed through UPnP, and data is retrieved through HTTP.
MPD then translates the UPnP catalog data to the native MPD client protocol, so that MPD clients think that they are talking to a normal MPD (but instead they are browsing the UPnP Media Server through MPD).
In this configuration, MPD can’t manage local data and tags. The file and UPnP database plugins are mutually exclusive.
そういうわけで、UPnPサーバとmpdの間でデータベースの擦りあわせを行う必要がある。これは、そこそこ時間がかかる。さすがにファイルが数枚なら大したことはないけど、数10枚以上になると数分以上かかってくる。
NASから直接データを読み込むよりもmpdにとっては手間らしい。
まあ、でもこれで音が出る。
レンダラーに、mpd以外の何かデータベースを必要としないものを選択したら、こんな手間は要らないんじゃないかと思うけど、よくわからない。minimstreamerというのを使うのかな。他にもJPLAYと繋いだりとか、色々と手段はあるようだけど。
さて、ncmpcppで検索ができる。
現在、minimserverに登録されているファイル数はこんな感じ、17だ。

ちょっと検索してみると、結果はこんな感じ。

1つのファイルが、Found 11 songsとして表示されている。他にも25 songsとか。
NASマウントでの使用状況では、こういう検索結果表示はみたことがない。1つのファイルは1行で表示される。
これはデータベース構築に時間がかかるわけだと思った。
あと、ファイルが多くなったら実質的に検索として機能するのかどうか。多数のファイルをサーバーに登録したとして、そこから検索で10枚ひっかかったとしたら、表示されるのは200行近くになるのかな。
Beethobenとか検索した日には、大変なことになりそう。
まあ、少なめのファイルを登録して検索なんか使わないという感じで運用したほうが良さそうだ。ncmpcppではなく、他のUPnPクライアントを使えば、きれいに表示されるのかもしれないけど、よく分からない。
気になるのはメモリ再生と比較してどうなんだろうということだけど、おいおいだ。
24日、追記。
piCoreでのメモリ再生と比較してみた。一番に感じたのは、やっぱり音の軽さだ。良くも悪くもしなやかで耳当たりがいい。
よく聴くとメモリ再生の方が情報量は多いんだけど硬くて重い。こんなだったかな、、、と思っていた。
ここで、ふとpiCoreにログインしtopを打ってみたら、mpdのメモリ消費が数%と。
ここで気付いた。
minimserverからの音は176400:24、Fastest Sinc Interpolatorにアップサンプリングした音で、メモリ再生のほうはしていなかった。以前、何かの比較をするのに設定変更してそのままになっていたのだ。
メモリ再生のほうの設定をアップサンプリングするようにしてみたら、当初感じていた硬さは霧散した。重さは濃厚さに転化したように感じる。
こうして比較すると、やはりpiCoreでのメモリ再生の方がいい。minimserverからの音は薄く感じる。
とはいえ、これはi2sDACからの音で、メモリ再生のほうはRATOCのusb-DDCからfirefaceに繋いでいるから、条件が違う。単純な比較じゃないのだ。しかしpiCoreでminimserverの受信環境を構築する余裕はないんだな、、。
ありふれたvolumioのNASマウントと比較してみる。ハードもOSも条件が同じで、違うのは音源がNASかUPnPかということだけだ。
こうなると、UPnPのほうが見通しがいい音がする。透明感が違うのだ。音の立ち上がりとかもいいんじゃないかな。NASマウントみたいに手軽に使えないのが残念という感じ。軽い音で聞きたい時というのもありそうだと思うので。
writeback message:
Caution!!!
Now, Anyone cannot post a comment.