From owner-freebsd-multimedia@FreeBSD.ORG Thu Sep 27 18:53:37 2012 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68C5E106567B for ; Thu, 27 Sep 2012 18:53:37 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id 52C368FC14 for ; Thu, 27 Sep 2012 18:53:35 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 0B0441E0070C; Thu, 27 Sep 2012 20:53:34 +0200 (CEST) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.4/8.14.4) with ESMTP id q8RIpOj5007188; Thu, 27 Sep 2012 20:51:24 +0200 (CEST) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.4/8.14.3/Submit) id q8RIpO5M007187; Thu, 27 Sep 2012 20:51:24 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Thu, 27 Sep 2012 20:51:23 +0200 To: Hans Petter Selasky Message-ID: <20120927185123.GB6608@triton8.kn-bremen.de> References: <20120812154930.GA23878@triton8.kn-bremen.de> <20120926200656.GA60363@triton8.kn-bremen.de> <201209270738.36691.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201209270738.36691.hselasky@c2i.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-multimedia@freebsd.org, Juergen Lock Subject: Re: In case mythtv setup is broken for you too... X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Sep 2012 18:53:37 -0000 On Thu, Sep 27, 2012 at 07:38:36AM +0200, Hans Petter Selasky wrote: > On Wednesday 26 September 2012 22:06:56 Juergen Lock wrote: > > On Sun, Aug 12, 2012 at 05:49:30PM +0200, Juergen Lock wrote: > > > Hi! > > > > > > (I guess I should post here too :) > > > > > > If mythtv setup is broken for you reporting a failed FE_GET_INFO ioctl > > > > > > like reported in this mythtv ticket: > > > http://code.mythtv.org/trac/ticket/10830 > > > > > > (reduced testcase: > > > http://people.freebsd.org/~nox/tmp/ioctltst.c > > > > > > ) try this media tree patch I posted a little while ago: (i.e. apply it > > > to webcamd, there's a Download patch link at the top) > > > > > > http://patchwork.linuxtv.org/patch/13563/ > > > > > > The full thread in case you want to help testing/reviewing the patch > > > > > > for upstream Linux: > > > http://thread.gmane.org/gmane.linux.drivers.video-input- > infrastructure/5 > > > 1644 > > > > The patch needed a small tweak for webcamd 3.7.0.3, maybe we should > > add it to EXTRA_PATCHES as an OPTION? > > > > --- media_tree/drivers/media/dvb-core/dvb_frontend.c.orig > > +++ media_tree/drivers/media/dvb-core/dvb_frontend.c > > @@ -603,6 +603,7 @@ static int dvb_frontend_thread(void *dat > > enum dvbfe_algo algo; > > > > bool re_tune = false; > > + bool semheld = false; > > > > dev_dbg(fe->dvb->device, "%s:\n", __func__); > > > > @@ -626,6 +627,8 @@ restart: > > > > if (kthread_should_stop() || dvb_frontend_is_exiting(fe)) { > > /* got signal or quitting */ > > + if (!down_interruptible (&fepriv->sem)) > > + semheld = true; > > fepriv->exit = DVB_FE_NORMAL_EXIT; > > break; > > } > > @@ -741,6 +744,8 @@ restart: > > fepriv->exit = DVB_FE_NO_EXIT; > > mb(); > > > > + if (semheld) > > + up(&fepriv->sem); > > dvb_frontend_wakeup(fe); > > return 0; > > } > > @@ -1819,16 +1824,20 @@ static int dvb_frontend_ioctl(struct fil > > int err = -ENOTTY; > > > > dev_dbg(fe->dvb->device, "%s: (%d)\n", __func__, _IOC_NR(cmd)); > > - if (fepriv->exit != DVB_FE_NO_EXIT) > > + if (down_interruptible (&fepriv->sem)) > > + return -ERESTARTSYS; > > + > > + if (fepriv->exit != DVB_FE_NO_EXIT) { > > + up(&fepriv->sem); > > return -ENODEV; > > + } > > > > if ((file->f_flags & O_ACCMODE) == O_RDONLY && > > (_IOC_DIR(cmd) != _IOC_READ || cmd == FE_GET_EVENT || > > - cmd == FE_DISEQC_RECV_SLAVE_REPLY)) > > + cmd == FE_DISEQC_RECV_SLAVE_REPLY)) { > > + up(&fepriv->sem); > > return -EPERM; > > - > > - if (down_interruptible (&fepriv->sem)) > > - return -ERESTARTSYS; > > + } > > > > if ((cmd == FE_SET_PROPERTY) || (cmd == FE_GET_PROPERTY)) > > err = dvb_frontend_ioctl_properties(file, cmd, parg); > > Why are the media developers not taking this patch into the repo? I'm not sure but maybe they are still not 100% convinced it doesn't have unwanted side effects or something like that? Or they are just reluctant to change such an important piece of code? But I'm mostly guessing there, for us at least the patch works... Juergen