Req Kodi signal strenght/snr indicator in db/dBm
#16
(2022-05-01, 19:26)Ptersburg_34 Wrote: If there is no tvheadend signal value, kodi will not run, I think there is an error caused by kodi.


If you rant to report a Kodi bug, please open an issue here: https://github.com/xbmc/xbmc/issues
Reply
#17
I have no idea how to fix it, but it looks like in addition to snr, signal, ber, and unc  there is now also signal_scale and snr_scale.   If scale is 1 then use % if scale is 2 then use dB.

What I'm wondering is if getting a negative number for signal messes up Kodi?
Reply
#18
(2022-05-02, 06:37)bluzee Wrote: I have no idea how to fix it, but it looks like in addition to snr, signal, ber, and unc  there is now also signal_scale and snr_scale.   If scale is 1 then use % if scale is 2 then use dB.

What I'm wondering is if getting a negative number for signal messes up Kodi?


I know pretty well how to fix this. Again, In order to fix this in Kodi, tvheadend must be changed to offer a programming interface for the dbm values. Currently it is lacking such an API.

Somebody must open a feature request for tvheadend and once this got implemented we can fix this on Kodi side.
Reply
#19
Unfortunately opening a request is kind of pointless unless it's a pull request.

I'm trying to understand this so if you think I'm on the right track let me know.  I can't find anywhere that pvr.hts is making requests to the API which would be a URL such as /api/status/inputs.  It seems to get status via htsmsg and htsp server.  If this is correct then htsp_server.c has this code....

Code:
   htsmsg_add_str(m, "feStatus",   sig->status_text);
    if((sig->snr != -2) && (sig->snr_scale == SIGNAL_STATUS_SCALE_RELATIVE))
      htsmsg_add_u32(m, "feSNR",    sig->snr);
    if((sig->signal != -2) && (sig->signal_scale == SIGNAL_STATUS_SCALE_RELATIVE))
      htsmsg_add_u32(m, "feSignal", sig->signal);

Based on this I would say when the scale is set to SIGNAL_STATUS_SCALE_DECIBEL then neither snr or signal are sent in htsmsg.

Am I even remotely close on this?  If so would something other than feSNR and feSignal need to be used with a condition ==SIGNAL_STATUS_SCALE_DECIBEL?
Reply
#20
(2022-05-04, 05:48)bluzee Wrote: Unfortunately opening a request is kind of pointless unless it's a pull request.

I'm trying to understand this so if you think I'm on the right track let me know.  I can't find anywhere that pvr.hts is making requests to the API which would be a URL such as /api/status/inputs.  It seems to get status via htsmsg and htsp server.  If this is correct then htsp_server.c has this code....

Code:
   htsmsg_add_str(m, "feStatus",   sig->status_text);
    if((sig->snr != -2) && (sig->snr_scale == SIGNAL_STATUS_SCALE_RELATIVE))
      htsmsg_add_u32(m, "feSNR",    sig->snr);
    if((sig->signal != -2) && (sig->signal_scale == SIGNAL_STATUS_SCALE_RELATIVE))
      htsmsg_add_u32(m, "feSignal", sig->signal);

Based on this I would say when the scale is set to SIGNAL_STATUS_SCALE_DECIBEL then neither snr or signal are sent in htsmsg.

Am I even remotely close on this?  If so would something other than feSNR and feSignal need to be used with a condition ==SIGNAL_STATUS_SCALE_DECIBEL?


You are on the right track. You need to define another two fields (like feSNRDb, feStatusDb) to send the decibel scaled values, but only if they are present. Do not send these fields if the db
values are not available.
Reply
#21
(2022-05-04, 05:48)bluzee Wrote: Unfortunately opening a request is kind of pointless unless it's a pull request.

I'm trying to understand this so if you think I'm on the right track let me know.  I can't find anywhere that pvr.hts is making requests to the API which would be a URL such as /api/status/inputs.  It seems to get status via htsmsg and htsp server.  If this is correct then htsp_server.c has this code....

Code:
   htsmsg_add_str(m, "feStatus",   sig->status_text);
    if((sig->snr != -2) && (sig->snr_scale == SIGNAL_STATUS_SCALE_RELATIVE))
      htsmsg_add_u32(m, "feSNR",    sig->snr);
    if((sig->signal != -2) && (sig->signal_scale == SIGNAL_STATUS_SCALE_RELATIVE))
      htsmsg_add_u32(m, "feSignal", sig->signal);

Based on this I would say when the scale is set to SIGNAL_STATUS_SCALE_DECIBEL then neither snr or signal are sent in htsmsg.

Am I even remotely close on this?  If so would something other than feSNR and feSignal need to be used with a condition ==SIGNAL_STATUS_SCALE_DECIBEL?


