ports/63913: [Patch] multimedia/mplayer -- Adds RTC support.
michael johnson
ahze at ahze.net
Mon Mar 8 03:10:20 UTC 2004
>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 at 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 at 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 at 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 <bsd.port.pre.mk>
+#.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|<linux/rtc.h>|<rtc.h>|' \
+ ${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 <sys/ioctl.h>
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list