From owner-freebsd-emulation@FreeBSD.ORG Thu Feb 26 04:47:18 2004 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6267A16A4CE for ; Thu, 26 Feb 2004 04:47:18 -0800 (PST) Received: from ahze.ahze.net (adsl-068-209-163-003.sip.clt.bellsouth.net [68.209.163.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2108743D1F for ; Thu, 26 Feb 2004 04:47:18 -0800 (PST) (envelope-from ahze@ahze.net) Received: from [192.168.1.5] (eamc.ahze.net [192.168.1.5]) by ahze.ahze.net (Postfix) with ESMTP id 6FD134BA; Thu, 26 Feb 2004 07:48:54 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v613) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Mike Johnson Date: Thu, 26 Feb 2004 07:47:10 -0500 To: freebsd-emulation@FreeBSD.org X-Mailer: Apple Mail (2.613) cc: mike johnson Subject: emulators/rtc with other apps other than Linux apps? X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Feb 2004 12:47:18 -0000 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 +.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|||' \ + ${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