Fast algorithm for generating white noise

I was looking for ways to generate white noise in a C program running on STM32F4 (this family of MCU-s has a RNG, but it’s way too slow to use for realtime audio).
Didn’t really find much on the subject. A lot of stuff on PRNG, but all the articles I found seemed to focus on the cryptographic use and the algorithms for that are bit too slow to use on a puny MCU (in my project I wanted to generate 24000 noise samples every second, so I needed an algorithm that would be as fast and simple as possible – the randomness is a nonissue in audio world).

The following snippet is based on code found here:
http://www.bobwheeler.com/statistics/Password/MarsagliaPost.txt

 uint32_t noise_m_z=362436069;
 uint32_t noise_m_w=521288629;

 uint32_t getNoiseSample(void) {
     noise_m_z=36969*(noise_m_z&65535)+(noise_m_z>>16);
     noise_m_w=18000*(noise_m_w&65535)+(noise_m_w>>16);
     return (noise_m_z<<16)+noise_m_w;
 }

I personally treat the resulting uint as Q31 type. This way it is a proper audio sample – a value between -1 and +1 and usable with DSP functions.

CS43L22 Master Volume

Got myself a STM32F4-Discovery board and it comes with a decent audio DAC (CS43L22).

CS43L22-VolumeCS43L22 master volume registers 0x20 and 0x21 are documented rather poorly and it’s NOT immediately obvious what’s the logic with the values.
Anyhow here’s an explanation:
values 1-24 mean positive dB,
values 25-255 mean negative dB
…and the volume doesn’t go any lower than -102dB (values from 25 to 52 all result in volume of -102dB).
Oh and and if this is not confusing enough – the negative dB values are organized backwards. Here’s a table to illustrate this strangeness:

Registry value dB
24 +12.0dB
23 +11.5dB
22 +11.0dB
0 0.0dB
255 -0.5dB
254 -1.0dB
253 -1.5dB
53 -101.5dB
52 -102.0dB
51 -102.0dB
50 -102.0dB
25 -102.0dB

Would have been nice to see this explained in the official documentation and not waste an hour to figure this out.