I installed shairport on my raspberry pi 2 as described here. When I start a song on my Macs iTunes, by configuring the airplay inside iTunes, the output quality on the analogue jack of the raspberry is ok. When I configure my mac, s. t. all audio is to be transferred via airplay, the quality decreases drastically and one can constantly hear a loud noise. How can I counter that problem, where is the bottleneck? Is it likely to be a shairplay overstressing or did anyone came across this problem with an apple TV as well?
The audio via the audio out plug on the raspberry Pi does suffer from interference from other activities on the device. People who want to use their rPi for HiFi audio know this, and they typically use a DAC converter shield/HAT board on top of their rPi. Those boards might be too expensive for what you are trying to do, but I get good results using a simple, cheap usb-audio device like this one ($3 on ebay). You might want to give this a try.
The problem is that the volume levels are really low by default so the noise from the raspberry pi's internal sound card is too loud compared to signal. The sound quality from iTunes is better because the volume in the app is probably set to the maximum.
The solution is to raise the level of the signal by using the alsamixer. Just type alsamixer in the bash, and increase the volume, it works like charm with shairport-sync. If it's still not enough, you can set
ignore_volume_control = "yes"
in your shairport-sync.conf file (probably can be found in /etc) to always have the volume at 100% no matter the source's own volume control.
I think you can further improve the signal-noise ratio by buying a cheap USB sound card, but I don't have any experience with those.