Closed deeeemiss closed 1 year ago
Thanks for the post. Referring to the two issues you mention,
To use Shairport Sync with PulseAudio, you need to build in the pa
backend. To do this, at the ./configure...
step, add in the flag --with-pa
. You may need to add in a library too; if so, the error message will suggest it.
Shairport Sync, unfortunately, does not support the remote control protocols necessary to do this. This is because the protocols have not been published. AFAIK they have not yet been figured out.
Ok thanks for the reply; regard the first problem I already used the flag --with-pa
but later in the process, so after I've installed it and be sure that it works I redo the ./configure
command with the flag but nothing changes. Maybe I have to reinstall everything from the start?
For the second problem it doesn't matter (I found that older devices e.g. iPhone 5s with the latest iOS available the remote works, but with an iPhone Xr with iOS 16.2 it doesn't works, maybe this can be helpful for you).
Thanks again Mike!
Thanks. Regarding the first problem, the sequence should be something like this, just adding in the --with-pa
and adding a $ make clean
for luck:
$ git clone https://github.com/mikebrady/shairport-sync.git
$ cd shairport-sync
$ autoreconf -fi
$ ./configure --sysconfdir=/etc --with-alsa \
--with-soxr --with-avahi --with-ssl=openssl --with-systemd --with-airplay-2 --with-pa
$ make clean
$ make
# make install
Ok, I've done everything with make clean
and it worked (in shairport-sync -h
it shows in available audio backends that was added "pa"), but now there's another problem, when I try to start shairport-sync it shows me this (in the configuration file I've uncommented the line that enable pa audio backend):
fatal error: pa context is not good -- the error message "Connection refused".
Thanks. So, if you stop the Shairport Sync service:
$ sudo systemctl stop shairport-sync
and start it from the command line:
$ shairport-sync -v
does it work then?
Also, could you post the output from $ shairport-sync --displayConfig
again, please?
I've tried to stop the service and restart it with shairport-sync -v
but it doesn't work anyway, here's the output:
0.001991611 "shairport.c:2200" Startup in AirPlay 2 mode, with features 0x405c4a00,0x1c340 on device "e4:5f:01:03:22:18".
0.000122796 "shairport.c:2239" Version String: "4.1.1-2-g6240fd83-AirPlay2-OpenSSL-Avahi-ALSA-pa-soxr-sysconfdir:/etc"
0.000033778 "shairport.c:2258" Command Line: "shairport-sync -v".
0.000114111 "shairport.c:2265" libsodium initialised.
0.000387908 "shairport.c:2290" libgcrypt initialised.
0.000036666 "shairport.c:2294" Log Verbosity is 1.
0.106578963 "audio_pa.c:143" *fatal error: pa context is not good -- the error message "Connection refused".
0.000047926 "shairport.c:1677" emergency exit
shairport-sync --displayConfig
output is this:
>> Display Config Start.
From "uname -a":
Linux raspberrypi 5.15.76-v7l+ #1597 SMP Fri Nov 4 12:14:58 GMT 2022 armv7l GNU/Linux
From /etc/os-release:
Raspbian GNU/Linux 11 (bullseye)
From /sys/firmware/devicetree/base/model:
Raspberry Pi 4 Model B Rev 1.4
Shairport Sync Version String:
4.1.1-2-g6240fd83-AirPlay2-OpenSSL-Avahi-ALSA-pa-soxr-sysconfdir:/etc
Command Line:
shairport-sync --displayConfig
Configuration File:
/etc/shairport-sync.conf
Configuration File Settings:
general :
{
name = "Echo Input - Soggiorno";
output_backend = "pa";
ignore_volume_control = "yes";
};
pa :
{
server = "host";
sink = "Sink Name";
application_name = "Shairport Sync";
};
>> Display Config End.
>> Goodbye!
Thanks. (I edited the comment a little for layout.) Let me suggest that you comment out all the pa
settings and see whether that works from the command line.
Ok, that worked for a little bit but with no audio; so I tried to find a solution because I was thinking it was the bluetooth PulseAudio Service, but it works well and nothing is wrong.
Then I noticed that shairport-sync no more start on boot and when I do the command sudo systemctl status shairport-sync
this is the output:
shairport-sync.service - Shairport Sync - AirPlay Audio Receiver
Loaded: loaded (/lib/systemd/system/shairport-sync.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2022-12-21 11:49:06 CET; 14min ago
Main PID: 675 (code=exited, status=1/FAILURE)
CPU: 154ms
Dec 21 11:49:04 raspberrypi systemd[1]: Started Shairport Sync - AirPlay Audio Receiver.
Dec 21 11:49:06 raspberrypi shairport-sync[675]: Failed to create secure directory (/home/shairport-sync/.config/pulse): No such file or directory
Dec 21 11:49:06 raspberrypi shairport-sync[675]: fatal error: failed to connect to the pulseaudio context -- the error message is "Connection refused".
Dec 21 11:49:06 raspberrypi systemd[1]: shairport-sync.service: Main process exited, code=exited, status=1/FAILURE
Dec 21 11:49:06 raspberrypi systemd[1]: shairport-sync.service: Failed with result 'exit-code'.
I was thinking that maybe the fact that has no volume is a bit related to this problem.
PS: when I start it normal with shairport-sync -v
it works but always without audio.
Sorry also for the layout of the code in the past comment but I didn't know how to edit in that way.
Thanks for the update.
Ok, that worked for a little bit but with no audio...
It would be worth continuing to play with that a little, so try to get audio out of it. What should be happening is that the audio should be routed to the default
audio device, which will be an alsa
"pseudo-device" that routes the audio into the PulseAudio system. The nqptp
daemon should be installed and running, and the firewall should allow ports 319 and 320 to pass UDP traffic.
If you do:
$ shairport-sync -v --statistics
you'll see something a bit like this if audio is coming through to Shairport Sync:
0.039848021 "rtsp.c:4335" Connection 1: Current volume (-24.000000) requested
5.342425102 "rtsp.c:3299" Connection 1. AP2 Buffered Audio Stream.
0.578427968 "player.c:2774" Connection 1: Playback started at frame 3576207123 -- AirPlay 2 Buffered.
7.933596508 "player.c:2591" Sync Error ms | Net Sync PPM | All Sync PPM | Min DAC Queue | Min Buffers | Min Buffer Size | Output FPS (r) | Output FPS (c)
0.000196198 "player.c:2591" 1.66 0.0 0.0 7386 46 230k N/A N/A
7.999195726 "player.c:2591" 0.72 0.0 0.0 7458 46 3214k 44100.00 44100.15
7.991056507 "player.c:2591" 1.11 0.0 0.0 7458 46 3269k 44100.12 44100.27
8.004760257 "player.c:2591" 0.79 0.0 0.0 7462 46 3218k 44100.16 44100.32
8.015777237 "player.c:2591" 0.54 0.0 0.0 7434 46 3224k 44100.14 44100.29
8.000669997 "player.c:2591" 1.04 0.0 0.0 7450 46 3236k 44100.09 44100.24
The exact items on each likes will be different, but each line at an interval of about eight seconds indicates that Shairport Sync is receiving and processing audio.
Then I noticed that
shairport-sync
no more start on boot...
This is because the PulseAudio service is not a "system service"; it's a "user service", which means that it is not available until the user has logged in. Generally, the user has to have logged in through the GUI.
Ok thank you for your replies, in these days I've tried to fix the issues I was having; the issue "no audio" I was having, was fixed by a full fresh install of shairport-sync, because I've done the shairport-sync -v --statistics
before the re-installlation and find out shairport-sync was receiving the audio.
The other issue was the bluetooth and I've fixed in a rough way; I didn't use the bluetooth inside the raspberry because for some reasons it didn't worked (and I've tried a lot of times), instead I've bought a bluetooth transmitter on Amazon and connected to the Raspberry, now it works like a charm.
Thank you so much for your availability, wish you the best.
I created a user service and a timer My shairport-sync conf has all pa references remmed out as MikeBrady suggested. my user system file and user timer files : shairport-sync.service.docx shairport-sync.timer.docx Files should be placed in ~/config/systemd/user/ and the servicefile must be disabled. It will be enabled after boot and when user has loggged in by the shairport-sync.timer (OnBootSec=1min)
I created a user service and a timer My shairport-sync conf has all pa references remmed out as MikeBrady suggested. my user system file and user timer files : shairport-sync.service.docx shairport-sync.timer.docx Files should be placed in ~/config/systemd/user/ and the servicefile must be disabled. It will be enabled after boot and when user has loggged in by the shairport-sync.timer (OnBootSec=1min)
do you mind to explain a bit more how the timer is related to the service file? and how to disable the service file?
What happened?
I have two problems: the first one is that I can't connect Shairport-Sync to PulseAudio, it shows me this error when I try to launch the service with the audio_backend on "pa":
fatal error: Invalid audio backend "pa" selected!
The configuration file is below (general and pa).
The command
shairport-sync -h
shows me this:Available mDNS backends: avahi
Available audio backends: alsa (default)
and nothing more (about audio backends).The second problem I have is that if I play a song with my iPhone on shairport-sync, if I go on my iPad to control music it shows me "Connecting..." and doesn't work, how can I solve that?
Relevant log output
Configuration Information.
From "uname -a": Linux raspberrypi 5.15.76-v7l+ #1597 SMP Fri Nov 4 12:14:58 GMT 2022 armv7l GNU/Linux
From /etc/os-release: Raspbian GNU/Linux 11 (bullseye)
From /sys/firmware/devicetree/base/model: Raspberry Pi 4 Model B Rev 1.4
Shairport Sync Version String: 4.1.1-2-g6240fd83-AirPlay2-OpenSSL-Avahi-ALSA-soxr-sysconfdir:/etc
Command Line: shairport-sync --displayConfig
Configuration File: /etc/shairport-sync.conf
Configuration File Settings: general : { name = "Echo Input - Soggiorno"; ignore_volume_control = "yes"; }; pa : { server = "host"; sink = "Sink Name"; application_name = "Shairport Sync"; };
How did you install Shairport Sync?
Built from source
Check previous issues