[alsa-devel] [RFC 3/4] OMAP3: McBSP: Add interface for transmit FIFO state query
ext-Eero.Nurkkala at nokia.com
ext-Eero.Nurkkala at nokia.com
Wed Mar 3 20:07:21 CET 2010
> what went wrong? (the pcm pointer w/dma pos never missed that
> greatly)
> Very unlikely that an IRQ just happened to come in between the
> register reads..with that frequency (> 1/50)
Just to make sure:
+void omap_mcbsp_buffstat(unsigned int id, unsigned int *xbuffstat,
+ unsigned int *rbuffstat)
+{
+ struct omap_mcbsp *mcbsp;
+
+ if (!(cpu_is_omap2430() || cpu_is_omap34xx()))
+ return;
+
+ if (!omap_mcbsp_check_valid_id(id)) {
+ printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
+ return;
+ }
+
+ mcbsp = id_to_mcbsp_ptr(id);
+ *xbuffstat = OMAP_MCBSP_READ(mcbsp->io_base, XBUFFSTAT);
+ *rbuffstat = OMAP_MCBSP_READ(mcbsp->io_base, RBUFFSTAT);
+}
see, the above is not trusted. However, it's 100% trusted to read off
the timestamps recorded at DMA IRQ callback. (and at that time the buffer
has just been filled up.).
- Eero
More information about the Alsa-devel
mailing list