Closed michaelshumshum closed 7 months ago
Thanks for the post.
Since you have not configured it otherwise, Shairport Sync is directing the output to the ALSA default
device. The default device will be set up to direct audio into the sound server. The thing is, this is done for the logged-in user only, so it won't be set up for the user that Shairport Sync runs under when it's a service -- that user is called shairport-sync
. The default might not be set at all, or it might be set to a hardware device that may be unsuitable (e.g. only accepts audio at 48,000 frames per second) or already in use (see below).
You can try to direct the output to the ALSA hardware device. Do $shairport-sync -h
to get an approximate list or use sps-alsa-explore
to get an accurate list. A potential problem here, of course, is that the sound server may already have taken their device over.
There's more at PulseAudioAndPipeWire.md.
Thanks fo the reply.
When using aplay -l
to display the audio devices, none are detected. When using your sps-alsa-explore
, it states that the /dev/snd/
directory cannot be found. I am not surprised that there are no audio devices detected since this is in a WSL environment.
I have tried changing the audio backend to PA and have also tried changing the ALSA output device to PA. I have rebuilt the shairport-sync
again using different configuration and sometimes it doesn't even work in the commandline when rebuilding.
I solved it!!
Completely wasn't related to audio device issues. In the config file, I set resync_threshold_in_seconds = 0
, which disabled resynchronization. I was tinkering with setting it higher and lower and saw that setting it higher decreased sync errors. Disabling it completely removed all issues.
That was kind of unintuitive in my opinion, where resyncing caused even more sync issues.
Good stuff. I don't have a machine capable of running the WSL environment, I'm afraid, but from your results, it seems as if the audio service is providing either very coarse synchronisation information or no information at all to Shairport Sync when it's running as a service.
What I don't understand, is why it should be different when Shairport Sync is invoked from the command line.
What happened?
Running
shairport-sync -v --statistics
straight does not show any issues. Only very infrequent stutters. When running as a systemctl service, constant stuttering where audio is essentially inaudible.Relevant log output
System Information.
Personal PC: I5 10400F - 32 GB RAM ... PC spec is definitely not the problem.
Running on Ubuntu 22.04.2 on WSL2. Using Hyper-V Virtual Switch that bridges to external network. Uses a PulseAudio server running on Windows, which Ubuntu routes to.
Configuration Information.
PulseAudio or PipeWire installed?
How did you install Shairport Sync?
Built from source
Check previous issues