2015年9月10日木曜日

Moode Audio 2.3

Moode Audio 2.3 が公開された.
8月末に 2.2 が公開されたばかりなのだが,すぐにバグが報告され,そのフィックスリリースとして 2.3 が出てきた.
Moode Audio 2.3 has been released.
Ver. 2.2 was released at the end of August, but a bug about cover-art extraction was reported immediately.  Ver. 2.3 is a bug-fix release.

Moode Audio は高頻度に改良バージョンがリリースされているが,2.2 では私のリクエストがひとつ採用されていて,web UI のボリュームノブをコマンドから操作できるようになった.Thanks, Tim.
Moode Audio is under active and continuing improvements, and Ver. 2.2 (and later) includes my proposal:  the volume knob displayed in the web-UI is now controllable from the command line.  Thanks, Tim.


なんで,こんなのが欲しいのかというと,ボリュームを赤外線リモコンから制御するために必要なのである.
This feature is required for IR remote control of playback volume.

Raspberry pi では赤外線リモコンの信号の受信,解析等には,lirc というパッケージがよく使われる.Moode Audio は OS としては Debian ベースなので,apt-get で簡単に導入でき,音量操作などもできる.そのためには,受けた赤外線信号に対応して,特定のコマンドを実行する,という形式が必要になる.Moode Audio の再生コアである mpd の場合,標準コマンドラインクライアントである mpc コマンドを実行することで,さまざまな操作ができる.これによって,ブラウザからの操作なしで音量操作,停止やスキップなどができる.
lirc package is popular for using IR remote control on Raspberry pi.  Moode Audio is Debian-based and lirc package is easily installed using apt-get command.  For controlling the system, each received IR signal must be assigned to the specific command operation(s).    mpd running on Moode Audio as the core program for music playback is controlled by mpc command which is a standard command line client  This enables the playback controls (eg. play/stop/skip, volume up/down) without GUI.

ところが,2.0 ではブラウザのボリュームノブ表示が mpc volume コマンドによる音量設定を反映しなくなってしまった.赤外線リモコンを使うと,ブラウザの表示とずれてしまうわけだ.そこでこれを強制的に修正する方法をリクエストしたわけだ.
However, in Moode Audio 2.0 (and later), the command line volume setting is not displayed in the web-based GUI screen.  When we use an IR remote controller for volume control (through mpc command), we can change the volume itself but the web-based GUI does not show the correct volume.  So, I requested to Tim serving command line interface for the GUI volume knob setting.

導入されたのは /var/www/knob.sh というスクリプト.これによって任意の位置にボリュームノブを設定できる.ということで,以下のようなスクリプトを書いた.それぞれ,音量レベルを5上げたり下げたりする.音量が変わり,ブラウザの表示も変わる.表示の切り替わりに若干タイムラグを感じるが,実用的には問題ないだろう.
On Ver. 2.3, Moode Audio includes a new script: /var/www/knob.sh.  The script sets the GUI knob to an arbitrary value.  So I prepared scripts below.  These respectively increase and decrease the volume with a value of 5 (the volume level is indicated with the value from 0 to 100), and set the GUI volume display.  The change of the display requires a bit moment, but the delay is practically short enough.


vol5up.sh
#!/bin/sh
level=`mpc volume | awk -F":" '{print substr($2, 1, index($2, "%")-1)+5}'`
if [ $level -gt 100 ] ; then
  level=100
fi

mpc volume $level > /dev/null
/var/www/knob.sh $level > /dev/null

exit 0


vol5dn.sh
#!/bin/sh

level=`mpc volume | awk -F":" '{print substr($2, 1, index($2, "%")-1)-5}'`
if [ $level -lt 0 ] ; then
  level=0
fi

mpc volume $level > /dev/null
/var/www/knob.sh $level > /dev/null

exit 0


リモコン信号に対する動作は .lircrc ファイルで定義されている.ボリュームを上げるところには config = mpc vol +5 とかが定義されているので,それを config = /path/vol5up.sh とかに書き換えればOK.
Remote control commands are defined in .lircrc file.  Modify config section for the corresponding button definition such as: config = /path/vol5up.sh.


Moode Audio 自体や lirc パッケージの導入時の手順や注意,独自追加等は,1.8 のときと同じなので,そちらを参照.
The steps for installing Moode Audio itself, lirc package, and other original additions are similar to those for Ver. 1.8 (see this article).


ところで,Moode Audio もだいぶ重くなってきた感じがする.ここらで諦めてRaspberry pi 2 に移行すべきかどうか.まあ,pi 2 でどのくらいか,実験してみてからでいいかな.
あとは,懸案の I2S 化.パーツは揃っているので,組み立てだけといえばそうなのだが.
BTW, I feel that Moode Audio is getting heavier.  I should use Raspberry pi 2 rather than pi B.  Well, I will try pi 2 and then decide the way.
And, I'd like to introduce an I2S DAC.  The parts which should be assembled to an electric circuit are already set.  So, what I have to do is just doing :-)

(追記)
Moode 2.3 でも,Voyage 0.10 と同様に mpd のログが肥大化する現象あり./etc/mpd.conf でログファイルの行をコメントアウトして,ログを停止することが開発者からの推奨

(Postscript)
Moode 2.3 also generates massive mpd event log, like Volumio 0.10.  For stopping logging, comment out the log-file identifying line in /etc/mpd.conf.  See this post.



0 件のコメント:

コメントを投稿