Hi , Finally I have got my driver working and now testing it using aplay. I am able to play a song without getting any underruns when I use read/write mode but when I use mmapped mode I get underrun warnings. After this if I use read/write mode again then I observe 1 warning of underrun. Any idea what could be wrong? I know why underruns occur etc. Does it have to do with mmapped mode? I dont think so... Here is the log.
# aplay -Dplughw:0,0 --rate=44100 --format=s16 --channels=2 --mmap 44.wav Playing WAVE '44.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
underrun!!! (at least 0.384 ms long) underrun!!! (at least 0.118 ms long) underrun!!! (at least 0.124 ms long) underrun!!! (at least 0.117 ms long) underrun!!! (at least 0.121 ms long) underrun!!! (at least 0.128 ms long) underrun!!! (at least 0.116 ms long) underrun!!! (at least 0.121 ms long) underrun!!! (at least 0.121 ms long) underrun!!! (at least 0.125 ms long)
.......
and it goes on till the song finishes.
And after this I play without using mmap and log says..
# aplay -Dplughw:0,0 --rate=44100 --format=s16 --channels=2 44.wav Playing WAVE '44.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo underrun!!! (at least 516.424 ms long)
and then the song plays without any underrun.
-pharaoh.