Hello,
appended is an experimental patch agains linux-2.6.23.12 which enables mmaped access during capture on the es1938 (Solo1).
Main obstacle is (as documented in the current driver) that the dma engine put bytes from the adc with an offset +1 to ram. So the patch did the following:
- allocate on additional page in front of the capture dma buffer, with mmaping pointing to the original buffer (i.e. with one page offset into the dma area) - let the dma engine start from the last byte of that extra page, so that all bytes are put aligned to the real dma area (besides the last byte) - the last byte the dma engine of the chip put at the first location, i.e. in the last byte of the extra front dma page. - This byte has to be copied at the right time to the end of the mmaped area, which is done in the hw_pointer callback.
In a discussion with Takashi some of the pointer callback issues are already discussed (that patch is included btw.), and from the log send there (lock at the fb values, which is the fist byte of dma area) you can see that indeed the last byte is transferred after the interrupt indicating reaching the end of the dma buffer came in.
On Fri, Jan 25, 2008 at 05:36:11PM +0100, Takashi Iwai wrote:
The hwptr is the position of the current DMA. The data below that point must have been already processed. That's why hwptr returned in snd_pcm_period_elapsed() must be on the period boundary or above.
The patched driver did not fullfill this, OTOH I have made first recordings which seems to be ok (even with the debug printk in the hw_pointer callback).
Have fun, Hermann