Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shairport Sync and Pipewire #1970

Open
mikebrady opened this issue Feb 1, 2025 · 4 comments
Open

Shairport Sync and Pipewire #1970

mikebrady opened this issue Feb 1, 2025 · 4 comments

Comments

@mikebrady
Copy link
Owner

Discussed in #1969

Originally posted by janstadt February 1, 2025
Ive looked through a lot of posts here about how Pipewire and PulseAudio is problematic, but i want to be able to push audio out of one speaker from multiple sources. I use homeassistant to push notifications and airplay to play music. if they both use airplay, the session interruption isnt reliable enough for the setup and i typically get an error where the annoucement doesnt play or is truncated. Enter pipewire. I followed this post and had it working for a while, but now i keep getting this error:

Jan 31 18:24:53 the-kitchen shairport-sync[557]: warning: Shairport Sync's PipeWire backend can not get timing information from the PipeWire system. Is PipeWire running?

pipewire.service is running as a --user service as well as wireplumber.service.

I had working at one point, but now it no longer works on one of my devices (pi 3b with a hifiberry dac).

Version (built with pipewire):
4.3.5-AirPlay2-smi10-OpenSSL-Avahi-pw-soxr-metadata-mqtt-sysconfdir:/etc

Config

>> Display Config Start.

From "uname -a":
 Linux the-kitchen 6.6.62+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.62-1+rpt1 (2024-11-25) aarch64 GNU/Linux

From /etc/os-release:
 Debian GNU/Linux 12 (bookworm)

From /sys/firmware/devicetree/base/model:
 Raspberry Pi 3 Model B Rev 1.2

Shairport Sync Version String:
 4.3.5-AirPlay2-smi10-OpenSSL-Avahi-pw-soxr-metadata-mqtt-sysconfdir:/etc

Command Line:
 shairport-sync --displayConfig

Configuration File:
 /etc/shairport-sync.conf

Configuration File Settings:
 general : 
 {
   name = "The Kitchen";
   output_backend = "pw"; #i've tried with this line commented out as all i have is pw as an option and it shows pw (default)
 };
 sessioncontrol : 
 {
   allow_session_interruption = "yes";
 };
 pw : 
 {
 };

I use snapclient as my other protocol and that works still so i can get audio from there, but not from airplay. Any help would be greatly appreciated.

@mikebrady
Copy link
Owner Author

Thanks for the post. It could be that Shairport Sync is not properly closing the pipewire backend properly so that it can't reopen. Or something. If you could find a quick and reliable way to cause it to misbehave, it would be a big help!

@janstadt
Copy link

janstadt commented Feb 1, 2025

Thanks for creating an issue @mikebrady. I wasnt sure what your desired workflow was so i started with a discussion. Im not 100% certain how to reproduce the issue, but all of my devices are logging that message as well as a memory allocation issue:

Jan 29 17:08:49 lucys-room kernel: __vm_enough_memory: pid: 7641, comm: shairport-sync, not enough memory for the allocation

The devices are still for the most part performing, but there certainly is something happening with pipewire and shairport-sync. I'll take a look and see if i can come up with other ideas.

@janstadt
Copy link

janstadt commented Feb 2, 2025

× shairport-sync.service - Shairport Sync - AirPlay Audio Receiver
     Loaded: loaded (/home/tc/.config/systemd/user/shairport-sync.service; enabled; preset: enabled)
     Active: failed (Result: signal) since Sun 2025-02-02 10:18:50 CST; 2min 42s ago
   Duration: 1w 1d 22h 38min 28.355s
    Process: 540 ExecStart=/usr/local/bin/shairport-sync --log-to-syslog (code=killed, signal=KILL)
   Main PID: 540 (code=killed, signal=KILL)
        CPU: 8h 25min 2.629s

Jan 24 11:40:22 gretas-room systemd[522]: Started shairport-sync.service - Shairport Sync - AirPlay Audio Receiver.
Jan 24 15:19:06 gretas-room shairport-sync[540]: warning: Shairport Sync's PipeWire backend can not get timing information from the PipeWire system. Is PipeWire running?
Jan 24 15:19:06 gretas-room shairport-sync[540]: warning: Shairport Sync's PipeWire backend can not get timing information from the PipeWire system. Is PipeWire running?
Jan 24 15:19:06 gretas-room shairport-sync[540]: warning: Shairport Sync's PipeWire backend can not get timing information from the PipeWire system. Is PipeWire running?
Jan 24 15:19:06 gretas-room shairport-sync[540]: warning: Shairport Sync's PipeWire backend can not get timing information from the PipeWire system. Is PipeWire running?
Feb 02 10:18:50 gretas-room systemd[522]: shairport-sync.service: Main process exited, code=killed, status=9/KILL
Feb 02 10:18:50 gretas-room systemd[522]: shairport-sync.service: Failed with result 'signal'.
Feb 02 10:18:50 gretas-room systemd[522]: shairport-sync.service: Consumed 8h 25min 2.629s CPU time.

