catalinii / minisatip

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

Fix calculation of signal values #945

Closed lars18th closed 2 years ago

lars18th commented 2 years ago

When the DVB adapter reports dB signal, fix the result value (it's less in the order of 100 smaller times). For Enigma STB devices assume that the driver reports dB allways.

lars18th commented 2 years ago

Hi @catalinii ,

The patch is ready to merge.

catalinii commented 2 years ago

@lars18th I am fonfused related to the assumption that e2 will always report db always.

As every driver developer is free to use whichever measurement this ia probably not a generic implementation.

Thank you

lars18th commented 2 years ago

Hi @catalinii ,

As I writed in https://github.com/catalinii/minisatip/issues/911#issuecomment-1048029529 I'm working on fixing this. However, it will be preferable to merge this PR. Then it will be more easy to fix it. Please think that this patch incorporates more tunning maps, fixes the calculation of dB->Signal, and adds the dB conversion to the get_signal() function as well.

Regards.

Jalle19 commented 2 years ago

Can we merge this? If there's anything that could be improved it could be done in a new PR?

catalinii commented 2 years ago

@lars18th merged this one, but please submit a PR later about the enigma2 handling of relative (non db) measures

lars18th commented 2 years ago

Hi @catalinii ,

@lars18th merged this one, but please submit a PR later about the enigma2 handling of relative (non db) measures

Yes. It's already in my TODO list. And my strategy for the next PR is this:

  1. Do a more cleanup of the code (it's possible to reduce the number of cases).
  2. Remove the ENIGMA2 ifdef because I observed that is not deterministic: some tuners report in dB and some relative in E2.
  3. Provide a method to enforce the use of dB for a tuner. Then the user can select (aka force) relative or dB at a tuner level (in the same device one tuner could report relative and other in dB). And this will be valid for all platforms. By default it will be relative (or automatic), and the user could mark the tuner as dB.

I hope you agree with this. Regards.