You are on the right track. You need to define another two fields (like feSNRDb, feStatusDb) to send the decibel scaled values, but only if they are present. Do not send these fields if the db
values are not available.
Reply
#22
I do not think that the signal will be caused by tvheadend. Since tvheadend has signal value, it can connect kodi, is there a program that shows the signal values of kodi?
Reply
#23
Something like this?

python:
htsp_subscription_signal_status(htsp_subscription_t *hs, signal_status_t *sig)
{
  htsmsg_t *m = htsmsg_create_map();
  htsmsg_add_str(m, "method", "signalStatus");
  htsmsg_add_u32(m, "subscriptionId", hs->hs_sid);
  if (!htsp_anonymize(hs->hs_htsp)) {
    htsmsg_add_str(m, "feStatus",   sig->status_text);
    if((sig->snr != -2) && (sig->snr_scale == SIGNAL_STATUS_SCALE_RELATIVE))
      htsmsg_add_u32(m, "feSNR",    sig->snr);
    if((sig->snr != -2) && (sig->snr_scale == SIGNAL_STATUS_SCALE_DECIBEL))
      htsmsg_add_u32(m, "feSNRDb",    sig->snr);
    if((sig->signal != -2) && (sig->signal_scale == SIGNAL_STATUS_SCALE_RELATIVE))
      htsmsg_add_u32(m, "feSignal", sig->signal);
    if((sig->signal != -2) && (sig->signal_scale == SIGNAL_STATUS_SCALE_DECIBEL))
      htsmsg_add_u32(m, "feSignalDb", sig->signal);
    if(sig->ber != -2)
      htsmsg_add_u32(m, "feBER",    sig->ber);
    if(sig->unc != -2)
      htsmsg_add_u32(m, "feUNC",    sig->unc);
  } else {
    htsmsg_add_str(m, "feStatus", "");
  }
  htsp_send_message(hs->hs_htsp, m, &hs->hs_htsp->htsp_hmq_qstatus);
}
Reply
#24
Thanks @Klojum For some reason I couldn't get the Syntax tag to display right.
Reply
#25
(2022-05-04, 20:23)Ptersburg_34 Wrote: I do not think that the signal will be caused by tvheadend. Since tvheadend has signal value, it can connect kodi, is there a program that shows the signal values of kodi?


Well, being the lead dev for both the pvr component of Kodi and the Kodi tvheadend addon and because I also did some contributions to tvheadend, you could have some trust in what I’m saying.

I know *exactly* on the code level what is missing in all involved components and could implement everything, the only problem is that I don’t have enough free time currently.
Reply
#26
(2022-05-05, 04:21)bluzee Wrote: Something like this?

python:
htsp_subscription_signal_status(htsp_subscription_t *hs, signal_status_t *sig)
{
  htsmsg_t *m = htsmsg_create_map();
  htsmsg_add_str(m, "method", "signalStatus");
  htsmsg_add_u32(m, "subscriptionId", hs->hs_sid);
  if (!htsp_anonymize(hs->hs_htsp)) {
    htsmsg_add_str(m, "feStatus",   sig->status_text);
    if((sig->snr != -2) && (sig->snr_scale == SIGNAL_STATUS_SCALE_RELATIVE))
      htsmsg_add_u32(m, "feSNR",    sig->snr);
    if((sig->snr != -2) && (sig->snr_scale == SIGNAL_STATUS_SCALE_DECIBEL))
      htsmsg_add_u32(m, "feSNRDb",    sig->snr);
    if((sig->signal != -2) && (sig->signal_scale == SIGNAL_STATUS_SCALE_RELATIVE))
      htsmsg_add_u32(m, "feSignal", sig->signal);
    if((sig->signal != -2) && (sig->signal_scale == SIGNAL_STATUS_SCALE_DECIBEL))
      htsmsg_add_u32(m, "feSignalDb", sig->signal);
    if(sig->ber != -2)
      htsmsg_add_u32(m, "feBER",    sig->ber);
    if(sig->unc != -2)
      htsmsg_add_u32(m, "feUNC",    sig->unc);
  } else {
    htsmsg_add_str(m, "feStatus", "");
  }
  htsp_send_message(hs->hs_htsp, m, &hs->hs_htsp->htsp_hmq_qstatus);
}


Yes, this would do the trick. The code can be a bit optimized/shortened, but the logic is correct. And you should increase htsp version number by one in the same source file. Then you should be ready to PR the change. I will be happy to comment on that PR on GitHub.
Reply
#27
OK, Thank you.  I'll send that in and see what they think.
Reply
#28
It would be great if signal indicator is added in Kodi

Oley .....you are great
Reply
#29
I have one more request, which would be great. If Enigma2 OpenPLi Skin: FullNight is added, kodi will be just super.

Image
(FYI: always link the image itself, not its web page...)
Reply
#30
Kodi would be a great program.
Image
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi signal strenght/snr indicator in db/dBm0