NullDev wrote:MPD has proven a bit more troublesome to neuter. I can comment out
- Code: Select all
log_file "/var/log/runeaudio/mpd.log"
in /etc/mpd.conf which kills logging, but the UI then complains that manual changes have been made to the file. Checking in the /var/www/mpd-config.php file I see that there is a hash check of the mpd.conf file. I can code around that, but that makes for a rather unclean approach.
Hi NullDev,
mpd.conf is generated in
one-way from php. So if you directly mod the mpd.conf the application will go into "advanced mode" where you have the possibility to edit the configuration file manually, but you loose the GUI functionality. The idea behind that is if you are an advanced user, you don't need GUI, and probably prefer to edit MPD configuration directly.
This could change in the future, but not now, because we are focused on other aspects of the application.
You can control what php writes on the mpd.conf file by acting on the
cfg_mpd SQLite table.
cfg_mpd table structure- Code: Select all
sqlite> .schema cfg_mpd
CREATE TABLE cfg_mpd (
id INTEGER PRIMARY KEY,
section CHAR(20),
param CHAR(20),
value CHAR(100),
description TEXT
, value_player char(200), value_default char(200), example char(200));
Here is the query used in mpd.conf generation:
SELECT param,value_player FROM cfg_mpd WHERE value_player!='';- Code: Select all
sqlite> SELECT param,value_player FROM cfg_mpd WHERE value_player!='';
follow_outside_symlinks|yes
follow_inside_symlinks|yes
db_file|/var/lib/mpd/mpd.db
log_file|/var/log/runeaudio/mpd.log
pid_file|/var/run/mpd/pid
music_directory|/mnt/MPD
playlist_directory|/var/lib/mpd/playlists
state_file|/var/lib/mpd/mpdstate
user|mpd
bind_to_address|any
port|6600
log_level|default
zeroconf_enabled|yes
zeroconf_name|runeaudio
audio_output_format|disabled
volume_normalization|no
audio_buffer_size|512
buffer_before_play|0%
filesystem_charset|UTF-8
id3v1_encoding|UTF-8
gapless_mp3_playback|yes
auto_update|no
mixer_type|disabled
group|audio
dsd_usb|yes
this is the php code that generate mpd.conf (you can see the
complete function on our GitHub repo)
- Code: Select all
function wrk_mpdconf($outpath,$db) {
// extract mpd.conf from SQLite datastore
$dbh = cfgdb_connect($db);
$query_cfg = "SELECT param,value_player FROM cfg_mpd WHERE value_player!=''";
$mpdcfg = sdbquery($query_cfg,$dbh);
$dbh = null;
...
- Code: Select all
// parse DB output
foreach ($mpdcfg as $cfg) {
...
if you want to exclude
log_file parameter from the mpd.conf output, you have to empty
value_player and
value_default fields for that
param (mpd configuration parameter label).
You can do that by executing this from player console:
- Code: Select all
sqlite3 /var/www/db/player.db "update cfg_mpd set value_player='', value_default='' where param='log_file';"
then re-generate mpd.conf by making some change via mpd-config page or simply reset mpd to default settings.
I want to take this opportunity to thank
you,
Midnight,
tux,
skrodahl and all other people on the forum for your precious hints. With your effort RuneAudio will be even better.
Thanks.
Simone