Terra-Berry DAC 2 のボリュームやデジタルフィルタを操作したい
I want to use Terra-Berry DAC2 volumes and digital filters.
ジャイアンさんがTerra-Berry DAC2の初期設定をハードコピー付きで懇切丁寧に解説してくださっています。
Giann explains the initial setup of Terra-Berry DAC2 in his web-site.
以下の手順でプラグインを有効化することにより、Web UIからボリューム・デジタルフィルタ・サウンドモード・SRC/DACモードの操作が可能になります。
(ボリュームはWeb UI以外のmpdクライアントからも操作可能です)
If you make the plug-in effective, you can enable volume, digital filter, sound mode and SRC/DAC mode operations from the Web UI.
(Volumes can also be manipulated by mpd clients other than the Web UI)
1. config.txtの設定 (set up config.txt)
/boot/config.txtの下記2行をコメントアウトして再起動する。
Comment out the following two lines in /boot/config.txt and reboot.
enable_uart=0
init_uart_clock=230400
2. スクリプトの選択 (Select Script)
使用しているファームウェアのバージョンに合わせてスクリプトへのリンクを貼り直す。
link to the script to match the version of firmware you are using.
cd /home/pi/plugins/tb2
旧ファームウェアの場合
If you use Old Firmware
ln -fs terraberry_2.py terraberry.py
新ファームウェアの場合(Terra-BerryDAC2+)
If you use New Firmware(Terra-BerryDAC2+)
ln -fs terraberry_2plus.py terraberry.py
3. mpd.confの編集 (Edit mpd.conf)
ボリューム機能を使えるようにするために、mpd.conf(mpdの設定ファイル)の内容を編集します。
Edit the contents of mpd.conf (mpd configuration file) to use the volume function.
sudo nano /etc/mpd.conf
開いたmpd.confから、以下の内容を探します。
Search the following contents from the opened mpd.conf.
# volume setting
mixer_type "none" #hardware, software, external, none
#mixer_type "external" #hardware, software, external, none
# external volume control script
#external_volume_control "/home/pi/plugins/tb2/volume.sh"
#external_volume_control "/home/pi/plugins/sb32/volume.sh"
上の内容の内、2ヵ所を編集します。
先ずこの行の"none"を"external"に変更します。
In this work, two of the above contents will be edited.
First, change "none" in this line to "external".
mixer_type "none" #hardware, software, external, none
↓ ↓ ↓
mixer_type "external" #hardware, software, external, none
次いでこの行の行頭の"#"を削除します。
Then delete the "#" at the beginning of this line.
#external_volume_control "/home/pi/plugins/tb2/volume.sh"
↓ ↓ ↓
external_volume_control "/home/pi/plugins/tb2/volume.sh"
“Ctrl”キーを押下げながら“O”キーを押し、続いて“Enter”キーを押して、編集内容を保存します。
“Ctrl”キーを押下げながら“X”キーを押し、nanoを終了します。
Hold down the “Ctrl” key, press the “O” key, and then press the “Enter” key to save the edits.
Hold down the “Ctrl” key and press the “X” key to exit nano.
続いて、mpdを再起動させます。
sudo systemctl restart mpd
これでボリュームを使えるようになりました。
WebUIを再読み込みさせて、以下のようになっていれば、成功です。
The volume can now be used.
If you reload the WebUI and it looks like this, the work is successful.


4. ボリューム復元サービスの自動起動設定 (Automatic startup settings for volume restore service)
再起動時に、前回起動時のボリューム値を覚えさせておくことができます。
When rebooting, the volume value at the last boot is set.
sudo systemctl enable terradac_init
システムを再起動後、使えるようになります。
This feature will take effect after the system is restarted.
sudo reboot
5. プラグイン設定 (Plugin Settings)
symphonic-mpd独自のプラグイン機能を使って、Terra-Berry DAC2の再生モード設定、デジタルフィルター設定、SRC/DACモード設定が可能になります。
By using the plug-in function unique to symphonic-mpd, you can enable Terraberry DAC2 playback mode setting, digital filter setting, and SRC / DAC mode setting.
nano /home/pi/plugins/.plugin.json
でプラグイン定義を開き、以下の三ヵ所の記述を探し、“active”の部分を“no”から“yes”に編集します。
Open the plug-in definition file, and look for the following three descriptions, change the “active” parameter from “no” to “yes”.
{
"menu" :"Sound Mode",
"active" :"yes",
"icon" :"sound-dolby",
"command":"/home/pi/plugins/terra_setting.sh",
"form" :"/soundmode_setting.html",
"output" :"",
"success":"apply settings.... success!",
"error" :"apply settings.... error!"
},
{
"menu" :"Digital filter",
"active" :"yes",
"icon" :"filter",
"command":"/home/pi/plugins/terra_setting.sh",
"form" :"/filter_setting.html",
"output" :"",
"success":"apply settings.... success!",
"error" :"apply settings.... error!"
},
{
"menu" :"SRC/DAC Mode",
"active" :"yes",
"icon" :"filter",
"command":"/home/pi/plugins/terra_setting.sh",
"form" :"/srcdacmode_setting.html",
"output" :"",
"success":"apply settings.... success!",
"error" :"apply settings.... error!"
}
“Ctrl”キーを押下げながら“O”キーを押し、続いて“Enter”キーを押して、編集内容を保存します。
“Ctrl”キーを押下げながら“X”キーを押し、nanoを終了します。
Hold down the “Ctrl” key, press the “O” key, and then press the “Enter” key to save the edits.
Hold down the “Ctrl” key and press the “X” key to exit nano.
補足(ボリュームの範囲設定)
Supplemental (Set Volume Range)
nano /home/pi/plugins/tb2/tb2config.json
で設定ファイルを開き、volumeのmaxとminを編集する。(設定可能な値は0〜255)
Open the configuration file in and edit max and min of volume. (Possible values are 0 ~ 255)
"volume": {
"max": 255,
"min": 0
}
255はかなり大きいので、音量に注意すること
255 is quite large number, so you must be careful with the volume.