Video processing options

Moderators: Gully, peteru

Post Reply
sonicblue
Master
Posts: 247
Joined: Wed Oct 25, 2017 14:30

Video processing options

Post by sonicblue » Sun Oct 29, 2017 20:12

Hello developers

I see a some interesting items in these folders and would like to learn how they affect the video processor.

/proc/stb/vmpeg/0/sharpness_control
/proc/stb/vmpeg/0/sharpness_control_choices
/proc/stb/vmpeg/0/sharpness_value
/proc/stb/vmpeg/deinterlace
/proc/stb/vmpeg/deinterlace_choices

Is there any documentation for these settings, and are there more settings than these which relate to the video processor? Is there a config file where I can set them permanently?

Any help appreciated.

IanB
Wizard
Posts: 1550
Joined: Sat Jan 24, 2009 14:04
Location: Melbourne

Re: Video processing options

Post by IanB » Mon Oct 30, 2017 07:20

Very little. You may try searching for the chipset doco, driver source code or reading other enigma2 forums (the German's seem quite adept at documenting their tinkering).

Usually /proc/.../*_choices will list the valid options for the basename /proc file.

Code: Select all

e.g.
cat /proc/stb/vmpeg/0/sharpness_control_choices
disable enable

cat /proc/stb/vmpeg/0/sharpness_control
disable

echo  enable > /proc/stb/vmpeg/0/sharpness_control

cat /proc/stb/vmpeg/0/sharpness_control
enable
For /proc/.../*_value control files the input is usually a small range of integers. Careful experimentation might divine the useful range.

Hint! Use the "> /proc/stb/vmpeg/0/sharpness_value echo 42" style syntax to avoid the shell output to file handle syntax collision.

sonicblue
Master
Posts: 247
Joined: Wed Oct 25, 2017 14:30

Re: Video processing options

Post by sonicblue » Mon Oct 30, 2017 07:42

Thanks Ian.

Just to clarify, when changing /proc values using the echo redirect method, am I correct in understanding these changes will be reset back to defaults on reboot? I'm assuming there is a config file somewhere which stores all the default values that gets loaded on boot, is that correct? Because I don't want to change anything until I know I can reset everything to default (don't want to stuff anything up basically :lol: )

IanB
Wizard
Posts: 1550
Joined: Sat Jan 24, 2009 14:04
Location: Melbourne

Re: Video processing options

Post by IanB » Mon Oct 30, 2017 07:50

Yes a reboot will put these back. Just restarting enigma2 will reestablish the important ones.

Some control files are actively written by the enigma2 process so trying to change them may be challenging.

Cat the file before changing so you can put back the original value.

User avatar
peteru
Uber Wizard
Posts: 9741
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

Re: Video processing options

Post by peteru » Mon Oct 30, 2017 08:17

Sharpness value is an int16 and has a valid range of -32768 to 32767 with default being 0.

However, I'd recommend against using that particular sharpness setting. Use the PEP version of sharpness, which already has a GUI - Video Enhancement in the AV Setup section.

Actually, I'd recommend against using any sharpness setting other than zero; for picture quality.

"Beauty lies in the hands of the beer holder."
Blog.

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: Video processing options

Post by prl » Mon Oct 30, 2017 08:21

sonicblue wrote:
Sun Oct 29, 2017 20:12
...
I see a some interesting items in these folders and would like to learn how they affect the video processor.

/proc/stb/vmpeg/0/sharpness_control
/proc/stb/vmpeg/0/sharpness_control_choices
/proc/stb/vmpeg/0/sharpness_value
/proc/stb/vmpeg/deinterlace
/proc/stb/vmpeg/deinterlace_choices

None of those settings are controlled in the UI code, as far as I can tell. The Sharpness setting in MENU>Setup>AV settings>Video enhancement settings controls /proc/stb/vmpeg/0/pep_sharpness (and I don't know why that and not /proc/stb/vmpeg/0/sharpness_value). The range used for pep_sharpness in the code is 0-0x10000, in steps of 0x100 (the on-screen setting is multiplied by 256). The string sent to /proc/stb/vmpeg/0/pep_sharpness is hexadecimal (lower case, but I don't know if that's important), without the "0x" prefix, so, for example, to set the sharpness setting to the maximum, you could do:

echo 10000 > /proc/stb/vmpeg/0/pep_sharpness
sonicblue wrote:
Sun Oct 29, 2017 20:12
Is there any documentation for these settings

I haven't been able to Google any documentation.
sonicblue wrote:
Sun Oct 29, 2017 20:12
and are there more settings than these which relate to the video processor?

I guess it depends on just what kind of settings you want covered. For example, the colourspace selection is in cat /proc/stb/video/hdmi_colorspace (and has an "_choices" file, too).
sonicblue wrote:
Sun Oct 29, 2017 20:12
Is there a config file where I can set them permanently?
...

Not that I know of.

You could create /usr/bin/enigma2_pre_start.sh and put the commands to set those /proc files to your preferred values in that script. The script needs to have its execute bits set (see /usr/bin/enigma2.sh). You'd need to either add the script to your settings backups list, or copy it to the PVR each time you did a USB upgrade.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

User avatar
MrQuade
Uber Wizard
Posts: 11844
Joined: Sun Jun 24, 2007 13:40
Location: Perth

Re: Video processing options

Post by MrQuade » Mon Oct 30, 2017 10:06

Just something worth considering. I assume this query is in regards to your observation that your Wiz is oversaturating blues?

Have you definitely verified this with another device connected to the same HDMI port using the same source material?
Logitech Harmony Ultimate+Elite RCs
Beyonwiz T2/3/U4/V2, DP-S1 PVRs
Denon AVR-X3400h, LG OLED65C7T TV
QNAP TS-410 NAS, Centos File Server (Hosted under KVM)
Ubiquiti UniFi Managed LAN/WLAN, Draytek Vigor130/Asus RT-AC86U Internet
Pixel 4,5&6, iPad 3 Mobile Devices

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: Video processing options

Post by prl » Mon Oct 30, 2017 10:10

MrQuade wrote:
Mon Oct 30, 2017 10:06
Just something worth considering. I assume this query is in regards to your observation that your Wiz is oversaturating blues?
...

Sonicblue has noticed problems with both colour balance and with the video processing on his setup. I mentioned the colourspace control because of the former.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

User avatar
MrQuade
Uber Wizard
Posts: 11844
Joined: Sun Jun 24, 2007 13:40
Location: Perth

Re: Video processing options

Post by MrQuade » Mon Oct 30, 2017 10:17

prl wrote:
Mon Oct 30, 2017 10:10

Sonicblue has noticed problems with both colour balance and with the video processing on his setup. I mentioned the colourspace control because of the former.
Yes, my question would have been weirdly specific had I not been referring to that thread ;)
Logitech Harmony Ultimate+Elite RCs
Beyonwiz T2/3/U4/V2, DP-S1 PVRs
Denon AVR-X3400h, LG OLED65C7T TV
QNAP TS-410 NAS, Centos File Server (Hosted under KVM)
Ubiquiti UniFi Managed LAN/WLAN, Draytek Vigor130/Asus RT-AC86U Internet
Pixel 4,5&6, iPad 3 Mobile Devices

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: Video processing options

Post by prl » Mon Oct 30, 2017 10:21

sonicblue wrote:
Mon Oct 30, 2017 07:42
...
Just to clarify, when changing /proc values using the echo redirect method, am I correct in understanding these changes will be reset back to defaults on reboot?

That's correct.
sonicblue wrote:
Mon Oct 30, 2017 07:42
I'm assuming there is a config file somewhere which stores all the default values that gets loaded on boot, is that correct?

Yes and no. It's not done that way. There are defaults, but they're coded into the kernel (/proc files are a means of viewing kernel settings and dinformation, and changing kernel settngs, including some driver settings). There is an application-level configuration file (/etc/enigma2/settings), but that contains (non-default) application settings. Where /proc/stb files are being set via UI settings, a corresponding config variable needs to exist and there needs to be corresponding code that sends its value to the appropriate file in /proc/stb. For those configuration variables, there will usually be some way of changing them in the settings screens.

Most of the video processing settings are controlled in the source file lib/python/Plugins/SystemPlugins/VideoEnhancement/VideoEnhancement.py.
sonicblue wrote:
Mon Oct 30, 2017 07:42
Because I don't want to change anything until I know I can reset everything to default (don't want to stuff anything up basically :lol: )

As IanB said, a reboot will set all /proc/stb changes back to their system defaults. A reboot and not just a GUI restart is needed because they're kernel, not application, settings.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

sonicblue
Master
Posts: 247
Joined: Wed Oct 25, 2017 14:30

Re: Video processing options

Post by sonicblue » Mon Oct 30, 2017 13:33

I don't have an issue with the blue colour anymore after reducing video enhancements saturation by ~6 clicks. I think it was just the general saturation which seems to be a bit higher on the T2 compared to my other devices.

Found this German forum megathread where they were discussing about the scaler being too soft (this is my complaint also, coming from a Tivo I find the image not as sharp on the T2). In the thread they seem to have found a solution where after a driver update the setting "pep_scaler_sharpness" (not pep_sharpness, which they also tried in conjunction with sharpness_control and sharpness_value to their dissatisfaction) reportedly improved the resolvable resolution on test patterns when set to a value of around 0013 to 0018. Naturally I am keen to try this setting. Unfortunately I do not have a "pep_scaler_sharpness" in /proc/stb/vmpeg/0, but I see the VideoEnhancement.py file does make reference to it, so perhaps it is still accessible in some way? Is it possible to create the setting and then redirect a value into it? Perhaps my T2's hardware doesn't support it and that's why it's missing. If you have a T4 please report whether you have that setting. I don't know much about linux but according to prl we cannot just create the value manually, it seems the kernel has to do it (correct me if I'm wrong, I know almost nothing about linux).

Also in VideoEnhancement.py I am interested in

Code: Select all

/proc/stb/vmpeg/0/pep_scaler_vertical_dejagging
/proc/stb/vmpeg/0/smooth
If those settings could be exposed too it would be very interesting.

The German forum also mentioned this method to apply the new scaler settings on bootup, but I am not sure if it applies to our models.

Code: Select all

echo "echo 0013> / proc / stb / vmpeg / 0 / pep_scaler_sharpness" >> /etc/init.d/bootup 
echo "echo 1 > / proc / stb / vmpeg / 0 / pep_apply ">> /etc/init.d/bootup
Last edited by sonicblue on Mon Oct 30, 2017 13:48, edited 1 time in total.

User avatar
MrQuade
Uber Wizard
Posts: 11844
Joined: Sun Jun 24, 2007 13:40
Location: Perth

Re: Video processing options

Post by MrQuade » Mon Oct 30, 2017 13:46

There are no

Code: Select all

/proc/stb/vmpeg/0/pep_scaler*
entries on the T4. The T2 and T4 look the same in that regard.
Logitech Harmony Ultimate+Elite RCs
Beyonwiz T2/3/U4/V2, DP-S1 PVRs
Denon AVR-X3400h, LG OLED65C7T TV
QNAP TS-410 NAS, Centos File Server (Hosted under KVM)
Ubiquiti UniFi Managed LAN/WLAN, Draytek Vigor130/Asus RT-AC86U Internet
Pixel 4,5&6, iPad 3 Mobile Devices

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: Video processing options

Post by IanSav » Mon Oct 30, 2017 15:10

Hi Sonicblue,

If you are finding your picture image a little soft have you checked that there is no underscan/overscan settings in place? Always use 1:1 mapping (or whatever you gear calls it) to get the best possible image. This simple check sometimes gets lost in the hunt for picture improvements.

Regards,
Ian.

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: Video processing options

Post by prl » Mon Oct 30, 2017 15:50

sonicblue wrote:
Mon Oct 30, 2017 13:33
...

The German forum also mentioned this method to apply the new scaler settings on bootup, but I am not sure if it applies to our models.

Code: Select all

echo "echo 0013> / proc / stb / vmpeg / 0 / pep_scaler_sharpness" >> /etc/init.d/bootup 
echo "echo 1 > / proc / stb / vmpeg / 0 / pep_apply ">> /etc/init.d/bootup

IMO, that's an ugly way to do it, especially since it would not be a good idea to add any of the /etc/init.d files to your settings backups, notwithstanding whether the T4 actually has those /proc/stb files. There's also a possibility that the files might be written to later in the init startup scripts. At the moment, only /proc/stb/video/videomode and /proc/stb/fp/wol are written to by the init scripts, but who knows what may be done in future firmware?

You also definitely don't want any of those spaces in the /proc/stb filenames (though that may be an error copy/pasted from the other forum).

The effect of what's there in the first command would be to do:

echo 0013 proc / stb / vmpeg / 0 / pep_scaler_sharpness > /

I.e, to try to write all that stuff into the root directory itself (which, fortunately, will fail, even if run by the root user).
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: Video processing options

Post by prl » Mon Oct 30, 2017 16:05

sonicblue wrote:
Mon Oct 30, 2017 13:33
... Unfortunately I do not have a "pep_scaler_sharpness" in /proc/stb/vmpeg/0, but I see the VideoEnhancement.py file does make reference to it, so perhaps it is still accessible in some way?

The relevant Beyonwiz code is:

Code: Select all

			if os_path.exists("/proc/stb/vmpeg/0/pep_scaler_sharpness"):
				def setScaler_sharpness(config):
					myval = int(config.value)
					try:
						print "--> setting scaler_sharpness to: %0.8X" % myval
						f = open("/proc/stb/vmpeg/0/pep_scaler_sharpness", "w")
						f.write("%0.8X" % myval)
						f.close()
					except IOError:
						print "couldn't write pep_scaler_sharpness."

					if not VideoEnhancement.firstRun:
						self.setConfiguredValues()

				config.av.scaler_sharpness = ConfigSlider(default=13, limits=(0,26))
				config.av.scaler_sharpness.addNotifier(setScaler_sharpness)
			else:
				config.av.scaler_sharpness = NoSave(ConfigNothing())
which only creates an active config entry if the corresponding /proc/stb file exists. If the config variable is set to NoSave(ConfigNothing())
it will do nothing, and won't appear in the settings screen.
sonicblue wrote:
Mon Oct 30, 2017 13:33
Is it possible to create the setting and then redirect a value into it? Perhaps my T2's hardware doesn't support it and that's why it's missing. If you have a T4 please report whether you have that setting. I don't know much about linux but according to prl we cannot just create the value manually, it seems the kernel has to do it (correct me if I'm wrong, I know almost nothing about linux).

Files in the /proc file system are created by the kernel and drivers in the kernel. For device drivers, they reflect things that the driver/hardware combination can do (or they should). You can't add a new one without changing at least the driver code (and possibly also the hardware ;))
sonicblue wrote:
Mon Oct 30, 2017 13:33
Also in VideoEnhancement.py I am interested in

Code: Select all

/proc/stb/vmpeg/0/pep_scaler_vertical_dejagging
/proc/stb/vmpeg/0/smooth

The same applies to any other /proc/stp files that the driver and/or hardware doesn't support.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

sonicblue
Master
Posts: 247
Joined: Wed Oct 25, 2017 14:30

Re: Video processing options

Post by sonicblue » Mon Oct 30, 2017 17:19

prl wrote:
Mon Oct 30, 2017 16:05
sonicblue wrote:
Mon Oct 30, 2017 13:33
Is it possible to create the setting and then redirect a value into it?
Files in the /proc file system are created by the kernel and drivers in the kernel. For device drivers, they reflect things that the driver/hardware combination can do (or they should). You can't add a new one without changing at least the driver code (and possibly also the hardware ;))

I presume that means it's not possible to enable that setting then :(

Well, maybe it's not so bad. I checked with a 576i resolution pattern and it seems to be resolving all the resolution if I set the T2 to 1080p. At lower HDMI resolutions the alternating 1 pixel lines become more grey (at 1080i its more grey in the vertical direction) and at 576i/p it's solid grey. I still think there may be some benefit to that pep_scaler_sharpness setting, but I guess we'll never know.

For now I'm outputting 576i channels as 1080p and it seems to be ok for general free to air viewing. The image is still not as sharp as Tivo outputting native 576i, but as long as it's passing all the resolution on the test pattern then I guess I shouldn't be complaining :lol:

Here is the 576i resolution test pattern I used if you want check it on yours.
Last edited by sonicblue on Mon Oct 30, 2017 17:23, edited 1 time in total.

prl
Wizard God
Posts: 32709
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: Video processing options

Post by prl » Mon Oct 30, 2017 17:22

sonicblue wrote:
Mon Oct 30, 2017 17:19
...
Here is the 576i resolution test pattern if you want check it on yours.

Thanks, I'll grab it, but I have a seriously non-high-end AV setup.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

sonicblue
Master
Posts: 247
Joined: Wed Oct 25, 2017 14:30

Re: Video processing options

Post by sonicblue » Mon Oct 30, 2017 19:09

sonicblue wrote:
Mon Oct 30, 2017 17:19
The image is still not as sharp as Tivo outputting native 576i, but as long as it's passing all the resolution on the test pattern then I guess I shouldn't be complaining

I knew I shouldn't have typed this :lol:

I notice if I set all the noise reduction filters on my TV to max so the image looks blurry and crap, the res pattern still resolves all the lines. So the test pattern is not really telling the full story here :roll: . I guess the denoise filters are smart and only filter under certain circumstances like when the scene is moving or if some noise threshold is met. I did put in those very faint lines into the test pattern with only 3 digital values of contrast and even those seem to survive, but on actual content it's a different story.

Post Reply

Return to “Developers Community”