-
-
Notifications
You must be signed in to change notification settings - Fork 577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Problem]: Slight crackling during loud parts of songs. #1919
Comments
Thanks for the post. If there is a lot of interpolation, then you might hear some crackling if using |
Okay so starting shairport with
|
Thanks. As I suspected, there is a great deal of interpolation going on — it should be in the 10s of PPM or occasionally up to 150 PPM or so. However, you can see that synchronization error is going positive and negative, indicating that the system is overcompensating. My suggestion would be to make the |
I've set This is the output now:
Other than that, is there a root cause of the interpolation that I could try to address? |
That’s good news. You will hardly hear a sync mismatch of 20 milliseconds, but you could experiment with reducing the drift tolerance until overcompensation starts — that will be when the All Sync PPM is considerably greater than the Net Sync PPM. There seems to be two issues at work here. First, the rate of arrival of audio frames from the player doesn’t quite match the rate at which they are played. Second — and apparently more significant in this case — it looks as if the reference clock on the sending device is wandering, slowly getting faster and slower then faster again, etc. over a period of 10s of seconds. If your Pi has a good connection to the internet, the Output FPS (c) should be accurate over a long period, as it should be adjusted by the NTP service used by the Pi. On the face of it, it looks as if your output device is pretty exactly on 44,100. It also looks like the audio is arriving at close to 44,100 fps, but the reference clock seems to be wandering by something in the region of 100 to 150 PPM. It would be interesting to run it continuously for a few hours if possible, in order to get better readings. Apple sources tend to be stable and accurate, but others maybe not so much. |
When I get a chance to do this I will, and then post the output here. Thank you so much for your help so far! |
Okay this is quite a long run, about 2 hours |
Thanks -- that's interesting. You could probably experiment with reducing the tolerance to 10 milliseconds and see what happens. There are a few discontinuities in the sequence -- was anything special happening at those times, e.g. the end of a track and the start of another, that might account for them? Later in the log, you can see a kind of cyclical increase and decrease of the amount of interpolation needed, with a periodicity of the order of five minutes or so. Just for reference, here is a log of an iPad playing an album using Apple Music to Shairport Sync running on a Raspberry Pi 3 all up-to-date.
Here is the output from
One anomaly in your log is that there are no drift samples registered. I'll have to think about why that is -- maybe the acceptance algorithm is too strict. In any case, the drift samples are diagnostic only -- they have no function apart from providing a little information. In my sample, it seems that there is a drift of about 5 parts per million between the iPad and the Pi's clocks, which seems reasonable. |
This issue has been inactive for 28 days so will be closed 7 days from now. To prevent this, please remove the "stale" label or post a comment. |
What happened?
There's a slight crackling sound during loud parts of some tracks. Not all tracks, but if I notice it with one track, it will do it consistently with that track. I notice it the worst when the source is my nixos desktop (pipewire), but I also notice it with my android phone with airmusic to a slightly lesser extent, and I also notice it with my M1 macbook air. Again it seems to be to different degrees with these three devices. And again I on't notice it on all tracks, it seems to happen is a track goes suddenly from being quiet to loud, though I'm not quite sure. It didn't always happen (I don't think... But I'm beginning to doubt myself because it's quite a subtle thing that I might have missed before), and seems to have started in the last month or so.
The crackling sound is similar to that you sometimes get in VMs when you don't pin cpu cores if that helps at all, though it's much less exaggerated.
The nature of the crackling changes when I switch between basic interpolation and soxr, but it happens either way. This makes me think it must be to do with lost packets?
I thought it might be a sign of my pi dying so I switched it out for an identical one but the problem persists.
The only other thing I can think of is that it is a problem with my network itself, but I'm not aware of any changes to my network in the last months/weeks.
I'm fairly certain it's not a problem with the dac because the problem goes away when I connect directly to the dac via bluetooth.
Relevant log output
System Information.
I'm running shairport, compiled with Airplay 2 and soxr support, on a raspberry pi 3 model B with an ethernet connection. It's outputting to an SMSL SA300 DAC.
Configuration Information.
PulseAudio or PipeWire installed?
How did you install Shairport Sync?
Built from source
Check previous issues
The text was updated successfully, but these errors were encountered: