From owner-freebsd-emulation@FreeBSD.ORG Wed Oct 1 17:08:23 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1169310656A4 for ; Wed, 1 Oct 2008 17:08:23 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id 9E60C8FC26 for ; Wed, 1 Oct 2008 17:08:22 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id DC41B1FD89C; Wed, 1 Oct 2008 21:08:20 +0400 (MSD) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from dchagin.dialup.corbina.ru ([78.107.232.239] verified) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1249036330; Wed, 01 Oct 2008 21:08:20 +0400 Received: from dchagin.dialup.corbina.ru (localhost.chd.net [127.0.0.1]) by dchagin.dialup.corbina.ru (8.14.3/8.14.2) with ESMTP id m91H8KWi005981; Wed, 1 Oct 2008 21:08:20 +0400 (MSD) (envelope-from root@dchagin.dialup.corbina.ru) Received: (from root@localhost) by dchagin.dialup.corbina.ru (8.14.3/8.14.2/Submit) id m91H8ELk005980; Wed, 1 Oct 2008 21:08:14 +0400 (MSD) (envelope-from root) Date: Wed, 1 Oct 2008 21:08:14 +0400 From: Chagin Dmitry To: Tijl Coosemans Message-ID: <20081001170814.GA5962@dchagin.dialup.corbina.ru> References: <200810011852.45247.tijl@ulyssis.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200810011852.45247.tijl@ulyssis.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-emulation@freebsd.org Subject: Re: firefox & flash9 patches X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 01 Oct 2008 17:08:23 -0000 On Wed, Oct 01, 2008 at 06:52:37PM +0200, Tijl Coosemans wrote: > On Monday 29 September 2008 22:02:37 Chagin Dmitry wrote: > > please, test following patches (just -current). > > with them firefox && flash9 forks for me, > > I tested only on ia32@amd64 with 2.6.16 enabled, > > firefox 2.0.0.16 and flash9 plugin. > > > > If all is good, I will ask des@ and kib@ to review&commit them. thnx! > > On 7.1-PRERELEASE, linux 2.4, fc4, the linprocfs patch seems to improve > things a lot. I'm still having crashes from time to time, but overall > flash9 works much better. Great work! > second half of my patch (fooaffinity() related) can't be applied on RELENG_7, I will prepare a patch for RELENG_7, will test? > I've attached the patch for RELENG_7 (patch-linprocfs) and another > patch for libflashsupport [1]. It should improve OSS support, A/V sync > etc. For those without a linux box, I've attached a compiled version of > the lib as well. You can drop it in /compat/linux/usr/lib. > > [1] http://sourceforge.net/projects/flashsupport/ > --- linprocfs.c.orig 2008-10-01 17:47:51.000000000 +0200 > +++ linprocfs.c 2008-10-01 17:49:02.000000000 +0200 > @@ -869,14 +869,12 @@ > static int > linprocfs_doprocmaps(PFS_FILL_ARGS) > { > - char mebuffer[512]; > vm_map_t map = &p->p_vmspace->vm_map; > vm_map_entry_t entry, tmp_entry; > vm_object_t obj, tobj, lobj; > vm_offset_t saved_end; > vm_ooffset_t off = 0; > char *name = "", *freename = NULL; > - size_t len; > ino_t ino; > unsigned int last_timestamp; > int ref_count, shadow_count, flags; > @@ -894,13 +892,9 @@ > if (uio->uio_rw != UIO_READ) > return (EOPNOTSUPP); > > - if (uio->uio_offset != 0) > - return (0); > - > error = 0; > vm_map_lock_read(map); > - for (entry = map->header.next; > - ((uio->uio_resid > 0) && (entry != &map->header)); > + for (entry = map->header.next; entry != &map->header; > entry = entry->next) { > name = ""; > freename = NULL; > @@ -949,7 +943,7 @@ > * format: > * start, end, access, offset, major, minor, inode, name. > */ > - snprintf(mebuffer, sizeof mebuffer, > + error = sbuf_printf(sb, > "%08lx-%08lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n", > (u_long)entry->start, (u_long)entry->end, > (entry->protection & VM_PROT_READ)?"r":"-", > @@ -965,18 +959,11 @@ > ); > if (freename) > free(freename, M_TEMP); > - len = strlen(mebuffer); > - if (len > uio->uio_resid) > - len = uio->uio_resid; /* > - * XXX We should probably return > - * EFBIG here, as in procfs. > - */ > last_timestamp = map->timestamp; > vm_map_unlock_read(map); > - error = uiomove(mebuffer, len, uio); > + if (error == -1) > + return (0); > vm_map_lock_read(map); > - if (error) > - break; > if (last_timestamp + 1 != map->timestamp) { > /* > * Look again for the entry because the map was > --- flashsupport.c.orig 2008-10-01 16:25:02.000000000 +0200 > +++ flashsupport.c 2008-10-01 16:57:58.000000000 +0200 > @@ -44,11 +44,11 @@ > #endif // HAVE_ALSA_ASOUNDLIB_H > > #ifdef HAVE_LINUX_SOUNDCARD_H > -//#define OSS > +#define OSS > #endif // HAVE_LINUX_SOUNDCARD_H > > #ifdef HAVE_LINUX_VIDEODEV_H > -#define V4L1 > +//#define V4L1 > #endif // HAVE_LINUX_VIDEODEV_H > > //////////////////////////////////////////////////////////////////////////////////////////////////// > @@ -736,28 +736,23 @@ > int oss_fd; > pthread_t thread; > int signal; > + char * buf; > + int bsize; > }; > > static void *oss_thread(void *ptr) > { > struct SoundOutput_Instance *instance = (struct SoundOutput_Instance *)ptr; > - char buffer[4096]; > - int len = 0; > int written = 0; > + usleep(100); > for(;;) { > - FPI_SoundOutput_FillBuffer(ptr,buffer,4096); > - len = 4096; > - while ( len ) { > - written = write(instance->oss_fd, buffer, len); > - if ( written >= 0 ) { > - len -= written; > - } > - if ( instance->signal ) { > - pthread_exit(0); > - } > - if ( written < 0 ) { > - usleep(100); > - } > + FPI_SoundOutput_FillBuffer(ptr, instance->buf, instance->bsize); > + written = write(instance->oss_fd, instance->buf, instance->bsize); > + if ( instance->signal ) { > + pthread_exit(0); > + } > + if ( written < 0 ) { > + usleep(100); > } > } > } > @@ -784,12 +779,16 @@ > > if ( ioctl(instance->oss_fd, SNDCTL_DSP_SPEED, &speed) < 0 ) goto fail; > > + if ( ioctl(instance->oss_fd, SNDCTL_DSP_GETBLKSIZE, &instance->bsize) < 0 ) goto fail; > + > + instance->buf = (char *)FPI_Mem_Alloc(instance->bsize); > + > if ( pthread_create(&instance->thread, 0, oss_thread, instance) < 0 ) goto fail; > > return instance; > fail: > if ( instance ) { > - if ( FPI_Mem_Free ) FPI_Mem_Free(instance); > + FPX_SoundOutput_Close(instance); > } > return 0; > } > @@ -803,18 +802,19 @@ > > instance->signal = 1; > > - if ( instance->oss_fd ) { > - ioctl(instance->oss_fd, SNDCTL_DSP_RESET, 0); > - } > - > if ( instance->thread ) { > pthread_join(instance->thread,&retVal); > } > > if ( instance->oss_fd ) { > + ioctl(instance->oss_fd, SNDCTL_DSP_RESET, 0); > close(instance->oss_fd); > } > > + if ( instance->buf ) { > + if ( FPI_Mem_Free ) FPI_Mem_Free(instance->buf); > + } > + > if ( FPI_Mem_Free ) FPI_Mem_Free(instance); > > return 0; > @@ -827,10 +827,10 @@ > struct SoundOutput_Instance *instance = (struct SoundOutput_Instance *)ptr; > if ( instance->oss_fd ) { > int value = 0; > - if ( ( value = ioctl(instance->oss_fd,SNDCTL_DSP_GETODELAY,&value) ) == 0 ) { > - return value / 4; > + if ( ioctl(instance->oss_fd,SNDCTL_DSP_GETODELAY,&value) == -1 ) { > + return 0; > } > - return 0; > + return value / 4; > } > return -1; > } I don't have soundcard, so I can't test it :) thnx! -- Have fun! chd