[MPlayer-users] Access to RTC

Dominik Mierzejewski dominik at rangers.eu.org
Thu May 9 00:31:01 CEST 2002


On Wednesday, 08 May 2002, Horváth István wrote:
> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> > When mplayer starts it gives this error:
> >
> > Linux RTC init error in ioctl (rtc_pie_on): Permission denied
> > Using usleep() timing
> >
> > I do have permission to access /dev/rtc and I get the same error running
> > as root anyway. Does it matter, and if so is there a cure?
> 
> it is beacause probably you are not root, so mplayer tries to use 1024 hz
> rtc, but if you see in the /usr/src/linux/drivers/char/rtc.c, there is you
> will see something like this:
>  /*
>                  * We don't really want Joe User enabling more
>                  * than 64Hz of interrupts on a multi-user machine.
>                  */
>                 if ((rtc_freq > 64) && (!capable(CAP_SYS_RESOURCE)))
>                         return -EACCES;
> 
> 
> so the kernel let only max 64hz rtc for a single user, you need to change
> 64 to 1024, and it will work correctly(of course after a kernel
> recompile!)
> 
> but it was on the mailing list before!!! or you only need to switch to
> root!

This has changed as of 2.4.19-pre8. Now you can change the max user
frequency at runtime via sysctl:
echo 1024 > /proc/sys/dev/rtc/max-user-freq
and the relevant portion of rtc.c looks like this:
[...]
                /*
                 * We don't really want Joe User enabling more
                 * than 64Hz of interrupts on a multi-user machine.
                 */
                if ((rtc_freq > rtc_max_user_freq) &&
                    (!capable(CAP_SYS_RESOURCE)))
                        return -EACCES;
[...]

HTH :-)

-- 
"The Universe doesn't give you any points for doing things that are easy."
        -- Sheridan to Garibaldi in Babylon 5:"The Geometry of Shadows"
Dominik 'Rathann' Mierzejewski <rathann(at)rangers.eu.org>




More information about the MPlayer-users mailing list