Date: Sat, 17 Jan 1998 18:47:43 +0100 (MET) From: Luigi Rizzo <luigi@labinfo.iet.unipi.it> To: didier@omnix.net (Didier Derny) Cc: witr@rwwa.com, freebsd-hackers@FreeBSD.ORG Subject: Re: Linux rvplayer and not-implemented ioctl Message-ID: <199801171747.SAA22253@labinfo.iet.unipi.it> In-Reply-To: <Pine.BSF.3.96.980115132654.18374A-100000@omnix.net> from "Didier Derny" at Jan 15, 98 01:30:44 pm
next in thread | previous in thread | raw e-mail | index | archive | help
Sorry for jumping in a bit late on the subject... I did some tests mid november with the linux rvplayer 5.0b2 and my audio driver. The(partial) fix for the missing ioctl is already in the misc/ subdirectory of my driver, and I have attached it below (the files are in /sys/i386/linux). It works for me (under 2.2.1 and with my driver) -- no core dumps or system freezes etc. After some discussion with the mpegtv author, who had similar problems of synchronizing audio and video (and a much better solution!), I believe that the Realaudio guys used the wrong ioctl (SNDCTL_DSP_GETOPTR) to trace the amount of data left to play, and possibly also rely on some peculiarity of the OSS implementation. I had to implement a hack in SNDCTL_DSP_GETOPTR (the line marked with XXX below) which fools the application letting it believe that the driver is slightly ahead of what it really is. Otherwise, you don't get smooth video. I forget the details, but if you look in the multimedia archives around mid november you should find some posting on the subject. You can play with the number to add and see which one suits better your needs. Given this is a module, doing tests is not so difficult. Cheers Luigi --- linux.h.orig Tue Dec 3 16:47:28 1996 +++ linux.h Mon Nov 17 00:05:29 1997 @@ -491,6 +491,9 @@ #define LINUX_SNDCTL_DSP_GETOSPACE 0x500C #define LINUX_SNDCTL_DSP_GETISPACE 0x500D #define LINUX_SNDCTL_DSP_NONBLOCK 0x500E +#define LINUX_SNDCTL_DSP_GETCAPS 0x500F +#define LINUX_SNDCTL_DSP_GETIPTR 0x5011 +#define LINUX_SNDCTL_DSP_GETOPTR 0x5012 #define LINUX_SOUND_MIXER_WRITE_VOLUME 0x4d00 #define LINUX_SOUND_MIXER_WRITE_BASS 0x4d01 #define LINUX_SOUND_MIXER_WRITE_TREBLE 0x4d02 --- linux_ioctl.c.orig Sat Nov 9 22:10:15 1996 +++ linux_ioctl.c Mon Nov 17 10:20:14 1997 @@ -691,6 +691,26 @@ args->cmd = SNDCTL_DSP_NONBLOCK; return ioctl(p, (struct ioctl_args *)args, retval); + case LINUX_SNDCTL_DSP_GETCAPS: + args->cmd = SNDCTL_DSP_GETCAPS; + return ioctl(p, (struct ioctl_args *)args, retval); + + case LINUX_SNDCTL_DSP_GETIPTR: + args->cmd = SNDCTL_DSP_GETIPTR; + return ioctl(p, (struct ioctl_args *)args, retval); + + case LINUX_SNDCTL_DSP_GETOPTR: + args->cmd = SNDCTL_DSP_GETOPTR; + { int a= ioctl(p, (struct ioctl_args *)args, retval); + struct count_info *p = (struct count_info *)(args->arg); + p->bytes += 512 ; /* XXX */ +#if 1 + uprintf("GETOPTR bytes %d blk %d ptr %d\n", + p->bytes, p->blocks, p->ptr); +#endif + return a; + } + case LINUX_SOUND_MIXER_WRITE_VOLUME: args->cmd = SOUND_MIXER_WRITE_VOLUME; return ioctl(p, (struct ioctl_args *)args, retval); -----------------------------+-------------------------------------- Luigi Rizzo | Dip. di Ingegneria dell'Informazione email: luigi@iet.unipi.it | Universita' di Pisa tel: +39-50-568533 | via Diotisalvi 2, 56126 PISA (Italy) fax: +39-50-568522 | http://www.iet.unipi.it/~luigi/ _____________________________|______________________________________
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801171747.SAA22253>