Messages in this thread Patch in this message | | | Date | Tue, 04 Dec 2001 23:25:48 -0500 | From | Doug Ledford <> | Subject | Re: i810 audio patch |
| |
Nathan Bryant wrote:
> Doug Ledford wrote: > >> Two questions: >> >> 1) This is a timeout on close. Does it work up until then? > > > no - no audible output. (quake doesn't use SNDCTL_DSP_SYNC anywhere > either so it would have to be on close) > >> >> >> 2) Does the attached patch (against the 0.08 driver) help? > > > No - timeout printk still occurs >
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...
--
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 --- i810_audio.c.08b Tue Dec 4 22:04:05 2001 +++ i810_audio.c.08c Tue Dec 4 23:24:16 2001 @@ -2005,7 +2005,7 @@ stop_dac(state); } dmabuf->trigger = val; - if(val & PCM_ENABLE_OUTPUT) { + if(val & PCM_ENABLE_OUTPUT && !(dmabuf->enable & DAC_RUNNING)) { if (!dmabuf->write_channel) { dmabuf->ready = 0; dmabuf->write_channel = state->card->alloc_pcm_channel(state->card); @@ -2017,15 +2017,18 @@ if (dmabuf->mapped) { spin_lock_irqsave(&state->card->lock, flags); i810_update_ptr(state); + resync_dma_ptrs(state,0); dmabuf->count = 0; dmabuf->count = i810_get_free_write_space(state); + dmabuf->swptr = (dmabuf->swptr + dmabuf->count) % dmabuf->dmasize; __i810_update_lvi(state, 0); spin_unlock_irqrestore(&state->card->lock, flags); } - if (!dmabuf->enable && dmabuf->count > dmabuf->userfragsize) + if (dmabuf->count > dmabuf->userfragsize || + dmabuf->mapped) start_dac(state); } - if(val & PCM_ENABLE_INPUT) { + if(val & PCM_ENABLE_INPUT && !(dmabuf->enable & ADC_RUNNING)) { if (!dmabuf->read_channel) { dmabuf->ready = 0; dmabuf->read_channel = state->card->alloc_rec_pcm_channel(state->card); @@ -2034,9 +2037,15 @@ } if (!dmabuf->ready && (ret = prog_dmabuf(state, 1))) return ret; - if (!dmabuf->enable && dmabuf->count < - (dmabuf->dmasize - dmabuf->userfragsize)) - start_adc(state); + if (dmabuf->mapped) { + spin_lock_irqsave(&state->card->lock, flags); + i810_update_ptr(state); + resync_dma_ptrs(state,0); + dmabuf->count = 0; + spin_unlock_irqrestore(&state->card->lock, flags); + } + i810_update_lvi(state, 1); + start_adc(state); } return 0; | |