Concepts
When a DAC misbehaves
What Polylute does when a DAC’s timing goes wrong, and why the music keeps playing while it does.
In short
- Now and then a DAC asks for a pace that makes no sense, or gets stuck on one answer. Left alone, that can sound like a hiss (“shh”), crackling or a short gap.
- Polylute has two defences. It refuses readings that look wrong and uses a healthy pace instead. If the DAC looks locked up, it runs a three-step recovery.
- The music keeps playing. Polylute does not mute, pause or interrupt you with a message because of a DAC fault. You may hear a short gap while it recovers.
- We cannot promise this fixes every DAC. It is built from what we saw on the DACs we have.
How it works
As The USB transport explains, the DAC tells Polylute how many samples it wants next. That is the feedback. A healthy DAC answers with its normal pace, plus the odd small blip. A misbehaving one may answer with something far off, or the same wrong value for seconds, or something that keeps climbing.
First defence: do not obey a reading that looks wrong
Every reading is judged by how far it is from normal, and for how long.
In words
A normal reading is followed. A reading that is a little off is followed for a while, and not any more if it stays off too long. A reading that is far off is never followed: Polylute uses the healthy pace instead. A runaway that stays far off is treated as a locked-up DAC, and recovery starts.
In words
A reading that is not clean is ignored. A reading far beyond anything a healthy DAC asks for is not obeyed. A reading that is a little off for a long time, or frozen on one value, is not obeyed either. Otherwise Polylute follows what the DAC asks.
Second defence: the recovery ladder
If a DAC’s feedback runs far off and stays there, Polylute treats the DAC as locked up and starts a recovery. It has three steps, each a little stronger than the last, and after each step it waits to see whether the DAC is healthy again.
In words
- Step 1: restart the DAC’s streaming interface, at the same place in the song and at the same volume.
- Step 2: reset the USB bus, claim the interfaces again, and put the volume back where it was.
- Step 3: close the stream and the DAC, and open them again.
After each step Polylute checks whether the DAC is healthy. If it is, playback is back to normal. If it is still not, Polylute goes to the next step. If step 3 is not enough, it tries it again after a pause, and again, for as long as the fault lasts. The music keeps going the whole time.
What you may hear
Step 1 is a short break in the sound. Steps 2 and 3 are longer. While the problem lasts, you might hear a hiss, a crackle or a gap. Recovery is meant to be quick. In the examples we recorded on a HONOR with a SNOWSKY Melody, the first step was enough and took a fraction of a second. Every step is written to a small private journal on the phone, with no song titles, file names or device serial numbers. If you want to look at one, see Noise, “shh”, crackling or a short gap and Report a problem.
Why we built it this way
The app copes, not you. A DAC’s firmware is not Polylute’s to fix, and a listener should not have to fix it either. So Polylute detects the misbehaviour and recovers by itself, for any DAC it drives.
Judge by size and by time. A healthy DAC does ask for odd values for a moment, for example a brief jump when a stream starts. If Polylute refused every unusual reading, it would fight a DAC that is behaving normally. So a reading is judged by how far it is from normal and for how long: a short blip is followed, the same reading for seconds is not.
The music keeps going. We could have muted the sound while recovering, paused playback, or shown a message. We chose not to. Silence, a pause or a dialog interrupts you; a short gap while the app fixes things is the smaller harm. It is also a decision that costs something: while a fault lasts, you may hear it.
It does not give up. A DAC that is stuck at one moment may be fine a minute later. Polylute keeps trying, spaced further apart each time, instead of stopping for good.
One owner at a time. Several things can want to touch the DAC’s interfaces: the recovery, a change of sample rate, a hand-back to Android, and an unplug. Polylute lets one of them act at a time. If a recovery was started for a stream that has since been replaced, it does nothing.
For the curious
For the curiousThe thresholds
- A reading more than 2 % from normal at any moment is never obeyed.
- A reading more than 0.5 % from normal in every reading for 5 seconds is not obeyed from then on.
- The same reading, more than 0.05 % from normal, for 5 seconds counts as stuck. A constant exactly at normal is healthy.
- After a change of sample rate, a stuck value is called sooner: after 1.5 s, or after 0.4 s if it is far from normal in a band that healthy DACs do not use.
- A reading more than 4.5 % from normal for 200 ms (counted after the first half second of a stream) calls the DAC locked up.
- The healthy average is a running mean over about 5 seconds of readings. A reading only joins it after 2 seconds of quiet.
For the curiousThe timing of the recovery
- After each step, Polylute waits 4 seconds of healthy readings before it calls the step a success.
- An episode ends after 10 seconds of quiet. A new episode cannot begin until 30 seconds after the last one began.
- If step 3 is not enough, it is repeated after 30 seconds, then 90 seconds, then every 300 seconds while the fault lasts.
- Step 2 resets the bus, and a reset can restart a DAC at its power-up volume. So Polylute claims the interfaces again at once, puts the volume back to a level no higher than before, and reads it back, before any music plays.