mikebrady / shairport-sync

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

[Problem]: Crackling solved? #1758

Closed network-1 closed 9 months ago

network-1 commented 1 year ago

What happened?

Thanks for great software initative!

Hi, I really want to use this, I have set it up works, but get those clicking / crackling noises when playing tracks that have lower sounds and silence in them (if this indicating something to you?) I have a lot of tracks that is good examples, it happens a lot with classical music with segments of low sound.

I saw the discussion here earlier about this issue tracking, but I really did not get if you were able to solve it?

I am running with a xmos hi end async usb adapter by Stello, into my dac via coax. The dac is high end with a dsd1792 chip, able of 132db SNR https://www.ti.com/product/PCM1792

Raspberry pi 4 , 8gbram, latest updates.

What could it be, is there a setting I could tune? I have the pi4, so enough power to crank up stuff. Lossless or hi end audio is the focus for me...the best possible sound. I used the recomended build instructions when buildint, I have disabled volume controll as, I do that on my analog tube amplifer.

I remember installing the last update for airport express that had airplay2, that also had issues, with hi quality audio (also on specific tracks), it seemed aslo that it could adjust with resolution and bit the dac was playing on. but I had to roll back to airplay1 version of the fw to get stuff working OK again...

So any solution for the crackling? Or a setting that you recommend?

Relevant log output

No response

System Information.

Setup: Raspian latest, on rpi 4 with 8gb ram usb to xmos to coax adapter, powered by usb coax into external dac with dsd1792 chip analog output to tube amplifer

Configuration Information.

Default, Digital volume possibilty turned off

PulseAudio or PipeWire installed?

How did you install Shairport Sync?

A package manager (apt, apt install, yum, pkg, etc.)

Check previous issues

mikebrady commented 1 year ago

Thanks for the interesting post. Yes, the crackling issue has been solved, and the Pi 4 is very suitable. However, there are some factors that may be important.

  1. Source: -- what is the source of your audio? What device? What software?
  2. Output Backend: -- you haven't told us anything about the installation. Please run:
    $ shairport-sync --displayConfig

    and post the output. The best output backend for maximum fidelity is alsa.

  3. Synchronisation: If Shairport Sync has to do a lot of interpolation to maintain synchronisation, it might become audible in extreme situations. You can check this in a number of ways:
    1. Check how much synchronisation is being done: enable statistics in the diagnostics section of the configuration file and you'll see a log of the amount of interpolation that is being done. If you could post a log of maybe 10 minutes of operation here, it would be helpful.
    2. Turn off synchronisation: Assuming you are using the alsa backend, you can turn off synchronisation in the alsa section of the configuration file.
  4. Power Supply Noise: It may be that noise is coming from the Pi's power supply, and this may be coming through the DAC. Perhaps you could tell us exactly what model of power supply and DAC you are using.
  5. Coding Artifacts: Noise may be introduced by encoding and/or decoding the audio. The format for AirPlay 2 is 24-bit floating point 44,100 Hz stereo low complexity AAC, which is lossy. FYI, Shairport Sync uses the FFmpeg AAC decoder.

    However, if you build Shairport Sync for classic AirPlay ("AirPlay 1"), it uses the (lossless) 16-bit signed-integer 44,100 Hz stereo ("CD quality") ALAC format. Shairport Sync has been shown in the past to be bit-perfect in classic AirPlay mode. If you used this and the noises disappeared, then you could conclude that the encoding or decoding process was at fault.

  6. Packet Loss: if you are using classic AirPlay or AirPlay 2 Realtime Streams (e.g. playing from Spotify) then it is possible that sequences of audio frames, sent in UDP packets, could be lost. To check, enable statistics in the diagnostics section of the configuration file and log activity for a period including these noises. You'll get an indication of any packet loss in the logs.

[Edited to add Packet Loss as a potential factor.]

network-1 commented 12 months ago

Thank you for the through reply: I will start the reply so you can at least look in my config if there are some obvious things in there?

  1. Streaming source, either is tidal, apple music on iPhone and iPad Pro with latest iOS 17.1. Described earlier to the Pi, to usb to coax (xmos) adapter (2x clock async) powered by usb to a high end dac. The crackling is more frequent on Apple Music. Both applications is set to max quality. Also I have been testing online Flac "reference" audio files and had issues with them as well.

shairport-sync --displayConfig
Support for the Apple ALAC decoder has not been compiled into this version of Shairport Sync. The default decoder will be used.
>> Display Config Start.

From "uname -a":
 Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux

From /etc/os-release:
 Debian GNU/Linux 11 (bullseye)

From /sys/firmware/devicetree/base/model:
 Raspberry Pi 4 Model B Rev 1.5

Shairport Sync Version String:
 4.3.1-24-g7e0e3af6-AirPlay2-smi10-OpenSSL-Avahi-ALSA-soxr-sysconfdir:/etc

Command Line:
 shairport-sync --displayConfig

Configuration File:
 /etc/shairport-sync.conf

Configuration File Settings:
 general : 
 {
   name = "Stello on %H";
   alac_decoder = "apple";
   ignore_volume_control = "yes";
 };

>> Display Config End.
>> Goodbye!
  1. Diagnostics, I will check this later, but to get the reply out this was omitted now

  2. Good point, I am using a good quality USB - c supply, but I will check also another later

  3. Noted, I will test this

  4. Will come back with this later. I have a 1gbp connection and the noises appears at the same time each time. on the same tracks.

mikebrady commented 12 months ago

Thanks for the update.

What do you mean by this, please:

Also I have been testing online Flac "reference" audio files and had issues with them as well.

Are you playing these through Apple Music, or if not, how?

  1. Will come back with this later. I have a 1gbp connection and the noises appears at the same time each time. on the same tracks.

That is interesting. Offhand, it seems to point to (5), a coding issue, no?

[Update]

BTW, support for the Apple ALAC decoder has not been compiled into this version of Shairport Sync, so the alac_decoder = "apple" setting is ignored and the standard Hammerton decoder is used instead.

github-actions[bot] commented 10 months ago

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.