Closed fesc2000 closed 2 years ago
Thanks for the interesting post. Those are huge levels of correction, and 44066 fps is a bit crazy. Some older DACs ran at 44096.5 fps or something similar, but 44066 is nearly ten times worse, and is a bit mad.
Can I ask you to post the alsa
settings please, and also the list of alsa
hardware devices that is given at the end of $ shairport-sync -h
?
Thanks for the replay. The information that the correction is way too high would mean that i should try to fix my hardware .. Here is some data, not sure what is useful. As said, there are two DACs which behave identical.
# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Audio [iFi (by AMR) HD USB Audio], device 0: USB Audio [USB Audio]
Subdevices: 0/1
Subdevice #0: subdevice #0
# amixer
Simple mixer control 'iFi (by AMR) Internal Clock Validity',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
# shairport-sync -V
3.3.8-mbedTLS-tinysvcmdns-ALSA-jack-stdout-pipe-soxr-convolution-metadata-mqtt-sysconfdir:/etc
# shairport-sync -h
...
Available mDNS backends:
tinysvcmdns
Available audio backends:
alsa (default)
jack
pipe
stdout
Settings and options for the audio backend "alsa":
..
hardware output devices:
"hw:Audio"
This is also intersting (i didn't look into the details what those values mean). Delay/avail are de/increasing all the time.
# cat /proc/asound/card0/pcm0p/sub0/status
state: RUNNING
owner_pid : 13061
trigger_time: 1149823.178103486
tstamp : 1149851.951733678
delay : -1381120
avail : 1397516
avail_max : 1397516
-----
hw_ptr : 1381132
appl_ptr : 0
alsa.conf is unmodified version of buildroot installation: alsa.zip
Thanks. Could you also include the alsa
settings from the Shairport Sync configuration file please, or else the command line options you may be using? (Sorry for being a little unclear.)
It may not be your hardware -- let's wait to see your settings.
My shairport-sync.conf is in the zip file
.. And a full log where the corruption happens after some seconds: log.zip
Thanks.
Okay, I notice that your output device is set to "default"
. It may be that the default device is not actually your DAC, but rather an alsa
pseudo device. It would be better to set the output to the real hardware output device (as suggested), which might be "hw:Audio"
or "hw:0"
.
The mixer volume control name also looks wrong -- use alsamixer
to see what name, if any, to use for the mixer. Set it to full volume using alsamixer
and comment out the mixer_control_name
in the Shairport Sync settings file -- that is one less variable.
Please do not set the log verbosity to 3
-- it is much too noisy for normal use. Set it to 1
or maybe 2
.
This definitely makes a difference, with device="hw:0" it looks like this:
6.525212963 "player.c:2778" 0.93, -223.8, 223.8, 64192, 0, 0, 0, 0, 8502, 235, 248, 44100.00, 44115.17, 44102.16, 0.00, 8, 48.98
However, now whenever a correction is applied, audio is corrupted for a short amount of time (or, audible crackling when playing a sine wave):
8.003210043 "player.c:2778" -0.28, -147.3, 147.3, 71213, 0, 0, 0, 0, 8500, 235, 247, 44100.00, 44114.06, 44102.05, 0.00, 7, 46.49
Maybe it's libsoxr which has an issue, at least on this platform. It's strange, but if i now increase the drift tolerance i think i could live with it (as there are no corrections happening any more).
I set verbosity to 3 only briefly to provide the logs.
It's good that you've made some headway. It might be worth setting the interpolation to "basic"
just to see what happens.
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,
i have been struggling recently with the symptom that after some time of playback the audio output is completely distorted. So before digging further into the issue, maybe someone here has an idea..
(I'm fine if you disregard this issue as off-topic)
My setup is a SoC with a dual-core Atom (CE2752@2GHz) running an embedded linux (buildroot), using alsa to connect a USB DAC (iFi Zen DAC, so not the cheapest one).
From what can be seen from the logs, the output is a little bit too slow (44066Hz), so there is a fair amount of overrun. Without sox resampling, i hear faint crackling when i play a pure sine. Enabling sox, it runs for a while (in the range of seconds to minutes/hours) before all of a sudden the audio is more or less crap (and loud!). CPU load is low, the measured time for resampling (5) is well below the "sox threshold".
Below are the stats, where output ran fine for ~two minutes when this happens before the last line (input comes from an iphone 11). Settings are default:
So my questions are:
Now i wonder what could be the reason for this:
Since i don't remember this happening until recently, i wonder if an oscillator/pll has degraded. I have a piece of spare hardware, but before i exchange oscillators i would like explore a potential software solution.
Note that on mpd (which also runs on this setup) i get occasional drop-outs (ca 1sec), which likely have the same reason. From what i read the way shairport-sync does the adjustment is not how it's done in mpd (it uses sox/libsamplerate before sending towards the DAC, not caring about the true output rate).
Thanks for any idea or pointers where to find more information!