Thank you for your donation!


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


[split] Maintaining config.txt
#14
(05-29-2021, 05:27 PM)adrii Wrote: Hi Tim

In config.txt, if user settings come after Moode settings then they can override them. It seems like the options are:
  • put user settings in a separate file and include it last in config.txt, but then raspi-config changes (which I imagine will occur even if unnecessary) might be added both before and after the include statement
  • put Moode settings in a separate file and include it first in config.txt, then any settings in config.txt are user settings (including changes made by raspi-config) and always come after Moode settings.
The second option seems better from the point of view that it ensure that user settings come after Moode settings. However, there may be other aspects to consider, and I don't know all the details of the config system.

Adrian.

Hi Adrian,

The second option works and is an excellent way to protect the config.txt settings that are manipulated by moOde :-)

The challenge is how to deal with it in the in-place update because existing config.txt files may already have user settings. Simply inserting the line "include config.txt.moode" at the top of existing config.txt files would be problematic because user settings override moode settings and moode only manipulates the settings in config.txt.moode.

For example 

Existing config.txt and some user settings after it. The in-place update has added the include line at the top. The file /boot/config.txt.moode contains the moOde manipulated settings i.e., all the lines above "user-setting-1" 

Code:
include config.txt.moode
disable_splash=1
disable_overscan=1
hdmi_drive=2
hdmi_blanking=1
hdmi_force_edid_audio=1
hdmi_force_hotplug=1
hdmi_group=0
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=audio=on
#dtoverlay=disable-wifi
#dtoverlay=disable-bt
user-setting-1
user-setting-2
user-setting-3
.
.

User configures an I2S DAC using Audio Config. Since moode would be manipulating /boot/config.txt.moode we end up with the lines "dtparam=audio=off" and  "dtoverlay=allo-boss2-dac-audio" in that file but remaining in /boot/config.txt would be "dtparam=audio=on" which would override the earlier line and thus cause breakage due to on-board audio and I2S device both on.

A second approach would be to overwrite /boot/config.txt with the new one and start from scratch. This would mean users would need to re-add their settings after the include line in the new config.txt otherwise there would be breakage.

Code:
pi@rp2:~ $ cat /boot/config.txt
include config.txt.moode

pi@rp2:~ $ cat /boot/config.txt.moode
disable_splash=1
disable_overscan=1
hdmi_drive=2
hdmi_blanking=1
hdmi_force_edid_audio=1
hdmi_force_hotplug=1
hdmi_group=0
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=audio=off
dtoverlay=allo-boss2-dac-audio
#dtoverlay=disable-wifi
#dtoverlay=disable-bt
pi@rp2:~ $

So there is breakage either way with in-place update to the new method. The second approach is prolly the safest and cleanest but would require some effort on our part to help users re-add their specific settings.

Another consideration would be whether to also place mpd_oled settings in an include file for example "/boot/config.txt.mpd_oled" and manipulate that file instead of config.txt.

-Tim
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Messages In This Thread
[split] Maintaining config.txt - by adrii - 05-28-2021, 05:09 PM
RE: [split] Maintaining config.txt - by adrii - 05-31-2021, 02:29 PM
RE: [split] Maintaining config.txt - by adrii - 05-31-2021, 04:24 PM
RE: Official moOde 7.2.1 support thread - by Tim Curtis - 05-30-2021, 01:10 PM

Forum Jump: