summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux/drivers/media/video/cx88/cx88-alsa.c49
-rw-r--r--v4l/ChangeLog9
2 files changed, 46 insertions, 12 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-alsa.c b/linux/drivers/media/video/cx88/cx88-alsa.c
index dc9e66cba..d361d470b 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.17 2005/12/14 16:21:46 mchehab Exp $
+ * $Id: cx88-alsa.c,v 1.18 2005/12/14 18:16:39 mchehab Exp $
*
* Support for audio capture
* PCI function #1 of the cx2388x.
@@ -64,11 +64,19 @@ enum { DEVICE_DIGITAL, DEVICE_ANALOG };
/* These can be replaced after done */
#define MIXER_ADDR_LAST MAX_CX88_INPUT
+struct cx8801_fh {
+ struct cx88_audio_dev *dev;
+ struct videobuf_queue vb_q;
+
+ int size;
+};
struct cx88_audio_dev {
struct cx88_core *core;
struct cx88_dmaqueue q;
+ struct cx8801_fh *fh;
+
/* pci i/o */
struct pci_dev *pci;
unsigned char pci_rev,pci_lat;
@@ -98,13 +106,6 @@ struct cx88_audio_dev {
};
typedef struct cx88_audio_dev snd_cx88_card_t;
-struct cx8801_fh {
- struct cx88_audio_dev *dev;
- struct videobuf_queue vb_q;
-
- int size;
-};
-
typedef struct snd_card_cx88_pcm {
struct cx88_dev *dev;
@@ -500,6 +501,7 @@ static int dsp_buffer_init(snd_cx88_card_t *chip)
{
int err;
struct cx8801_fh *fh;
+ struct v4l2_requestbuffers req;
BUG_ON(!chip->dma_size);
@@ -510,18 +512,36 @@ static int dsp_buffer_init(snd_cx88_card_t *chip)
memset(fh,0,sizeof(*fh));
fh->dev = chip;
+ dprintk(1,"queue init\n");
videobuf_queue_init(&fh->vb_q, &audio_qops,
chip->pci, &chip->reg_lock,
V4L2_BUF_TYPE_VIDEO_CAPTURE,
V4L2_FIELD_INTERLACED,
sizeof(struct cx88_buffer),
fh);
+
+ chip->fh=fh;
+ dprintk(1,"queue read start\n");
videobuf_read_start(&fh->vb_q);
+ dprintk(1,"dma init\n");
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;
+
+ memset(&req,0,sizeof(req));
+ req.type = fh->vb_q.type;
+ req.count = 2;
+ req.memory = V4L2_MEMORY_MMAP;
+
+ dprintk(1,"request bufers\n");
+ videobuf_reqbufs(&fh->vb_q, &req);
+
+ dprintk(1,"start stream\n");
+ err=videobuf_streamon(&fh->vb_q);
+
return 0;
}
@@ -643,10 +663,12 @@ static int snd_cx88_hw_params(snd_pcm_substream_t * substream,
dsp_buffer_init(chip);
+/*
if (0 != (err = videobuf_dma_pci_map(chip->pci, &chip->dma))) {
dsp_buffer_free(chip);
return err;
}
+*/
dprintk(1,"Buffer ready\n");
return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
@@ -682,16 +704,19 @@ static int snd_cx88_prepare(snd_pcm_substream_t *substream)
static int snd_cx88_card_trigger(snd_pcm_substream_t *substream, int cmd)
{
snd_cx88_card_t *chip = snd_pcm_substream_chip(substream);
+ struct cx8801_fh *fh = chip->fh;
int err;
- dprintk(2,"PCM Trigger");
+ dprintk(2,"PCM Trigger cmd=%d\n",cmd);
spin_lock(&chip->reg_lock);
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
+ err=videobuf_streamon(&fh->vb_q);
// err=_cx88_start_audio_dma(chip);
case SNDRV_PCM_TRIGGER_STOP:
- err=_cx88_stop_audio_dma(chip);
+ err=videobuf_streamoff(&fh->vb_q);
+// err=_cx88_stop_audio_dma(chip);
default:
err=-EINVAL;
}
@@ -1099,11 +1124,11 @@ static void __devexit cx88_audio_finidev(struct pci_dev *pci)
_cx88_stop_audio_dma(card);
- pci_disable_device(pci);
+// pci_disable_device(pci);
/* unregister stuff */
- free_irq(pci->irq, card);
+// free_irq(pci->irq, card);
/* free memory */
diff --git a/v4l/ChangeLog b/v4l/ChangeLog
index 6c2111beb..eda29fe1f 100644
--- a/v4l/ChangeLog
+++ b/v4l/ChangeLog
@@ -1,3 +1,12 @@
+2005-12-14 19:34 mchehab
+
+ * linux/drivers/media/video/cx88/cx88-alsa.c: (dsp_buffer_init),
+ (snd_cx88_hw_params), (snd_cx88_card_trigger),
+ (cx88_audio_finidev):
+ - more videobuf stuff included ad dsp_buffer_init. Still no joy.
+
+ Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
+
2005-12-14 17:39 mchehab
* linux/drivers/media/video/cx88/cx88-alsa.c: