Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: AirPlay not working on a fresh 8.2.3 install
#1
Hello, 

AirPlay, both 1 and 2 versions, doesn't work on a fresh 8.2.3 install whereas it works on an upgraded one from 8.2.2 to 8.2.3.

I've tried to restart the service from web interface without success so I've used systemctl commands, results below.


Code:
root@moode:~# systemctl status shairport-sync.service
● shairport-sync.service - Shairport Sync - AirPlay Audio Receiver
     Loaded: loaded (/lib/systemd/system/shairport-sync.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:shairport-sync(7)
             file:///usr/share/doc/shairport-sync/README.md.gz
             https://github.com/mikebrady/shairport-sync

shairport-sync.service is disabled by default ?


Code:
root@moode:~# systemctl status shairport-sync.service
● shairport-sync.service - Shairport Sync - AirPlay Audio Receiver
     Loaded: loaded (/lib/systemd/system/shairport-sync.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2022-12-22 06:15:18 EST; 5ms ago
       Docs: man:shairport-sync(7)
             file:///usr/share/doc/shairport-sync/README.md.gz
             https://github.com/mikebrady/shairport-sync
    Process: 3735 ExecStart=/usr/bin/shairport-sync $DAEMON_ARGS (code=exited, status=1/FAILURE)
   Main PID: 3735 (code=exited, status=1/FAILURE)
        CPU: 74ms

Dec 22 06:15:18 moode systemd[1]: shairport-sync.service: Scheduled restart job, restart counter is at 5.
Dec 22 06:15:18 moode systemd[1]: Stopped Shairport Sync - AirPlay Audio Receiver.
Dec 22 06:15:18 moode systemd[1]: shairport-sync.service: Start request repeated too quickly.
Dec 22 06:15:18 moode systemd[1]: shairport-sync.service: Failed with result 'exit-code'.
Dec 22 06:15:18 moode systemd[1]: Failed to start Shairport Sync - AirPlay Audio Receiver.


Romain
Reply
#2
The problem is in the config file /etc/shairport-sync.conf provided with the fresh 8.2.3 install.

It works if you remove line 221 below

Code:
audio_backend_buffer_desired_length_in_seconds' (default 0.2 seconds) ahead of time.

or if you comment it out


Code:
// audio_backend_buffer_desired_length_in_seconds' (default 0.2 seconds) ahead of time.

Romain
Reply
#3
I can repro.

There should only be one occurrence of that line but there are two :-0

I'll investigate.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#4
Looks like the conf file shipped with Shairport-sync 4.1.1 has the parameter name below also as part of a comment line further down in the metadata section of the file.

Code:
audio_backend_buffer_desired_length_in_seconds

In our image builder the stock conf files are manipulated via SED commands to set parameters to their default values for moOde.

Below is result of the SED command that sets the parameter in question.

Code:
pi@moode:~ $ sed -e 's/\/\/.*\(audio_backend_buffer_desired_length_in_seconds\)/\1/' ./shairport-sync.conf | grep audio_backend_buffer_desired_length_in_seconds
audio_backend_buffer_desired_length_in_seconds = 0.2; // If set too small, buffer underflow occurs on low-powered machines.
audio_backend_buffer_desired_length_in_seconds' (default 0.2 seconds) ahead of time.

It correctly modifies the first occurrence of the parameter but it also processes the unexpected second occurrence and leaves it in a broken state with a trailing single quote. This causes shairport-sync to abort with a config file syntax error.

An immediate fix is to run the command below which deletes the comment line containing the second occurrence of the param. Restart Airplay afterwords.

Code:
sudo sed -i "/audio_backend_buffer_desired_length_in_seconds'/d" /etc/shairport-sync.conf

I'll prolly generate bugfix release 8.2.4 b4 end of year.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#5
(12-22-2022, 04:50 PM)Tim Curtis Wrote: Looks like the conf file shipped with Shairport-sync 4.1.1 has the parameter name below also as part of a comment line further down in the metadata section of the file.

Code:
audio_backend_buffer_desired_length_in_seconds

In our image builder the stock conf files are manipulated via SED commands to set parameters to their default values for moOde.

Below is result of the SED command that sets the parameter in question.

Code:
pi@moode:~ $ sed -e 's/\/\/.*\(audio_backend_buffer_desired_length_in_seconds\)/\1/' ./shairport-sync.conf | grep audio_backend_buffer_desired_length_in_seconds
audio_backend_buffer_desired_length_in_seconds = 0.2; // If set too small, buffer underflow occurs on low-powered machines.
audio_backend_buffer_desired_length_in_seconds' (default 0.2 seconds) ahead of time.

It correctly modifies the first occurrence of the parameter but it also processes the unexpected second occurrence and leaves it in a broken state with a trailing single quote. This causes shairport-sync to abort with a config file syntax error.

An immediate fix is to run the command below which deletes the comment line containing the second occurrence of the param. Restart Airplay afterwords.

Code:
sudo sed -i "/audio_backend_buffer_desired_length_in_seconds'/d" /etc/shairport-sync.conf

I'll prolly generate bugfix release 8.2.4 b4 end of year.
Thanks for the explanation Tim
Reply


Forum Jump: