diff options
author | Ricardo Cerqueira <devnull@localhost> | 2005-12-24 03:21:00 +0000 |
---|---|---|
committer | Ricardo Cerqueira <devnull@localhost> | 2005-12-24 03:21:00 +0000 |
commit | e6ed02bf55e2dc42ac473e97601a4c19973fc492 (patch) | |
tree | 493b2b7c83e12639cc79b1653cc3dd709a739033 /linux/drivers/media/video/cx88/cx88-alsa.c | |
parent | 38cb3aea677c74a8d491fa7fe1d506e8586128df (diff) | |
download | mediapointer-dvb-s2-e6ed02bf55e2dc42ac473e97601a4c19973fc492.tar.gz mediapointer-dvb-s2-e6ed02bf55e2dc42ac473e97601a4c19973fc492.tar.bz2 |
More changes to cx88-alsa buffers
From: Ricardo Cerqueira <v4l@cerqueira.org>
the videobuf sequence now looks complete. Still no IRQ activity, though.
Signed-off-by:
Diffstat (limited to 'linux/drivers/media/video/cx88/cx88-alsa.c')
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-alsa.c | 58 |
1 files changed, 35 insertions, 23 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-alsa.c b/linux/drivers/media/video/cx88/cx88-alsa.c index d361d470b..f0bb1b0b5 100644 --- a/linux/drivers/media/video/cx88/cx88-alsa.c +++ b/linux/drivers/media/video/cx88/cx88-alsa.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-alsa.c,v 1.18 2005/12/14 18:16:39 mchehab Exp $ + * $Id: cx88-alsa.c,v 1.19 2005/12/24 03:21:00 rmcc Exp $ * * Support for audio capture * PCI function #1 of the cx2388x. @@ -229,7 +229,7 @@ static void cx8801_timeout(unsigned long data) dprintk(0, "cx88_alsa: %s\n",__FUNCTION__); if (debug) - cx88_sram_channel_dump(chip->core, &cx88_sram_channels[SRAM_CH26]); + cx88_sram_channel_dump(chip->core, &cx88_sram_channels[SRAM_CH25]); _cx88_stop_audio_dma(chip); #if 0 do_cancel_buffers(dev,"timeout",1); @@ -276,7 +276,7 @@ static void cx8801_aud_irq(snd_cx88_card_t *chip) #if 0 /* FIXME: anything else? */ cx_clear(VID_CAPTURE_CONTROL, 0x06); #endif - cx88_sram_channel_dump(core, &cx88_sram_channels[SRAM_CH21]); + cx88_sram_channel_dump(core, &cx88_sram_channels[SRAM_CH25]); } /* risc1 downstream */ @@ -304,15 +304,15 @@ static irqreturn_t cx8801_irq(int irq, void *dev_id, struct pt_regs *regs) status = cx_read(MO_PCI_INTSTAT) & (core->pci_irqmask | 0x02); if (0 == status) goto out; - dprintk( 1, "cx8801_irq\n" ); - dprintk( 1, " loop: %d/%d\n", loop, MAX_IRQ_LOOP ); - dprintk( 1, " status: %d\n", status ); + dprintk( 3, "cx8801_irq\n" ); + dprintk( 3, " loop: %d/%d\n", loop, MAX_IRQ_LOOP ); + dprintk( 3, " status: %d\n", status ); handled = 1; cx_write(MO_PCI_INTSTAT, status); if (status & core->pci_irqmask) { - dprintk( 1, " passing to core\n" ); + dprintk( 3, " passing to core\n" ); cx88_core_irq(core,status); } if (status & 0x02) @@ -445,6 +445,9 @@ buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb) /* add jump to stopper */ buf->risc.jmp[0] = cpu_to_le32(RISC_JUMP | RISC_IRQ1 | RISC_CNT_INC); buf->risc.jmp[1] = cpu_to_le32(q->stopper.dma); + if (!buf->bpl && chip->period_size) + buf->bpl = chip->period_size; + if (!list_empty(&q->queued)) { list_add_tail(&buf->vb.queue,&q->queued); @@ -499,9 +502,10 @@ static struct videobuf_queue_ops audio_qops = { static int dsp_buffer_init(snd_cx88_card_t *chip) { - int err; + int err = 0; struct cx8801_fh *fh; struct v4l2_requestbuffers req; + int deb; BUG_ON(!chip->dma_size); @@ -511,6 +515,7 @@ static int dsp_buffer_init(snd_cx88_card_t *chip) return -ENOMEM; memset(fh,0,sizeof(*fh)); fh->dev = chip; + fh->size = chip->dma_size; dprintk(1,"queue init\n"); videobuf_queue_init(&fh->vb_q, &audio_qops, @@ -521,13 +526,13 @@ static int dsp_buffer_init(snd_cx88_card_t *chip) fh); chip->fh=fh; - dprintk(1,"queue read start\n"); - videobuf_read_start(&fh->vb_q); - dprintk(1,"dma init\n"); + //dprintk(1,"dma init kernel\n"); + //err = videobuf_dma_init_kernel(&chip->dma, PCI_DMA_FROMDEVICE, + // (chip->dma_size + PAGE_SIZE) >> PAGE_SHIFT); + dprintk(1,"queue read start (coming from %d)\n",err); + deb = videobuf_read_start(&fh->vb_q); + dprintk(1,"dma init (coming from %d)\n",deb); videobuf_dma_init(&chip->dma); - dprintk(1,"dma init kernel\n"); - err = videobuf_dma_init_kernel(&chip->dma, PCI_DMA_FROMDEVICE, - (chip->dma_size + PAGE_SIZE) >> PAGE_SHIFT); if (0 != err) return err; @@ -539,6 +544,9 @@ static int dsp_buffer_init(snd_cx88_card_t *chip) dprintk(1,"request bufers\n"); videobuf_reqbufs(&fh->vb_q, &req); +// dprintk(1,"prepare bufers\n"); +// videobuf_qbuf(&fh->vb_q, &req); + dprintk(1,"start stream\n"); err=videobuf_streamon(&fh->vb_q); @@ -655,6 +663,7 @@ static int snd_cx88_hw_params(snd_pcm_substream_t * substream, int err; snd_cx88_card_t *chip = snd_pcm_substream_chip(substream); + printk("ALSA HW_params\n"); chip->period_size = params_period_bytes(hw_params); chip->dma_size = chip->period_size * params_periods(hw_params); @@ -688,12 +697,14 @@ static int snd_cx88_hw_free(snd_pcm_substream_t * substream) static int snd_cx88_prepare(snd_pcm_substream_t *substream) { snd_cx88_card_t *chip = snd_pcm_substream_chip(substream); + struct cx88_core *core=chip->core; - spin_lock_irq(&chip->reg_lock); + printk("ALSA Prepare\n"); + //spin_lock_irq(&chip->reg_lock); //err = dsp_buffer_init(chip); - spin_unlock_irq(&chip->reg_lock); +// spin_unlock_irq(&chip->reg_lock); return 0; } @@ -712,17 +723,18 @@ static int snd_cx88_card_trigger(snd_pcm_substream_t *substream, int cmd) switch (cmd) { case SNDRV_PCM_TRIGGER_START: - err=videobuf_streamon(&fh->vb_q); -// err=_cx88_start_audio_dma(chip); + //err=videobuf_streamon(&fh->vb_q); + //err=_cx88_start_audio_dma(chip); case SNDRV_PCM_TRIGGER_STOP: - err=videobuf_streamoff(&fh->vb_q); -// err=_cx88_stop_audio_dma(chip); + // err=videobuf_streamoff(&fh->vb_q); + //err=_cx88_stop_audio_dma(chip); default: err=-EINVAL; } spin_unlock(&chip->reg_lock); + return 0; return err; } @@ -1122,7 +1134,7 @@ static void __devexit cx88_audio_finidev(struct pci_dev *pci) struct cx88_audio_dev *card = pci_get_drvdata(pci); struct cx88_core *core = card->core; - _cx88_stop_audio_dma(card); + //_cx88_stop_audio_dma(card); // pci_disable_device(pci); @@ -1132,8 +1144,8 @@ static void __devexit cx88_audio_finidev(struct pci_dev *pci) /* free memory */ - btcx_riscmem_free(card->pci,&card->q.stopper); - cx88_core_put(core,card->pci); +// btcx_riscmem_free(card->pci,&card->q.stopper); + //cx88_core_put(core,card->pci); snd_card_free((void *)card); |