f7f198978e
Both SNDCTL_DSP_SPEED and SNDCTL_DSP_CHANNELS support a special value 0 to "query the configured value without changing it". In our case, this actually means setting and querying the hardware rate. I don't know if OSSv3 or FreeBSD or other implementations also do this. But it seems safe and sensible to support.