Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After quitting with ctrl+c and then launch mumudvb the tuner keeps polling #249

Open
Dazzler1985 opened this issue May 31, 2019 · 13 comments

Comments

@Dazzler1985
Copy link

After quitting with ctrl+c and then launch mumudvb the tuner keeps polling
This is when i clean boot my server
sudo mumudvb -d -v -c mumu2.conf
Info: Autoconf: We update the channel CAM support
Info: Autoconf: Diffusion 6 channels
Info: Autoconf: Channel number : 8, service id 409 name : "TV Oranje"
Info: Autoconf: Multicast4 ip : 239.100.0.8:1234
Info: Autoconf: Unicast : Channel accessible via the master connection, 0.0.0.0:4242
Deb0: Autoconf: pids : 1900 (PMT), 1901 (Video (MPEG4-AVC)), 1902 (Audio (MPEG1) dut),
Info: Autoconf: Channel number : 9, service id 410 name : "SchlagerTV"
Info: Autoconf: Multicast4 ip : 239.100.0.9:1234
Info: Autoconf: Unicast : Channel accessible via the master connection, 0.0.0.0:4242
Deb0: Autoconf: pids : 2000 (PMT), 2001 (Video (MPEG4-AVC)), 2002 (Audio (MPEG1) ger),
Info: Autoconf: Channel number : 10, service id 411 name : "NashvilleTV"
Info: Autoconf: Multicast4 ip : 239.100.0.10:1234
Info: Autoconf: Unicast : Channel accessible via the master connection, 0.0.0.0:4242
Deb0: Autoconf: pids : 2100 (PMT), 2101 (Video (MPEG4-AVC)), 2102 (Audio (MPEG1) eng),
Info: Autoconf: Channel number : 12, service id 413 name : "NL Regionaal 1"
Info: Autoconf: Multicast4 ip : 239.100.0.12:1234
Info: Autoconf: Unicast : Channel accessible via the master connection, 0.0.0.0:4242
Deb0: Autoconf: pids : 2300 (PMT), 2301 (Video (MPEG4-AVC)), 2302 (Audio (MPEG1) dut),
Info: Autoconf: Channel number : 13, service id 414 name : "NL Regionaal 2"
Info: Autoconf: Multicast4 ip : 239.100.0.13:1234
Info: Autoconf: Unicast : Channel accessible via the master connection, 0.0.0.0:4242
Deb0: Autoconf: pids : 2400 (PMT), 2401 (Video (MPEG4-AVC)), 2402 (Audio (MPEG1) dut),
Info: Autoconf: Channel number : 25, service id 432 name : "Enjoy TV HD"
Info: Autoconf: Multicast4 ip : 239.100.0.25:1234
Info: Autoconf: Unicast : Channel accessible via the master connection, 0.0.0.0:4242
Deb0: Autoconf: pids : 4200 (PMT), 4201 (Video (MPEG4-AVC)), 4202 (Audio (MPEG2) eng),
Info: Autoconf: The NIT version changed, channels number could have changed !
Info: Autoconf: We got the NIT, we update the channel names

So it works and i can watch channels now.
But when i quit mumudvb with CTRL+C
Main: Caught signal 2
ERRO: Main: Autoconf error 2
ERRO: Main: Autoconf error 2
ERRO: Main: Autoconf error 2
ERRO: Main: Autoconf error 2
ERRO: Main: Autoconf error 2
ERRO: Main: Autoconf error 2
ERRO: Main: Autoconf error 2
ERRO: Main: Autoconf error 2
ERRO: Main: Autoconf error 2
ERRO: Main: Autoconf error 2
ERRO: Main: Autoconf error 2
ERRO: Main: Autoconf error 2
ERRO: Main: Autoconf error 2
ERRO: Main: Autoconf error 2
ERRO: Main: Autoconf error 2
ERRO: Main: Autoconf error 2
ERRO: Main: Autoconf error 2
ERRO: Main: Autoconf error 2
ERRO: Main: Autoconf error 2
ERRO: Main: Autoconf error 2
Info: Main: End of streaming. We streamed during 0d 0:02:46
Info: Main: Caught signal 2 - closing cleanly.
Info: Main: ========== MuMuDVB version 2.1.0_20181020_mumudvb2 is stopping with ExitCode 0 ==========

