From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Mar 7 19:10:20 2004 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9AF3C16A4CE for ; Sun, 7 Mar 2004 19:10:20 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B23B43D39 for ; Sun, 7 Mar 2004 19:10:20 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i283AHbv036026 for ; Sun, 7 Mar 2004 19:10:17 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i283AHA4036025; Sun, 7 Mar 2004 19:10:17 -0800 (PST) (envelope-from gnats) Resent-Date: Sun, 7 Mar 2004 19:10:17 -0800 (PST) Resent-Message-Id: <200403080310.i283AHA4036025@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, michael johnson Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E73CC16A4CE for ; Sun, 7 Mar 2004 19:02:22 -0800 (PST) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id CAFDE43D41 for ; Sun, 7 Mar 2004 19:02:22 -0800 (PST) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.10/8.12.10) with ESMTP id i2832M72008851 for ; Sun, 7 Mar 2004 19:02:22 -0800 (PST) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.10/8.12.10/Submit) id i2832M0v008850; Sun, 7 Mar 2004 19:02:22 -0800 (PST) (envelope-from nobody) Message-Id: <200403080302.i2832M0v008850@www.freebsd.org> Date: Sun, 7 Mar 2004 19:02:22 -0800 (PST) From: michael johnson To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: ports/63913: [Patch] multimedia/mplayer -- Adds RTC support. X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Mar 2004 03:10:20 -0000 >Number: 63913 >Category: ports >Synopsis: [Patch] multimedia/mplayer -- Adds RTC support. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Mar 07 19:10:17 PST 2004 >Closed-Date: >Last-Modified: >Originator: michael johnson >Release: 5.2-CURRENT && 4.9-STABLE >Organization: >Environment: FreeBSD gentoo.ahze.net 5.2-CURRENT FreeBSD 5.2-CURRENT #37: Tue Mar 2 03:31:46 EST 2004 ahze@gentoo.ahze.net:/usr/obj/usr/src/sys/Gentoo i386 FreeBSD buh.ahze.net 5.2-CURRENT FreeBSD 5.2-CURRENT #12: Sun Mar 7 21:09:21 EST 2004 ahze@buh.ahze.net:/usr/obj/usr/src/sys/BUHo i386 FreeBSD ahze.ahze.net 4.9-STABLE FreeBSD 4.9-STABLE #3: Thu Feb 19 01:37:21 EST 2004 ahze@ahze.ahze.net:/usr/src/sys/compile/COURTNEY i386 >Description: I do alot of video editing and I want/need something more accurate than usleep() so I was playing around with mplayer to see if it was able to support rtc on freebsd using emulators/rtc and I found it was able to do so. I have testing this on FreeBSD 5.2-CURRENT and 4.9-STABLE, my 4.9-STABLE box is a bit slow so I was unable to produce good test results. I found that RTC support cut CPU usage down alot. kern.hz needs to be at least 1024 for this to work well! mplayer Test-1min-7mb.mpeg <--snip--> Using Linux hardware RTC timing (1024Hz). <--snip--> the following is from `top` 30sec~ in to a mpeg2 movie RTC: 755 ahze -84 0 31708K 14204K rtc rd 0:01 3.12% 3.12% mplayer USLEEP: 759 ahze 8 0 31724K 14460K nanslp 0:02 11.72% 11.72% mplayer this is just one example. I've done a few more with positive results from rtc. -- I commented out auto detection for RTC because I feel this needs more testing. >How-To-Repeat: diff -ruN multimedia/mplayer.orig/Makefile multimedia/mplayer/Makefile --- multimedia/mplayer.orig/Makefile Sun Mar 7 21:32:34 2004 +++ multimedia/mplayer/Makefile Sun Mar 7 21:35:14 2004 @@ -74,6 +74,10 @@ # kernel config. This is standard for 5.x systems on I686_CPU and above. # 4.x users will have to define this explicitly. # +# WITH_RTC +# default: undefined +# REAL TIME CLOCK support +# # # Feature options: # These options influence, which libraries mplayer is linked to. @@ -236,6 +240,10 @@ .include +#.if exists(${LOCALBASE}/modules/rtc.ko) +#WITH_RTC= yes +#.endif + .if exists(${LOCALBASE}/lib/libartsc.so.0) WITH_ARTS= yes .endif @@ -332,6 +340,14 @@ PLIST_SUB+= GMPLAYER="@comment " .endif +.if defined(WITH_RTC) +BUILD_DEPENDS+= ${LOCALBASE}/modules/rtc.ko:${PORTSDIR}/emulators/rtc +RUN_DEPENDS+= ${LOCALBASE}/modules/rtc.ko:${PORTSDIR}/emulators/rtc +EXTRA_PATCHES= ${PATCHDIR}/rtc-configure-patch +CONFIGURE_ARGS+= --enable-rtc +CONFIGURE_ENV+= CFLAGS+="-I/${LOCALBASE}/include" +.endif + .if defined(WITH_GUI) USE_GNOME+= gtk12 RUN_DEPENDS+= ${LOCALBASE}/share/mplayer/Skin:${PORTSDIR}/multimedia/mplayer-skins @@ -553,6 +569,21 @@ ${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT} @${REINPLACE_CMD} -Ee 's#-pthread|-lc_r#${PTHREAD_LIBS}#g' \ ${WRKSRC}/configure +.if defined(WITH_RTC) + @${REINPLACE_CMD} -e \ + 's|||' \ + ${WRKSRC}/configure \ + ${WRKSRC}/mplayer.c + @${REINPLACE_CMD} -e \ + 's|RTC_IRQP_SET|RTCIO_IRQP_SET|' \ + ${WRKSRC}/mplayer.c + @${REINPLACE_CMD} -e \ + 's|RTC_PIE_ON|RTCIO_PIE_ON|' \ + ${WRKSRC}/mplayer.c + @${REINPLACE_CMD} -e \ + 's|rtc_fd|rtc|' \ + ${WRKSRC}/mplayer.c +.endif pre-configure: .if defined(WITH_LIBDVDREAD) diff -ruN multimedia/mplayer.orig/files/rtc-configure-patch multimedia/mplayer/files/rtc-configure-patch --- multimedia/mplayer.orig/files/rtc-configure-patch Wed Dec 31 19:00:00 1969 +++ multimedia/mplayer/files/rtc-configure-patch Sun Mar 7 21:32:55 2004 @@ -0,0 +1,11 @@ +--- configure.orig Thu Feb 26 04:13:03 2004 ++++ configure Thu Feb 26 04:12:22 2004 +@@ -3781,7 +3781,7 @@ + + + echocheck "RTC" +-if linux ; then ++if freebsd ; then + if test "$_rtc" = auto ; then + cat > $TMPC << EOF + #include >Fix: >Release-Note: >Audit-Trail: >Unformatted: