emulators/rtc with other apps other than Linux apps?
Mike Johnson
ahze at ahze.net
Thu Feb 26 04:47:18 PST 2004
Hi,
I got rtc working with mplayer and I am wondering if it would be worth
using it instead of usleep? I'm not very familiar with how
emulators/rtc works vs. linux rtc. Is the rtc port as fast and accurate
as linux rtc?
mplayer seems to run really well with 4.9
$ mplayer blah.mpeg
MPlayer 0.92-2.95.4 (C) 2000-2003 MPlayer Team
<-- SNIP -->
Using Linux hardware RTC timing (1024Hz).
I was unable to get rtc to work on 5.2-CURRENT
not only with mplayer but with test.c also
it said /dev/rtc was busy
diff -ruN multimedia/mplayer.orig/Makefile multimedia/mplayer/Makefile
--- multimedia/mplayer.orig/Makefile Thu Feb 26 04:18:00 2004
+++ multimedia/mplayer/Makefile Thu Feb 26 05:59:23 2004
@@ -52,6 +52,7 @@
# Further, the correct instruction set of your processor is normally
# auto-detected, so there is probably no necissity to change them.
#
+#
# WITHOUT_MMX
# default: autodetected
# disables using of mmx code
@@ -74,6 +75,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: autodetected
+# REAL TIME CLOCK support
+#
#
# Feature options:
# These options influence, which libraries mplayer is linked to.
@@ -235,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
@@ -331,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
@@ -552,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 Thu Feb 26 05:37:03
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>
More information about the freebsd-emulation
mailing list