Johannes Berg writes: > Maybe we should clear the S0 bit and then check if it's active? That's what I do, exactly. > Clearing the S0 bit when the DMA engine has already stopped doesn't make > a difference, and when it is still active we want to clear S0 in this > 'play again case' anyway. Then if we clear it and check the ACTIVE bit > afterwards we can be sure that if it is still set the engine will > continue running. The possible race is that the DBDMA might see the S0 bit set just before we clear it, but it will still take a little while for it to do the branch, fetch the stop command, and execute it. So it is possible that we clear S0 and then check the ACTIVE bit and see that it is still set, but in fact the DBDMA did see the S0 bit set and is in the process of stopping, and if we do nothing it will stop and the input or output will stall. That's why I put the udelay(10) in there. It may be possible to do better by telling the DBDMA to do a flush and looking at the status words in the DBDMA command list. If we see the status from the flush then the DBDMA didn't see S0; if the DBDMA stops before writing out the status from the flush then it did see it. However, the udelay seems to work OK and is simple. Regards, Paul. ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Alsa-devel mailing list Alsa-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/alsa-devel