and i want to launch it with the same command again:
sudo mumudvb -d -v -c mumu2.conf
The tuner keeps polling and eventually it will exit with error code:
Info: Main: Autoconfiguration, we activate SAP announces. if you want to disable them see the README.
Info: Main: Autoconfiguration, we activate PAT rewriting. if you want to disable it see the README.
Info: Main: Autoconfiguration, we activate SDT rewriting. if you want to disable it see the README.
Info: Main: ========== End of configuration, MuMuDVB version 2.1.0_20181020_mumudvb2 is starting ==========
Info: Main: Streaming. Freq 12074000.000000
Info: Tune: Using DVB card "TurboSight TBS 6904 DVB-S/S2 " tuner 0
Info: Tune: Tuning DVB-S to Freq: 1474000 kHz, LO frequency 10600000 kHz Pol:V Srate=30000000, LNB number: 0
Info: Tune: LNB voltage 13V
Info: Tune: DISEQC SETTING SUCCEDED
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Deb0: Tune: polling....
Info: Tune: FE_STATUS:
Info: Main: Card not tuned after timeout - exiting

So i hope someone can point me in the right direction because rebooting everytime i want to change something is not doable.

@braice
Copy link
Owner

braice commented Jun 3, 2019 via email

@pszemus
Copy link
Contributor

pszemus commented Jun 6, 2019

I think your issue is similar to mine. Reloading kernel modules helps but it's not a solution for me.

@scramatte
Copy link

Similar issue here...
Reloading kernel modules helps but it's not a solution for me.

@braice
Copy link
Owner

braice commented Feb 20, 2020 via email

@borismcfishtank
Copy link

borismcfishtank commented Jun 26, 2020

Interestingly I am seeing this same issue now on a TBS 6281SE card. I haven't seen this issue previously on DVB-S or DVB-T cards from them or on the little USB dongles I use for testing.

If I simply run mumudvb -d -c with the following as its contents

tuner=0
freq=474000
delivery_system=DVBT2
unicast=1
ip_http=127.0.0.1
port_http=8458
bandwidth=8MHz
multicast_ipv4=0
autoconf_radios=1
autoconfiguration=full

I can exit prior to mumu reporting and FE_STATUS out, after that if I press Ctrl-C It simply reports that it's caught the signal but just sits there. This is after a fresh reboot and I can replicate this every time. The DVB-S card in the system works fine.

The output I see is:

Info:  Autoconf:  Channel number :   5,   service id 18112  name : "CBBC HD"
Info:  Autoconf:        Unicast : Channel accessible via the master connection, 127.0.0.1:8458
Info:  Autoconf:  Channel number :   6,   service id 20160  name : "TBN UK"
Info:  Autoconf:        Unicast : Channel accessible via the master connection, 127.0.0.1:8458
Info:  Autoconf:  Channel number :   7,   service id 20224  name : "Shopping Quarter"
Info:  Autoconf:        Unicast : Channel accessible via the master connection, 127.0.0.1:8458
Info:  Main:  Channel "BBC TWO HD" down.Card 8
Info:  Main:  Channel "Channel 5 HD" down.Card 8
Info:  Main:  Channel "CBBC HD" down.Card 8
Info:  Main:  Channel "TBN UK" down.Card 8
Info:  Main:  Channel "Shopping Quarter" down.Card 8
^CERRO:  Main:  Caught signal 2
Info:  Main:  Channel "BBC ONE HD" down.Card 8
Info:  Main:  Channel "ITV HD" down.Card 8
Info:  Main:  Channel "Channel 4 HD" down.Card 8
^CERRO:  Main:  Caught signal 2
^CERRO:  Main:  Caught signal 2
ERRO:  Main:  Caught signal 14

The only way I can exit it is kill -9 it.

