Then around 2024 someone commented that driver was not working and I confirmed that.

Then today I decided to take a look at that issue because Matteo (AKA linguini) ported Doom to NuttX and we want to have sound even on boards without an audio codec!

Then I started testing the old version…

I noticed that on NuttX 7.18 everything was working fine (although the sound as a little low because my original driver had a mistake: I was defining duty value was 50, but actually it should be b16HALF that is equal to 0x00008000).

Then moving to 7.27 I noticed that the audio disappeared completely. After some debugging with git bisect I discovered that guilt: https://github.com/apache/nuttx/commit/2fcf682316689efdb663d32a62f87459d7c6162d

Then reverting this commit, the audio returns, but it was very fast. So I test, 7.26, 7.25, 7.24, 7.23. 7.22, 7.21, 7.20 and 7.19. All had the same issue.

So, someone broke the driver few weeks after I added it to mainline!

I can’t believe that I also was the guild of breaking my own driver. But the truth is: after I got the audio tone working I didn’t use it and since NuttX doesn’t have much uses like Android or Windows, nobody tested it.

This is a kind of issue that we only detect when we test it. But we need to find some way to let the CI to test it for us. Maybe we can use a RP2040 was a “logic analyzer”, so the wave form should match, otherwise it will raise an error.