From: Adrian M. <ad...@mc...> - 2002-02-03 22:46:35
|
I have got my microphone driver to 'record' data, but its all garbage and nothing I do with sox appears to turn it into anything even approximating real world sound. So I am wondering if I have misunderstood the basic maple callback mechanism (probably, I am sure, is the answer). This is my current callback: struct dc_microphone { struct input_dev dev; struct maple_driver_data *data; unsigned char snd[8094]; int open; }; static void dc_microphone_callback(struct maple_driver_data *data) { struct mapleq *mq=& data->mq; struct dc_microphone *mic = data->private_data; unsigned char *buf = (unsigned char *)mq->recvbuf; memcpy(mic->snd, mq->buf, 1024); } An OSS read call then reports back the contents of mic->snd. I am not worried about the size of the buffers at present, just getting the basic mechanism right. I am assuming that on each call to callback mq->recvbuf contains the buffered data loaded by a DMA transfer - but this seems a pretty wild assumption. Anyone able to tell me where this data really is and how to get it? Thanks Adrian |