Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Idea: Include moodecfg.txt on ISO
#21
Even better :-)
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#22
Problem is that Moode always rewrite dtoverlay at the bottom of the file, so after a modification custom lines will be the first.
Reply
#23
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.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#24
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
Reply
#25
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.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#26
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
Reply


Forum Jump: