lkml.org 
[lkml]   [2001]   [Dec]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] TEST of patch proposed for i810 audio
Nathan Bryant wrote:

>
> maybe this patch will solve your problem, samir, maybe it won't;
> regardless, it should fix at least one corner case and is either
> obviously correct or start_*c is not ;-)
>
> patch is against doug's 0.12.

[snip]

attached is a slightly more anal retentive version of my previous patch.
as in the previous patch, the goal is to make update_lvi completely
self-contained, ie resistant to changes in higher-level code, ie not
deadlock even if somebody really sets it up with bad state, also
eliminates one if/then/else thinko in 0.12 that could theoretically
cause dac to be started when you're trying to record, which would cause
a deadlock.
--- i810_audio.c.12 Wed Dec 19 02:04:06 2001
+++ linux/drivers/sound/i810_audio.c Wed Dec 26 18:22:37 2001
@@ -952,12 +952,16 @@
* the CIV value to the next sg segment to be played so that when
* we call start_{dac,adc}, things will operate properly
*/
- if (!dmabuf->enable && dmabuf->trigger) {
- if(rec && dmabuf->count != dmabuf->dmasize) {
+ if (!dmabuf->enable && dmabuf->ready) {
+ if(rec && dmabuf->count < dmabuf->dmasize &&
+ (dmabuf->trigger & PCM_ENABLE_INPUT))
+ {
outb((inb(port+OFF_CIV)+1)&31, port+OFF_LVI);
__start_adc(state);
while( !(inb(port + OFF_CR) & ((1<<4) | (1<<2))) ) ;
- } else if(dmabuf->count) {
+ } else if (!rec && dmabuf->count &&
+ (dmabuf->trigger & PCM_ENABLE_OUTPUT))
+ {
outb((inb(port+OFF_CIV)+1)&31, port+OFF_LVI);
__start_dac(state);
while( !(inb(port + OFF_CR) & ((1<<4) | (1<<2))) ) ;
\
 
 \ /
  Last update: 2005-03-22 13:14    [W:0.066 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site