Jump to content


digib

Member Since 9 Mar 2020
Offline Last Active 12 Apr 2024 21:32
-----

Posts I've Made

In Topic: Modifying enigma2\settings from shell

24 March 2020 - 17:53

Script to activate downmix for AC3 and DTS and echo+log the result:

#!/bin/bash
#change 127.0.0.1 for the box IP if this script is executed remotely from other linux system
curl -o /tmp/downmix_result.txt --noproxy '*' --data value="true" "http://127.0.0.1/api/saveconfig?key=config.av.downmix_ac3"
echo AC3 downmix is enabled
curl -o /tmp/downmix_result.txt --noproxy '*' --data value="true" "http://127.0.0.1/api/saveconfig?key=config.av.downmix_dts"
echo DTS downmix is enabled
exit 0

Script to disable downmix for AC3 and DTS and echo+log the result:

#!/bin/bash
#change 127.0.0.1 for the box IP if this script is executed remotely from other linux system
curl -o /tmp/downmix_result.txt --noproxy '*' --data value="false" "http://127.0.0.1/api/saveconfig?key=config.av.downmix_ac3"
echo AC3 downmix is disabled
curl -o /tmp/downmix_result.txt --noproxy '*' --data value="false" "http://127.0.0.1/api/saveconfig?key=config.av.downmix_dts"
echo DTS downmix is disabled
exit 0

and now laugh about me, I have been more than an hour to develop this one, I'm very basic skilled in programming, but it works, I'm so happy!!! thank you again @s3n0, you're my hero

the nice thing of this check is that it doesn't need to stop enigma to read the updated settings file, it queries the actual status live

#!/bin/sh
export LANG=es_ES.UTF-8
logdir="/tmp"
SUBJECT="Checks if AC3 downmix is enabled or disabled by quering enigma2 settings with API"
fecha=`date +%Y%m%d_%H%M`
search="config.av.downmix_ac3"

cat /dev/null >$logdir/downmix.status.txt
cat /dev/null >$logdir/downmix.review.txt
cat /dev/null >$logdir/downmix.status.read.txt

curl -o /tmp/downmix.status.txt "http://127.0.0.1/web/settings" #change 127.0.0.1 for the box IP if this script is executed remotely from other linux system

cat $logdir/downmix.status.txt|egrep "$search"  > $logdir/downmix.status.read.txt
cat $logdir/downmix.status.txt|grep -A 1 "$search"  > $logdir/downmix.status.read.txt

if cat $logdir/downmix.status.read.txt |
  grep -q 'False'
then
    echo "AC3 downmix is disabled"
    echo "AC3 downmix is disabled" >>$logdir/downmix.review.txt
else
    echo "AC3 downmix is enabled"
    echo "AC3 downmix is enabled" >>$logdir/downmix.review.txt
fi
exit 0

change 127.0.0.1 for the IP of the box if it is executed remotely from other linux system.

 

I integrated the logged results to a php very simple page where I check status and change them by clicking simple buttons

 

Cheers
 


 


In Topic: Modifying enigma2\settings from shell

24 March 2020 - 14:00

Don't missunderstood me, I am eternally grateful to you, but I just tested empirically and by sending the "True" value the API answers but the downmix setting remains the same. Whilst if I send the value "true" it is updated (I check in the OSD audio menu that indeed the setting has been changed, the home audio receiver changes audio mode from AC3 to PCM)

 

With the opposite action, no matter if I send the value "False" or "false", the downmix is changed to disabled in the OSD menu. Home receiver switchs back to DOLBY mode.

 

For me is not a problem, just a clarification in case anybody finds case sensitive trouble.

 

Note that I'm sending the commands from a raspberry shell, from where I created a very basic WWW php frontend to operate home relays, enigma2 wake up, standby, and other common commands to ease remote tweaks from smartphone. I don't expect it would change anything from talking from the own box shell, but who knows!

 

Again, eternally thanks!


In Topic: Modifying enigma2\settings from shell

24 March 2020 - 12:14

in fact it's the opposite, "false" is not case sensistive, "true" does


In Topic: Modifying enigma2\settings from shell

24 March 2020 - 10:30

https://github.com/E...tion#saveconfig

 

OpenWebif usage:

curl --noproxy '*' --data value="false" "http://127.0.0.1/api/saveconfig?key=config.av.downmix_ac3"

I don't know why, but using the wget command doesn't work when adding or changing a configuration item. I mean this:

wget -q -O - "http://127.0.0.1/api/saveconfig?key=config.av.downmix_ac3&value=true"

To check if the value was added or changed:

init 4        # stop the Enigma, to save the "settings" file
cat /etc/enigma2/settings | grep downmix

A note:

 

The default value is not stored in the file /etc/enigma2/settings because it is a default value.

This means that there is no need to keep this configuration item in the "settings" file.

So if you save the value as "true", which is the default value for "downmix_ac3", then this item will completely disappear from the "settings" file.
 

You're a king mate, it works!

For anybody willing to execute or script this, note that for activating the True value, that is, downmix enabled, the "true" value is case sensitive:

 

WORKS:

curl --noproxy '*' --data value="true" "http://boxIP/api/saveconfig?key=config.av.downmix_ac3"

doesn't work:

curl --noproxy '*' --data value="True" "http://boxIP/api/saveconfig?key=config.av.downmix_ac3"

However, for the "False" value it is not case sensitive it works either with "False" or "false"

 

If anyone wonders why I wanted to script this, the transcoding on Hisilicon boxes like octagon sf8008 or gigablue trio 4k only works with downmix enabled. If downmix is disabled, only the untouched stream is working.

 

With scripts I can enable/disable downmix without need to enter and navigate webinterface and change audio settings remotely which is a pain.

 

cheers
 

 


In Topic: Modifying enigma2\settings from shell

23 March 2020 - 14:52

init 4
sleep 5
sed -i -e 's/config.av.downmix_ac3=true/config.av.downmix_ac3=false/I' /etc/enigma2/settings
init 3

Thank you! I will test when at home.

 

Another option would be to integrate the checkbox like many other options in webinterface www configuration module, but I only see compiled python files, which I don't how to manage. Are there plain text files to try to modify to add the checkbox to modfity the audio setting I'm looking forward to manage?