Thank you for your donation!


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


Idea: Include moodecfg.txt on ISO
#11
Ok understood... the I2S selection use this sed command :

Code:
    sysCmd('sed -i /dtoverlay/d ' . '/boot/config.txt');

Which erase any dtoverlay setting that is not integrated into moode.

I noticed that when trying to use power control overlays :
Code:
dtoverlay=gpio-poweroff,gpiopin=22,active_low
dtoverlay=gpio-shutdown,gpio_pin=17,active_low=0,gpio_pull=down

But I understand you can't do a more precise filter, as after overlays there is the DAC name.
So we did a workaround using python.
Reply
#12
Are these for a particular audio device in moOde's I2S list? If they are it would be easy for me to add the lines to the PHP function.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#13
No there are kernel overlays to manage RPI behavior. gpio-shutdown make the RPI go standby when it's activated.
It was to ease the use of our power manager board, but we finally made a python script that work even better.

This made me think the whole file was overwritten, but I was wrong, it's only "dtoverlay" lines.
Reply
#14
Hi,

I raised the issue here Foreign overlays deleted by Moode !
which Tim answered nicely !
Quote:Yes, I'll add to the 7.1.0 TODO list.

Smile
Reply
#15
After looking at the code this morning I'm not sure how to surgically remove/replace just the overlay for an i2s device.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#16
Maybe add something like below at the end of the file
Code:
#---------------------------
# CUSTOM OVERLAYS AFTER HERE
#---------------------------

And someone with better sed skills then me to remove lines with dtoverlay lines until line with CUSTOM or end of file is found Wink
Reply
#17
A SED guru is needed.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#18
Maybe this:
Code:
sed '0,/^dtoverlay=/{/^dtoverlay=/d}' /boot/config.txt

It will remove only the first line with dtoverlay=
So if you keep all the custom dtoverlay after the dtoverlay from device, it should be good.

Before:
Code:
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=i-sabre-q2m
#dtoverlay=disable-wifi
#dtoverlay=disable-bt
dtparam=spi=on
arm_freq=1000
sdram_freq=500
core_freq=400
gpu_freq=300
arm_64bit=1

#---------------------------
# CUSTOM OVERLAYS AFTER HERE
#---------------------------

dtoverlay=gpio-ir,gpio_pin=4

After:
Code:
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=disable-wifi
#dtoverlay=disable-bt
dtparam=spi=on
arm_freq=1000
sdram_freq=500
core_freq=400
gpu_freq=300
arm_64bit=1

#---------------------------
# CUSTOM OVERLAYS AFTER HERE
#---------------------------

dtoverlay=gpio-ir,gpio_pin=4
Reply
#19
Nice. I'll use that approach :-)
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#20
Better way:
Code:
sed '0,/^dtoverlay=/s/.*dtoverlay=.*/dtoverlay=test/' /boot/config.txt

It will directly replace the first line only which begin by "dtoverlay=" with "dtoverlay=test" (the new i2s device).
Reply


Forum Jump: