I've reimplemented the original PWM-based 11-bit audio @48kHz as 7-bit 2nd-order Sigma-Delta modulated at 781.25kHz. The effective noise floor with this scheme approximates that of CD-quality audio DACs.
There are some rough edges and probably quite a few bugs, but here's how to enable it:
Run sudo rpi-update
In /boot/config.txt add the following line:
Code: Select all
Before using the audio for the first time, you should run amixer cset numid=3 1 to ensure that HDMI is not selected as the audio output path. OMXplayer should be forced to use "local" as the sound output route.
Known rough edges:
- Running the PWM engine at a 781kHz sample rate means the FIFO empties in ~12uS. Changing SDRAM frequencies or running PVT on the SDRAM takes at least 20uS which causes glitches. For now, the firmware disables things that may cause SDRAM accesses to get turned off. In practice, this means that extreme SDRAM overclocks may be unstable with the new audio driver.
- Multiple streams played via different subdevices contend for control instead of mixing - for now only a single stream is supported
- Sometimes the driver can be prodded into a bad state if significant VPU activity is generated at the same time as the driver is opened (e.g. if HD interlaced video is played at the same time as audio usage)
- There is a substantially increased VPU cycle usage with the new audio driver - 25% of VPU0 and ~9% of VPU1 will be used when SDM audio is active. This may cause issues with edge-case usage such as 8-ch HD audio to 2-ch downmix, advanced HD deinterlace and/or simultaneous camera usage.
Please test and report back results. Strikethrough text is no longer valid as of the latest rpi-update firmware.