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

Release DVB devices for powersaving with Sundtek USB devices #1054

Closed goldelehr closed 1 year ago

goldelehr commented 1 year ago

Hi,

would it be possible for minisatip to fully release currently unused devices? I have a Sundtek USB DVB-S stick which won't go into powersave mode until /dev/dvb/adapterX/frontend0 and /dev/dvb/adapterX/dvr0 are released by the process. Minisatip permanently keeps these two devices in use and prevents the stick to go into powersave mode. TVHeadend for example directly releases all devices after it doesn't use them anymore for streaming or epg grabbing.

There is a tool for Sundtek devices which lists devices with their current attachend PIDs.

This is how it looks when Minisatip is idling:

mediaclient --lc
**** List of Media Clients ****
/dev/dvb/adapter2/frontend0:
  4163606 ... minisatip
/dev/dvb/adapter2/dvr0:
  4163606 ... minisatip
/dev/dvb/adapter2/demux0:
  No client connected
/dev/mediainput0:
  No client connected

This is how it looks when TVHeadend is idling:

mediaclient --lc
**** List of Media Clients ****
/dev/dvb/adapter2/frontend0:
  No client connected
/dev/dvb/adapter2/dvr0:
  No client connected
/dev/dvb/adapter2/demux0:
  No client connected
/dev/mediainput0:
  No client connected

I'm really willing to help but unfortunately i'm not great at C.

Thanks for your help and keep up the good work.

catalinii commented 1 year ago

Hi,

Generally minisatip release a device if there are no clients using it.

Can u upload a log showing the adapters being kept open?

Thanks

goldelehr commented 1 year ago

I also own a WinTV DualHD stick which gets released fine. It seems to be an issue with the Sundtek devices.

I enabled "general,adapter" for increased log verbosity. At around 09:20:23 i switched to a channel and watched it until 09:20:47. I waited for another 3 minutes before cutting the log file.

minisatip1.log

The adapter timeout was set to 30 seconds.

sundtek commented 1 year ago

Can you try: /opt/bin/mediaclient --softpidfilter=on -d /dev/dvb/adapter0/dvr0

if all pid filters are closed the tuner is supposed to deliver the entire transport stream. this behaviour is different than with regular kernel drivers - regular kernel drivers will not deliver any data at that point. I still see data coming in in the logfile, maybe minisatip is waiting for all incoming data to be consumed.

--softpidfilter=on should also stop delivering data once all filters are removed.

The reason for this is that we want to tune to a transponder and allow a simple cat on the DVR interface for reading the transport stream without having to set up any PIDs.

Jalle19 commented 1 year ago

@goldelehr please try @sundtek 's suggestion and reopen the ticket if the issue persists