mikebrady / shairport-sync

AirPlay and AirPlay 2 audio player
Other
7.29k stars 574 forks source link

Distortion & Artefacts #852

Closed NNEU-1 closed 3 years ago

NNEU-1 commented 5 years ago

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 IMG_1993 IMG_1994

20kHz

IMG_1995 IMG_1996

In contrast; being played through AirPort Express, all sinewaves up to 20kHz are put out undistorted and perfectly clean.

IMG_1999

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.

29db5011-c96f-4f58-a86a-6ca5883c02fc

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.

mikebrady commented 5 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.)

mikebrady commented 5 years ago

Hi there. I wonder if you have any further observations you could share about this?

pryg-skok commented 4 years ago

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)

pryg-skok commented 4 years ago

And also, maybe it's connected, so I ask here: sometimes when I switch between tracks I can hear crackling sound

mikebrady commented 4 years ago

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.

pryg-skok commented 4 years ago

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.

mikebrady commented 4 years ago

The Debian archive is being updated, so 3.3.5 should be available in a few weeks.

github-actions[bot] commented 3 years ago

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.