Some additional information on another device with shairport that seems to have failed. Requires a restart in order for things to work. When i run systemctl --user restart shairport-sync.service i get:

tc@gretas-room:~ $ systemctl --user restart shairport-sync.service 
Failed to restart shairport-sync.service: Unit avahi-daemon.service not found.

Its running though (as a system level service albeit):

tc@gretas-room:~ $ sudo systemctl status avahi-daemon.service
● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
     Loaded: loaded (/lib/systemd/system/avahi-daemon.service; enabled; preset: enabled)
     Active: active (running) since Fri 2025-01-24 11:40:18 CST; 1 week 1 day ago
TriggeredBy: ● avahi-daemon.socket
   Main PID: 351 (avahi-daemon)
     Status: "avahi-daemon 0.8 starting up."
      Tasks: 2 (limit: 179)
        CPU: 59min 52.803s
     CGroup: /system.slice/avahi-daemon.service
             ├─351 "avahi-daemon: running [gretas-room.local]"
             └─380 "avahi-daemon: chroot helper"

Jan 24 11:40:21 gretas-room avahi-daemon[351]: Joining mDNS multicast group on interface wlan0.IPv6 with address fe80::e794:efe3:181a:c33d.
Jan 24 11:40:21 gretas-room avahi-daemon[351]: New relevant interface wlan0.IPv6 for mDNS.
Jan 24 11:40:21 gretas-room avahi-daemon[351]: Registering new address record for fe80::e794:efe3:181a:c33d on wlan0.*.
Jan 24 11:40:21 gretas-room avahi-daemon[351]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.1.252.
Jan 24 11:40:21 gretas-room avahi-daemon[351]: New relevant interface wlan0.IPv4 for mDNS.
Jan 24 11:40:21 gretas-room avahi-daemon[351]: Registering new address record for 192.168.1.252 on wlan0.IPv4.
Jan 24 11:40:22 gretas-room avahi-daemon[351]: Leaving mDNS multicast group on interface wlan0.IPv6 with address fe80::e794:efe3:181a:c33d.
Jan 24 11:40:22 gretas-room avahi-daemon[351]: Joining mDNS multicast group on interface wlan0.IPv6 with address fdfa:1a1d:3f01:4948:966c:c3ea:2f34:6f0b.
Jan 24 11:40:22 gretas-room avahi-daemon[351]: Registering new address record for fdfa:1a1d:3f01:4948:966c:c3ea:2f34:6f0b on wlan0.*.
Jan 24 11:40:22 gretas-room avahi-daemon[351]: Withdrawing address record for fe80::e794:efe3:181a:c33d on wlan0.

The service

[Unit]
Description=Shairport Sync - AirPlay Audio Receiver
After=sound.target
Requires=avahi-daemon.service
After=avahi-daemon.service
Wants=network-online.target
After=network.target network-online.target

[Service]
ExecStart=/usr/local/bin/shairport-sync --log-to-syslog

[Install]
WantedBy=default.target

After the restart the audio works, but i get a bunch more "Is Pipewire running?" logs from shairport-sync:

Feb 02 10:29:38 gretas-room shairport-sync[541]: warning: Shairport Sync's PipeWire backend can not get timing information from the PipeWire system. Is PipeWire running?
Feb 02 10:29:38 gretas-room shairport-sync[541]: warning: Shairport Sync's PipeWire backend can not get timing information from the PipeWire system. Is PipeWire running?
Feb 02 10:29:38 gretas-room shairport-sync[541]: warning: Shairport Sync's PipeWire backend can not get timing information from the PipeWire system. Is PipeWire running?
Feb 02 10:29:38 gretas-room shairport-sync[541]: warning: Shairport Sync's PipeWire backend can not get timing information from the PipeWire system. Is PipeWire running?
Feb 02 10:29:38 gretas-room shairport-sync[541]: warning: Shairport Sync's PipeWire backend can not get timing information from the PipeWire system. Is PipeWire running?
Feb 02 10:29:38 gretas-room shairport-sync[541]: warning: Shairport Sync's PipeWire backend can not get timing information from the PipeWire system. Is PipeWire running?
Feb 02 10:29:38 gretas-room shairport-sync[541]: warning: Shairport Sync's PipeWire backend can not get timing information from the PipeWire system. Is PipeWire running?
Feb 02 10:29:38 gretas-room shairport-sync[541]: warning: Shairport Sync's PipeWire backend can not get timing information from the PipeWire system. Is PipeWire running?
Feb 02 10:29:38 gretas-room shairport-sync[541]: warning: Shairport Sync's PipeWire backend can not get timing information from the PipeWire system. Is PipeWire running?
Feb 02 10:29:38 gretas-room shairport-sync[541]: warning: Shairport Sync's PipeWire backend can not get timing information from the PipeWire system. Is PipeWire running?

Im sharing different devices here but they're all configured identically with regard to shairport-sync/pipewire/etc.

@mikebrady
Copy link
Owner Author

Thanks. I’m way from machines just now, so it’ll be a few days before I can experiment.

But is it at all possible that the pipewire service has actually disappeared?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants