Reply 740 of 1404, by polpo
- Rank
- Member
I've determined the cause of silent audio in Doom and Dope reported by @Pickle and @HandOfFate, and I have a firmware fix! Many thanks to them for sending the cards back to me. At first I thought it was due to shipping damage or chipset incompatibility, but in this latest batch of cards I just made I started testing with Doom and noticed quite a few cards had the same problem. After eliminating the possibility of bad PSRAM, bad bus interface chips, or DMA bugs, I wondered if it was due to the DAC. Another person who had the same problem said not only was the demo Dope silent, playing the Demo's song in any MOD player was also silent. Dope is a 28-channel MOD file, which corresponds to a 22.05kHz GF1 mixing rate. And would you know it, Doom also runs at 28 channels. On the affected cards, loading any song into Fast Tracker II and playing with the number of active channels reproduces the issue: playback goes silent at 28 voices. Poking at the I2S signals going to the DAC with my scope showed audio being sent at that rate, but the DAC just wouldn't play it. I looked at the PCM510xA datasheet and it doesn't seem that 22.05kHz is really supported, especially at 16 bits per sample. I experimented with padding output to 24 or 32 bits per sample but that didn't alleviate the issue.
After searching the web for PCM5100A (or its variants PCM5101A and PCM5102A) and 22.050kHz, I found a couple posts on the TI forums that also report the same issue of no audio at 22.05kHz:
https://e2e.ti.com/support/audio-group/audio/ … ate-of-22-04khz
https://e2e.ti.com/support/audio-group/audio/ … hz-audio-format
So it seems that 22050Hz sampling rate is not officially supported by the PCM510xA despite it working on 90% of cards. I have a feeling it's somehow being detected internally on the PCM5100A as 44.1kHz, since all of the other oddball GF1 sampling rates work just fine. In any case, I have a simple software fix: at 28 active channels, force an output sampling rate of 44.1kHz and double each sample. It's not interpolated so it pretty much sounds the same as "real" 22.05kHz. The fix solves the issue on all of the affected cards I've tested.
That raises another approach to a fix: constant 44.1kHz output rate for all number of channels, just as the Interwave does it. At first I didn't attempt it because I was worried about available CPU for mixing and PSRAM bandwidth. But @wbc has experimented with creating firmware that outputs at this rate and it doesn't seem to be a problem. I'm wondering how people would react to that since it's less true to the original GUS and its GF1. I could make it switchable via pgusinit.