catalinii / minisatip

minisatip is an SATIP server for linux using local DVB-S2, DVB-C, DVB-T or ATSC cards
https://minisatip.org
325 stars 78 forks source link

Add Tuner status type enforcement #1030

Closed lars18th closed 1 year ago

lars18th commented 1 year ago

For some adapters the DVB API version 5.5 is not available. In these cases the software can't distinguish the status reporting of the tuners. Therefore, the values of Strength and/or SNR could be incorrect. If you know how the driver of the tuner reports the data (in percentage or in dB), then you could tweak the values with the -M --multiplier parameter.

This patch adds the option to enforce percentage or decibel modes at tuner level (because you can mix different hardware and drivers in the same machine). Example:

-M 0:%1.0-#1.0 -M 1:%1.0-#1.0 -M 2:2.0-1.0 -M 3:2.0-1.0

In this case the first two tuners (DVB-S) use default values enforcing "percentage" for Strength and "dB" for SNR. And for the other two tuners (DVB-T2) the types aren't enforced but the Strength is doubled.

This removes all dependencies for Enigma2 boxes, and you will have the opportunity to set the correct types/values for all of your tuners.

lars18th commented 1 year ago

Hi @catalinii and @Jalle19 ,

This PR is the final step of the work started at #911. Please, check it. I'm using it in my two E2 stb with good results.

Regards.

lars18th commented 1 year ago

Hi @catalinii ,

All suggested changes are now implemented. So please, check it! 😉

lars18th commented 1 year ago

Hi @catalinii and @Jalle19 ,

Ready to merge it? Or you want to add something more?

For example, with this PR the current behaviour with Enigma2 boxes will be changed (because the remove of the line if (opts.enigma) { ... }). Therefore, perhaps I can add a check if the user is not configuring the tuner, and then in this case automatically add the TUNER_FORCE_STRENGTH_PERCENT and TUNER_FORCE_SNR_DECIBEL flags to the tuners. But only if the user don't enforce anything for the tuner. With this small addition the default behaviour will not change in reference to the current behaviour.

Something like this (in set_adapters_delsys()):

        if (opts.enigma && !force_tuner_signal) {
            force_tuner_signal = TUNER_FORCE_STRENGTH_PERCENT | TUNER_FORCE_SNR_DECIBEL;
        }

But then the problem is how to enforce to not use any translation at all. Any idea? You want to add a third option like ~ to indicate "use original values"?

Please comment about it. Thank you.