Closed NNEU-1 closed 3 years ago
Thanks for the post. It should be possible to work out where the issues are coming from.
(BTW, if possible, you should be testing the development
branch, as it will shortly be released and has many new features.)
AirPlay is intended to be a bit-perfect protocol. That is, it should be the case that the CD-quality (i.e. 44,100 frames per second, 16-bit interleaved stereo) audio you send via AirPlay should appear at the output DAC without alteration. Shairport Sync should deliver this, apart from occasional interpolation necessary to keep the output synchronised. As described in the README, interpolation is either "basic" – insertion or deletion of frames – or "soxr", which resamples packets of 352 frames of audio to give 353 or 351 frames. Basic interpolation may be giving rise to the slight crackling sound you are hearing. Soxr interpolation is much better, but requires a lot of processing power.
So, summarising, there is a possibility that interpolation could be causing the artefacts. You can turn interpolation off to determine if the artefacts go away – set the alsa
disable_synchronization
setting to "yes"
. (BTW, there is a tentative implementation of a high quality interpolation algorithm which will work on low power devices, but it's some way from publication or release. First, the development
version is nearly ready for release, and when that is out, attention can turn to this issue.)
Another possibility is that there is some problem with the ALAC decoder used in Shairport Sync. The standard ALAC decoder used in Shairport Sync is one written by David Hammerton, very slightly modified. So, I guess it's always possible that it has faults, though I haven't heard of any. However, it is possible to substitute Apple's own ALAC decoder. You need to build the ALAC library – see here for the repository I use – and then build Shairport Sync with Apple ALAC support (--with-apple-alac
at the ./configure…
stage). Alternatively, the development
version of Shairport Sync can now support raw PCM, if you can supply it.
Hi there. I wonder if you have any further observations you could share about this?
Hi, I have very similar problem! Spent two days to find an answer :)
I can confirm that setting disable_synchronization=yes
almost fixes the problem, but volume control stops working :)
Also I can see that shairport-sync receives volume changing signals but nothing happens:
Dec 02 00:02:12 dungeon shairport-sync[12631]: Volume: -9.4 dB - Loudness gain @10Hz: 0.0 dB
Dec 02 00:02:13 dungeon shairport-sync[12631]: Volume: -7.5 dB - Loudness gain @10Hz: 0.0 dB
Dec 02 00:02:13 dungeon shairport-sync[12631]: Volume: -5.6 dB - Loudness gain @10Hz: 0.0 dB
Dec 02 00:02:14 dungeon shairport-sync[12631]: Volume: -3.8 dB - Loudness gain @10Hz: 0.0 dB
Dec 02 00:02:14 dungeon shairport-sync[12631]: Volume: -1.9 dB - Loudness gain @10Hz: 0.0 dB
Dec 02 00:02:14 dungeon shairport-sync[12631]: Volume: 0.0 dB - Loudness gain @10Hz: 0.0 dB
EDIT: forgot to add version: 3.1.7-OpenSSL-Avahi-ALSA-pa-dummy-stdout-pipe-soxr-convolution-metadata-sysconfdir:/etc (it's from ubuntu 18.04.2 default repositories)
And also, maybe it's connected, so I ask here: sometimes when I switch between tracks I can hear crackling sound
Thanks for the post. If turning off synchronization helps, then it’s likely that an excessive amount of synchronization is required for some reason. You should enable statistics to see what’s happening.
The log entries you show above only show that the loudness filter is inactive — the gain is 0.0 dB. This is probably because the threshold it cuts in at is -20 dB, above which it doesn’t operate. It looks like the volume control is working.
Sorry, yesterday I forgot to add. I've build shairport-sync from latest git and everything start working just fine. No glitches (but I preserve disable_synchronization=yes
), volume control works, no hangs (on previous version 3.1.7 server sometimes hangs when I switch between tracks).
Actually, I can say it works pretty fine for me. Thanks for your work!
Maybe it should be better if ubuntu ppa will contain updated packages.
The Debian archive is being updated, so 3.3.5 should be available in a few weeks.
This issue has been inactive for 60 days so will be closed 7 days from now. To prevent this, please remove the "stale" label or post a comment.
Hi Mike,
I've been evaluating a third party platform on which shairport-sync is used for AirPlay connectivity.
I have noticed a slight crackling sound; becoming especially apparent on high-pitched female voices.
I had a look at the audio output and noticed reoccurring hiccups in sinewaves above 3kHz, and becoming more severe with rising frequency.
The pictures below show sinewaves of various frequencies being played through shareport sync on this third party implementation.
8kHz
20kHz
In contrast; being played through AirPort Express, all sinewaves up to 20kHz are put out undistorted and perfectly clean.
I have spoken about the matter to another developer who uses shareport in their distribution. They have noticed similar - though seemingly less severe- hickups in their implementation.
I would kindly ask you to investigate this matter.
If you don't think that these issues are cause by Shareport itself, It would also be greatly appreciated if you could point to a possible cause in the implementation.