Moode Forum
[IDEA] Include moodecfg.txt on ISO - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Feature requests (https://moodeaudio.org/forum/forumdisplay.php?fid=8)
+--- Thread: [IDEA] Include moodecfg.txt on ISO (/showthread.php?tid=2715)

Pages: 1 2 3


RE: Include moodecfg.txt on ISO - Tim Curtis - 01-29-2021

Even better :-)


RE: Include moodecfg.txt on ISO - audiophonics - 01-29-2021

Problem is that Moode always rewrite dtoverlay at the bottom of the file, so after a modification custom lines will be the first.


RE: Include moodecfg.txt on ISO - Tim Curtis - 01-29-2021

With @TookaFace approach the line is replaced and so there would not be a need to rewrite anything after it. Custom lines would be preserved. I'll have to check a few other parts of the code that manipulate config.txt but I think this should work.


RE: Include moodecfg.txt on ISO - TookaFace - 01-29-2021

Hum it could be a problem if i2s device is set to None, in that case, if you set a new i2s device, the line will be added to the end, but its probably something we can change


RE: Include moodecfg.txt on ISO - Tim Curtis - 01-29-2021

IIRC there's a SED that finds a given line and then inserts the new line after it.

Find "dtparam=audio" then insert "dtoverlay=boss-dac-pcm512x-audio" after it. Something like that.


RE: Include moodecfg.txt on ISO - TookaFace - 01-29-2021

Code:
$result = cfgdb_read('cfg_audiodev', cfgdb_connect(), $i2sDevice);
sysCmd('sed -i "s/dtparam=audio=on/dtparam=audio=off/" ' . '/boot/config.txt');
sysCmd('echo dtoverlay=' . $result[0]['driver'] . ' >> ' . '/boot/config.txt');

If instead of using echo we use sed in the last line:

Code:
sed -i '/dtparam=audio=off/a dtoverlay=test' /boot/config.txt

it will react the way you describe, the dtoverlay line will be added after dtparam=audio=off