From owner-freebsd-multimedia@FreeBSD.ORG Fri Dec 22 13:01:14 2006 Return-Path: X-Original-To: multimedia@freebsd.org Delivered-To: freebsd-multimedia@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 149D616A4D8 for ; Fri, 22 Dec 2006 13:01:14 +0000 (UTC) (envelope-from usleepless@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.242]) by mx1.freebsd.org (Postfix) with ESMTP id 71BF213C45C for ; Fri, 22 Dec 2006 13:01:13 +0000 (UTC) (envelope-from usleepless@gmail.com) Received: by an-out-0708.google.com with SMTP id c24so811970ana for ; Fri, 22 Dec 2006 05:01:12 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=B0lfydJo4aLzDdNvW/V0rk8p6aTXLs4ygrY6Pj7S1e+IYXrsK8MnqvAjPfatT9QpwzUhN44pUzupETl/KsXxZHqI8FuKYILY/ynY03oSL76LVE7nWRXuFTmQw0D0aFG2B/iOGntnYIJftUVzAiHVWejBt6tOaR6IDT0TYDQDFro= Received: by 10.78.139.1 with SMTP id m1mr240136hud.1166792471533; Fri, 22 Dec 2006 05:01:11 -0800 (PST) Received: by 10.78.124.8 with HTTP; Fri, 22 Dec 2006 05:01:11 -0800 (PST) Message-ID: Date: Fri, 22 Dec 2006 14:01:11 +0100 From: usleepless@gmail.com To: "John-Mark Gurney" , usleepless@gmail.com, "Greg 'groggy' Lehey" , "Stephen Hocking" , multimedia@freebsd.org In-Reply-To: <20061222014304.GB4982@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <6300771b0612181401i72e7cc58ta08e12de8d68d4d0@mail.gmail.com> <6300771b0612181533m6ece3f38p379c78a75912d10d@mail.gmail.com> <6300771b0612181534h3158342aw554869660fc707ea@mail.gmail.com> <20061218234041.GU4364@wantadilla.lemis.com> <20061219224005.GC4364@wantadilla.lemis.com> <20061220000049.GF4364@wantadilla.lemis.com> <20061222014304.GB4982@funkthat.com> Cc: Subject: Re: MythTV and PVR500 (was: Possible FreeBSD port?) 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: Fri, 22 Dec 2006 13:01:14 -0000 John, List, On 12/22/06, John-Mark Gurney wrote: > usleepless@gmail.com wrote this message on Wed, Dec 20, 2006 at 22:40 +0100: > > because i am still running on a 4.11 server, the mythbackend needed to > > run on 4.11. i soon discovered that mythtv had strange ipc, so i > > compiled it against linux-threads ( had to rebuild QT with > > linux-threads as well ). i remember it helped a little, but not > > enough. > > > > i stumbled upon all the busy-wait-loops: > > > > " > > while(!condition) > > usleep(50); > > " > > > > this is probably the reason why i needed linux-threads. but there is a > > catch: linux-usleep guarantees a context-switch, while freebsd doesn't > > ( didn't ? ). > > > > my first solution was to redefine usleep in mythcontext.h, to force a > > context-switch. this produced a working mythtv-install. later on, i > > removed all busy-wait-loops because they are just plain stupid. > > Why not use sched_yield(2)? I forget if it's in 4.x, but I'm pretty > sure just yield is in 4.x... That will force a context switch... in the end i did. i tried a couple of different redefines of usleep combined with sched_yield, pthread_yield, the qt-variant etc. i don't remember exactly which i used in the end, but i can look it up if it becomes relevant. while redefining usleep, i started logging all usleep's ( which are also context-switches ). the amount of usleeps was so mind-boggling i decided to try to get rid of most of them. some i replaced with QWaitConditions, other i eliminated by changing a module to an event-driven model instead of .... welll.... i don't know how to call it. microprocessor-c-style might be the closest i can think of ( think PIC/atmel style c-code ) anyways, i am very happy that a discussion is going on about fbsd-mm, mythtv and how to get on par mm-wise with other systems. i hope things "spin up" in the sense that if we have a "just works" mythtv-port, someone somewhere will decide "now is the time for adding dvb or whatever". although i am sticking to my own 0.18-fixes-postgresql-usleepless-mythtv for the moment, in the end the best thing for me would be to run the standard mythtv-port tool and participate in the normal upgrade cycle. but because of personal wackyness i refuse to install mysql. i am willing to spend some time on this, for example with my experience with compiling v4l2 stuff for freebsd, i would be happy to extend the bktr driver to do the same. but it would like to be paired up with a buddy who is actually using bktr-cards who can test and debug a little as well. any takers? for example, we could define relatively small goals: make the bktr-driver run with mplayer through v4l2 or make the bktr-driver run with a linux-tv-viewing app which is currently not supported ( kdetv? ). just implement the minimal subset to make it work, and from there take on another app and eventually mythtv. let's feed this thread, keep it alive. regards, usleep