public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] More ioctls for VIA sound driver, Flash 5 now fixed
@ 2001-10-27  1:49 Pavel Roskin
  2001-10-27  6:30 ` Jeff Garzik
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Roskin @ 2001-10-27  1:49 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jeff Garzik

Hello!

Flash plugin version 5 refuses to work with the VIA 82Cxxx driver.  It
turns out that Flash uses SNDCTL_DSP_NONBLOCK on /dev/dsp, which is not
supported by the driver.

I also looked what other ioctls can be implemented easily on VIA 82Cxxx.  
There is another one - SNDCTL_DSP_GETTRIGGER.  Everything else is not 
trivial, sorry.

This patch add support for SNDCTL_DSP_NONBLOCK and SNDCTL_DSP_GETTRIGGER.
It can be found at http://www.red-bean.com/~proski/linux/via-ioctl.diff

Flash 5 plugin plays just fine after applying the patch (check e.g.  
http://wcrb.com/sparks.html)

The patch is against 2.4.13-ac2.

----------------------------------------
--- linux.orig/drivers/sound/via82cxxx_audio.c
+++ linux/drivers/sound/via82cxxx_audio.c
@@ -2800,6 +2800,11 @@ static int via_dsp_ioctl (struct inode *
 		rc = 0;
 		break;
 
+	case SNDCTL_DSP_NONBLOCK:
+		file->f_flags |= O_NONBLOCK;
+		rc = 0;
+		break;
+
 	/* obtain bitmask of device capabilities, such as mmap, full duplex, etc. */
 	case SNDCTL_DSP_GETCAPS:
 		DPRINTK ("DSP_GETCAPS\n");
@@ -2898,6 +2903,15 @@ static int via_dsp_ioctl (struct inode *
 		if (!rc && wr)
 			rc = via_dsp_ioctl_trigger (&card->ch_out, val);
 
+		break;
+
+	case SNDCTL_DSP_GETTRIGGER:
+		val = 0;
+		if ((file->f_mode & FMODE_READ) && card->ch_in.is_enabled)
+			val |= PCM_ENABLE_INPUT;
+		if ((file->f_mode & FMODE_WRITE) && card->ch_out.is_enabled)
+			val |= PCM_ENABLE_OUTPUT;
+		rc = put_user(val, (int *)arg);
 		break;
 
 	/* Enable full duplex.  Since we do this as soon as we are opened
----------------------------------------

Thanks for applying my previous patches.

P.S. Loading and unloading the driver with CONFIG_SOUND_VIA82CXXX_PROCFS
enabled blocks something in the kernel (no new process can be run).  The 
kernel prints:

de_put: deferred delete of 0
de_put: deferred delete of via

Just be aware that it can happen and that it's not related to my ioctl 
patch.  If I fix it, I'll post a separate patch.

-- 
Regards,
Pavel Roskin


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-10-27  8:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-27  1:49 [PATCH] More ioctls for VIA sound driver, Flash 5 now fixed Pavel Roskin
2001-10-27  6:30 ` Jeff Garzik
2001-10-27  7:32   ` Pavel Roskin
2001-10-27  8:03     ` Jeff Garzik
2001-10-27  8:08       ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox