public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Doug Ledford <dledford@redhat.com>
To: Nathan Bryant <nbryant@optonline.net>
Cc: Mario Mikocevic <mozgy@hinet.hr>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: i810 audio patch
Date: Wed, 05 Dec 2001 00:23:01 -0500	[thread overview]
Message-ID: <3C0DAF35.50008@redhat.com> (raw)
In-Reply-To: <3C0C16E7.70206@optonline.net> <3C0C508C.40407@redhat.com> <3C0C58DE.9020703@optonline.net> <3C0C5CB2.6000602@optonline.net> <3C0C61CC.1060703@redhat.com> <20011204153507.A842@danielle.hinet.hr> <3C0D1DD2.4040609@optonline.net> <3C0D223E.3020904@redhat.com> <3C0D350F.9010408@optonline.net> <3C0D3CF7.6030805@redhat.com> <3C0D4E62.4010904@optonline.net> <3C0D52F1.5020800@optonline.net> <3C0D5796.6080202@redhat.com> <3C0D5CB6.1080600@optonline.net> <3C0D5FC7.3040408@redhat.com> <3C0D77D9.70205@optonline.net> <3C0D8B00.2040603@optonline.net> <3C0D8F02.8010408@redhat.com> <3C0D9456.6090106@optonline.net> <3C0DA1CC.1070408@redhat.com> <3C0DAD26.1020906@optonline.net>

[-- Attachment #1: Type: text/plain, Size: 688 bytes --]

Nathan Bryant wrote:

> Doug Ledford wrote:
> 
>> A few more tweaks to the mmap code.  This might actually work.  It 
>> should apply cleanly on top of what you already have.  Let me know if 
>> it enables Quake sound...
> 
> 
> No still silence, and debug output is weirder. (still using only 
> DEBUG_INTERRUPTS)


The attached patch should get me the debugging output I need to solve 
the problem.  If you'll get me the output, then I can likely have a 
working version in short order.




-- 

  Doug Ledford <dledford@redhat.com>  http://people.redhat.com/dledford
       Please check my web site for aic7xxx updates/answers before
                       e-mailing me about problems

[-- Attachment #2: foo3 --]
[-- Type: text/plain, Size: 4500 bytes --]

--- i810_audio.c.08c	Tue Dec  4 23:24:16 2001
+++ i810_audio.c.09	Wed Dec  5 00:19:23 2001
@@ -1,3 +1,4 @@
+
 /*
  *	Intel i810 and friends ICH driver for Linux
  *	Alan Cox <alan@redhat.com>
@@ -111,6 +112,7 @@
 //#define DEBUG
 //#define DEBUG2
 //#define DEBUG_INTERRUPTS
+#define DEBUG_MMAP
 
 #define ADC_RUNNING	1
 #define DAC_RUNNING	2
@@ -197,7 +199,7 @@
 #define INT_MASK (INT_SEC|INT_PRI|INT_MC|INT_PO|INT_PI|INT_MO|INT_NI|INT_GPI)
 
 
-#define DRIVER_VERSION "0.07"
+#define DRIVER_VERSION "0.09"
 
 /* magic numbers to protect our data structures */
 #define I810_CARD_MAGIC		0x5072696E /* "Prin" */
@@ -968,7 +970,7 @@
 	/*
 	 * two special cases, count == 0 on write
 	 * means no data, and count == dmasize
-	 * means no data on read, handle appropriately
+	 * means no data on read, handle appropriately.
 	 */
 	if(!rec && dmabuf->count == 0) {
 		outb(inb(port+OFF_CIV),port+OFF_LVI);
@@ -1008,7 +1010,7 @@
 		/* update hardware pointer */
 		hwptr = i810_get_dma_addr(state, 1);
 		diff = (dmabuf->dmasize + hwptr - dmabuf->hwptr) % dmabuf->dmasize;
-#ifdef DEBUG_INTERRUPTS
+#if defined(DEBUG_INTERRUPTS) || defined(DEBUG_MMAP)
 		printk("ADC HWP %d,%d,%d\n", hwptr, dmabuf->hwptr, diff);
 #endif
 		dmabuf->hwptr = hwptr;
@@ -1033,7 +1035,7 @@
 		/* update hardware pointer */
 		hwptr = i810_get_dma_addr(state, 0);
 		diff = (dmabuf->dmasize + hwptr - dmabuf->hwptr) % dmabuf->dmasize;
-#ifdef DEBUG_INTERRUPTS
+#if defined(DEBUG_INTERRUPTS) || defined(DEBUG_MMAP)
 		printk("DAC HWP %d,%d,%d\n", hwptr, dmabuf->hwptr, diff);
 #endif
 		dmabuf->hwptr = hwptr;
@@ -1168,11 +1170,11 @@
 		if(!state->dmabuf.ready)
 			continue;
 		dmabuf = &state->dmabuf;
-		if(dmabuf->enable & DAC_RUNNING)
+		if(dmabuf->enable & DAC_RUNNING) {
 			c=dmabuf->write_channel;
-		else if(dmabuf->enable & ADC_RUNNING)
+		} else if(dmabuf->enable & ADC_RUNNING) {
 			c=dmabuf->read_channel;
-		else	/* This can occur going from R/W to close */
+		} else	/* This can occur going from R/W to close */
 			continue;
 		
 		port+=c->port;
@@ -1596,7 +1598,7 @@
 	dmabuf->count = 0;
 	dmabuf->trigger = 0;
 	ret = 0;
-#ifdef DEBUG
+#ifdef DEBUG_MMAP
 	printk("i810_audio: mmap'ed %ld bytes of data space\n", size);
 #endif
 out:
@@ -1650,7 +1652,10 @@
 #endif
 		if (dmabuf->enable != DAC_RUNNING || file->f_flags & O_NONBLOCK)
 			return 0;
-		drain_dac(state);
+		if(!dmabuf->mapped)
+			drain_dac(state);
+		else
+			stop_dac(state);
 		dmabuf->ready = 0;
 		dmabuf->swptr = dmabuf->hwptr = 0;
 		dmabuf->count = dmabuf->total_bytes = 0;
@@ -1900,7 +1905,7 @@
  			abinfo.bytes = i810_get_free_write_space(state);
 		abinfo.fragments = abinfo.bytes / dmabuf->userfragsize;
 		spin_unlock_irqrestore(&state->card->lock, flags);
-#ifdef DEBUG
+#if defined(DEBUG) || defined(DEBUG_MMAP)
 		printk("SNDCTL_DSP_GETOSPACE %d, %d, %d, %d\n", abinfo.bytes,
 			abinfo.fragsize, abinfo.fragments, abinfo.fragstotal);
 #endif
@@ -1924,7 +1929,7 @@
 				__start_dac(state);
 		}
 		spin_unlock_irqrestore(&state->card->lock, flags);
-#ifdef DEBUG
+#if defined(DEBUG) || defined(DEBUG_MMAP)
 		printk("SNDCTL_DSP_GETOPTR %d, %d, %d, %d\n", cinfo.bytes,
 			cinfo.blocks, cinfo.ptr, dmabuf->count);
 #endif
@@ -1941,7 +1946,7 @@
 		abinfo.fragstotal = dmabuf->userfrags;
 		abinfo.fragments = abinfo.bytes / dmabuf->userfragsize;
 		spin_unlock_irqrestore(&state->card->lock, flags);
-#ifdef DEBUG
+#if defined(DEBUG) || defined(DEBUG_MMAP)
 		printk("SNDCTL_DSP_GETISPACE %d, %d, %d, %d\n", abinfo.bytes,
 			abinfo.fragsize, abinfo.fragments, abinfo.fragstotal);
 #endif
@@ -1965,7 +1970,7 @@
 				__start_adc(state);
 		}
 		spin_unlock_irqrestore(&state->card->lock, flags);
-#ifdef DEBUG
+#if defined(DEBUG) || defined(DEBUG_MMAP)
 		printk("SNDCTL_DSP_GETIPTR %d, %d, %d, %d\n", cinfo.bytes,
 			cinfo.blocks, cinfo.ptr, dmabuf->count);
 #endif
@@ -1995,7 +2000,7 @@
 	case SNDCTL_DSP_SETTRIGGER:
 		if (get_user(val, (int *)arg))
 			return -EFAULT;
-#ifdef DEBUG
+#if defined(DEBUG) || defined(DEBUG_MMAP)
 		printk("SNDCTL_DSP_SETTRIGGER 0x%x\n", val);
 #endif
 		if( !(val & PCM_ENABLE_INPUT) && dmabuf->enable == ADC_RUNNING) {
@@ -2332,7 +2337,12 @@
 	/* stop DMA state machine and free DMA buffers/channels */
 	if(dmabuf->enable & DAC_RUNNING ||
 	   (dmabuf->count && (dmabuf->trigger & PCM_ENABLE_OUTPUT))) {
-		drain_dac(state);
+		if(!dmabuf->mapped)
+			drain_dac(state);
+		else {
+			stop_dac(state);
+			synchronize_irqs();
+		}
 	}
 	if(dmabuf->enable & ADC_RUNNING) {
 		stop_adc(state);

  reply	other threads:[~2001-12-05  5:23 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-04  0:20 i810 audio patch Nathan Bryant
2001-12-04  4:26 ` Doug Ledford
     [not found]   ` <3C0C58DE.9020703@optonline.net>
2001-12-04  5:18     ` Nathan Bryant
2001-12-04  5:40       ` Doug Ledford
2001-12-04  6:07         ` Nathan Bryant
2001-12-04  7:08         ` Nathan Bryant
2001-12-04 16:46           ` Doug Ledford
2001-12-04 20:14             ` Nathan Bryant
2001-12-04 20:16               ` Doug Ledford
2001-12-04 14:35         ` Mario Mikocevic
2001-12-04 19:02           ` Nathan Bryant
2001-12-04 19:21             ` Doug Ledford
2001-12-04 20:41               ` Nathan Bryant
2001-12-04 21:15                 ` Doug Ledford
2001-12-04 21:39                   ` Nathan Bryant
2001-12-04 21:53                     ` Nathan Bryant
2001-12-04 22:29                   ` Nathan Bryant
2001-12-04 22:49                     ` Nathan Bryant
2001-12-04 23:09                       ` Doug Ledford
2001-12-04 23:31                         ` Nathan Bryant
2001-12-04 23:44                           ` Doug Ledford
2001-12-05  1:26                             ` Nathan Bryant
2001-12-05  2:48                               ` Nathan Bryant
2001-12-05  3:05                                 ` Doug Ledford
2001-12-05  3:28                                   ` Nathan Bryant
2001-12-05  4:25                                     ` Doug Ledford
2001-12-05  5:14                                       ` Nathan Bryant
2001-12-05  5:23                                         ` Doug Ledford [this message]
2001-12-05 20:04                                           ` Nathan Bryant
2001-12-05 20:05                                             ` Nathan Bryant
2001-12-05 20:10                                               ` Doug Ledford
2001-12-05 21:12                                                 ` Nathan Bryant
2001-12-05 21:25                                                   ` Doug Ledford
2001-12-05 21:36                                                     ` Nathan Bryant
2001-12-05 21:56                                                       ` Nathan Bryant
2001-12-05 22:31                                                         ` Doug Ledford
2001-12-05 22:43                                                       ` Doug Ledford
2001-12-05 23:46                                                     ` Nathan Bryant
2001-12-05 23:51                                                       ` Doug Ledford
2001-12-05 23:57                                                       ` Nathan Bryant
2001-12-06  0:25                                                         ` Doug Ledford
2001-12-06  0:50                                                           ` Nathan Bryant
     [not found]                                                           ` <3C0EC0ED.3000603@optonl! ine.net>
2001-12-06  0:55                                                             ` Doug Ledford
     [not found]                                                           ` <3C0EC219.8010107@redhat! .com>
2001-12-06  2:53                                                             ` Nathan Bryant
     [not found]                                                             ` <3C0EDDC2.608@optonl! ine.net>
2001-12-06  3:39                                                               ` Doug Ledford
     [not found]                                                           ` <3C0EC219.8010107@redhat!.com>
     [not found]                                                             ` <3C0EE865.1090607@red! hat.com>
2001-12-06  4:02                                                               ` Nathan Bryant
2001-12-06  4:09                                                                 ` Doug Ledford
2001-12-06 15:45                                                                   ` i810 audio patch (it _works_ for me :) Mario Mikocevic
2001-12-06 17:00                                                                     ` i810 audio patch Pascal Junod
2001-12-05  4:41                                     ` Nathan Bryant
2001-12-05  5:10                                       ` Doug Ledford
2001-12-05  5:35                                         ` Nathan Bryant
2001-12-05  7:24                                         ` Nathan Bryant
2001-12-04 23:05                     ` Doug Ledford
2001-12-04  9:03       ` Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2001-12-06 19:49 Nathan Bryant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3C0DAF35.50008@redhat.com \
    --to=dledford@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mozgy@hinet.hr \
    --cc=nbryant@optonline.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox