Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
linuxdvb: do not monitor frontend in the diseqc/rotor setup
Also, move the active mux check outside tune0() function to
ensure, that the linux frontend is set again to requested
parameters (to be sure).
  • Loading branch information
perexg committed Aug 4, 2014
1 parent d5023cd commit ec1b160
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
34 changes: 18 additions & 16 deletions src/input/mpegts/linuxdvb/linuxdvb_frontend.c
Expand Up @@ -285,6 +285,7 @@ linuxdvb_frontend_stop_mux
}

/* Not locked */
lfe->lfe_ready = 0;
lfe->lfe_locked = 0;
lfe->lfe_status = 0;

Expand All @@ -299,7 +300,21 @@ static int
linuxdvb_frontend_start_mux
( mpegts_input_t *mi, mpegts_mux_instance_t *mmi )
{
linuxdvb_frontend_t *lfe = (linuxdvb_frontend_t*)mi;
linuxdvb_frontend_t *lfe = (linuxdvb_frontend_t*)mi;
mpegts_mux_instance_t *cur = LIST_FIRST(&lfe->mi_mux_active);

/* Currently active */
if (cur != NULL) {

/* Already tuned */
if (mmi == cur)
return 0;

/* Stop current */
cur->mmi_mux->mm_stop(cur->mmi_mux, 1);
}
assert(LIST_FIRST(&lfe->mi_mux_active) == NULL);

if (lfe->lfe_satconf)
return linuxdvb_satconf_start_mux(lfe->lfe_satconf, mmi);
return linuxdvb_frontend_tune1((linuxdvb_frontend_t*)mi, mmi, -1);
Expand Down Expand Up @@ -471,7 +486,7 @@ linuxdvb_frontend_monitor ( void *aux )
}

/* Stop timer */
if (!mmi) return;
if (!mmi || !lfe->lfe_ready) return;

/* re-arm */
gtimer_arm(&lfe->lfe_monitor_timer, linuxdvb_frontend_monitor, lfe, 1);
Expand Down Expand Up @@ -1045,24 +1060,10 @@ linuxdvb_frontend_tune0
int r;
struct dvb_frontend_event ev;
char buf1[256];
mpegts_mux_instance_t *cur = LIST_FIRST(&lfe->mi_mux_active);
dvb_mux_t *lm = (dvb_mux_t*)mmi->mmi_mux;
dvb_mux_conf_t *dmc;
struct dvb_frontend_parameters p;

// Not sure if this is right place?
/* Currently active */
if (cur != NULL) {

/* Already tuned */
if (mmi == cur)
return 0;

/* Stop current */
cur->mmi_mux->mm_stop(cur->mmi_mux, 1);
}
assert(LIST_FIRST(&lfe->mi_mux_active) == NULL);

/* Open FE */
lfe->mi_display_name((mpegts_input_t*)lfe, buf1, sizeof(buf1));
if (lfe->lfe_fe_fd <= 0) {
Expand Down Expand Up @@ -1246,6 +1247,7 @@ linuxdvb_frontend_tune1
time(&lfe->lfe_monitor);
lfe->lfe_monitor += 4;
gtimer_arm_ms(&lfe->lfe_monitor_timer, linuxdvb_frontend_monitor, lfe, 50);
lfe->lfe_ready = 1;
}

return r;
Expand Down
1 change: 1 addition & 0 deletions src/input/mpegts/linuxdvb/linuxdvb_private.h
Expand Up @@ -98,6 +98,7 @@ struct linuxdvb_frontend
/*
* Tuning
*/
int lfe_ready;
int lfe_locked;
int lfe_status;
int lfe_ioctls;
Expand Down

3 comments on commit ec1b160

@ksooo
Copy link
Contributor

@ksooo ksooo commented on ec1b160 Aug 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@perexg not quiete sure, but this commit could be related to https://tvheadend.org/issues/2231 I had the problems described in that issue and after reverting this commit the problems seem to be gone.

@perexg
Copy link
Contributor Author

@perexg perexg commented on ec1b160 Aug 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ksooo : Thanks. Could you try 91f3b2c ? It's in master. It seems that the status messages must be sent all always.

@ksooo
Copy link
Contributor

@ksooo ksooo commented on ec1b160 Aug 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@perexg Still no good. For me, the "fixing" part of the revert was to move the active mux check back to tune0(...). Removing the lfe_ready stuff had no influence.

Please sign in to comment.