I've installed the latest drivers and firmware from TBS and I was using the mumudvb deb package, but I just did a git-clone and build to see if that made any difference but the behavior was still the same.

I will attempt to test this later this evening with some other DVB-T cards from TBS and see what I get. I only mention the manufacturer as I've used their DVB-T cards previously and haven't had a problem, but this particular card I don't recall using before.

Any suggestions?

After leaving it running for a while after pressing Ctrl-C it loops output of:

ERRO:  Main:  No data from card 8 in 600s, exiting.
ERRO:  Main:  No data from card 8 in 600s, exiting.
ERRO:  Main:  No data from card 8 in 600s, exiting.
ERRO:  Main:  No data from card 8 in 600s, exiting.
ERRO:  Main:  No data from card 8 in 600s, exiting.
ERRO:  Main:  No data from card 8 in 600s, exiting.
ERRO:  Main:  No data from card 8 in 600s, exiting.

@borismcfishtank
Copy link

Adding to this, after some testing it appears to only occur when setting deliver_system to DVBT2 not on DVBT or S or S2

@zhang111chao
Copy link

please add skype jack_2431.

@zhang111chao
Copy link

Modify the mumudvb source code can solve the above problems
1 . mumudvb.c
static void SignalHandler (int signum)
{
.............
else if (signum == SIGUSR1 || signum == SIGUSR2 || signum == SIGHUP )

------->

  	else if (signum == SIGUSR1 || signum == SIGUSR2 || signum == SIGHUP || signum == SIGINT || signum == SIGPIPE || signum == SIGTERM)
  1. mumudvb_mon.c
    void monitor_func(void arg){
    ...................
    else if (received_signal == SIGHUP) //Sync logs
    {
    log_message( log_module, MSG_DEBUG,"Sync logs\n");
    sync_logs();
    received_signal = 0;
    }
    // add source
    else if (received_signal == SIGINT) //ctrl+c
    {
    printf("ctrl+c exit !!!\n");
    exit(1);
    received_signal = 0;
    }
    else if (received_signal == SIGALRM) //timeout
    {
    printf("timeout exit !!!\n");
    exit(1);
    received_signal = 0;
    }
    else if (received_signal == SIGTERM) //timeout
    {
    printf("timeout exit !!!\n");
    exit(1);
    received_signal = 0;
    }

@zhang111chao
Copy link

1

@yo2loj
Copy link
Contributor

yo2loj commented Jun 29, 2020

Just a small comment: SIGINT and SIGTERM exit the program in a "normal" fashion, so there is no need to exit with error 1. Use exit(0) instead.
Also I would output a message like "Terminating by request" or something on SIGTERM, not "timeout".

@borismcfishtank
Copy link

I ended up with this

else if (received_signal == SIGHUP) //Sync logs
{
	log_message( log_module, MSG_DEBUG,"Sync logs\n");
	sync_logs();
	received_signal = 0;
}
else if (received_signal == SIGINT)
{
	printf("SIGINT received, Terminating by request\n");
	exit(0);
}
else if (received_signal == SIGALRM)
{
	printf("SIGALRM received, Terminating by request\n");
	exit(1);
}
else if (received_signal == SIGTERM)
{
	printf("SIGTERM received, Terminating by request\n");
	exit(0);
}

In monitor_func and it will terminate now when hung with ctrl-z or using timeout 60 mumudvb .....

SIGALRM was added as I wasing using timeout to run mumudvb in autoconf for a period of time to just grab the channels.json to parse. I'm not sure if that should exit with a 1 or a 0, other docs I've read suggest SIGALRM should exit with its signal code (14)? Not my area of expertise I'm afraid, but more information is always nice to have.

I'm just curious as to why this is needed for the specific case of DVB-T2 delivery system and it finding channels, but those channels reporting as down.

Any ideas? I'm not over the code base by any means, but this seems like a bit of a brute force approach here when these are gracefully handled when simply tuning DVB-T/S/S2.

@braice
Copy link
Owner

braice commented Jul 12, 2020 via email

@borismcfishtank
Copy link

Sure thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants