21 Mar 2006
(updated 21 Mar 2006 at 14:30 UTC) »
Although I claimed to have a working driver ten days ago in fact all it did was play 8 bit mono. Now I have one that will play 16 bit stereo too.
Try as I might I just could not get the stereo to work - firstly because I assumed that, as I had done with the OSS driver, I'd have to write the stereo separation code myself (in fact the ALSA middle layer does all that) and then because of what appeared to be repeated buffer over-runs.
I had built an OSS only version of mpg123 to test this and try as I might I just got clicks and gaps as the middle layer responded to the over runs by restarting the DMA transfer.
Eventually I realised that ALSA was assuming that my buffer stayed a constant size (in fact it doubles in size for stereo). Once I cut the hardware buffers in half and fixed up the period sizes to something close to optimum it all worked.
I can now also see how to add additional channels - not too difficult really. But I am not sure I can see a reason.
Working on the mixer code now.