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 Problem: (AirplayStream) Error opening metadata pipe #672

Closed
patrickschaper opened this issue Aug 15, 2020 · 25 comments
Closed

Shairport Problem: (AirplayStream) Error opening metadata pipe #672

patrickschaper opened this issue Aug 15, 2020 · 25 comments
Labels
next release fixed in develop branch and will be part of the next release

Comments

@patrickschaper
Copy link

patrickschaper commented Aug 15, 2020

For some reason I get a repetitive message saying [Error] (AirplayStream) Error opening metadata pipe, retrying in 500ms. Error: assign: Bad file descriptor although meta data support seems to be enabled by shairport.

System: Raspbian Buster

snapserver output

2020-08-15 16-37-36.722 [Info] (main) Adding stream: airplay:///shairport-sync?name=Airplay&devicename=Multiroom
2020-08-15 16-37-36.722 [Notice] (init) Settings file: "/home/pi/.config/snapserver/server.json"
2020-08-15 16-37-36.732 [Info] (Avahi) Adding service 'Snapcast'
2020-08-15 16-37-36.738 [Info] (start) Creating TCP acceptor for address: 0.0.0.0, port: 1705
2020-08-15 16-37-36.739 [Info] (start) Creating HTTP acceptor for address: 0.0.0.0, port: 1780
2020-08-15 16-37-36.739 [Info] (PcmStream) PcmStream sampleFormat: 44100:16:2
2020-08-15 16-37-36.739 [Info] (PcmStream) metadata={
2020-08-15 16-37-36.739 [Info] (PcmStream)     "STREAM": "Airplay"
2020-08-15 16-37-36.739 [Info] (PcmStream) }
2020-08-15 16-37-36.740 [Info] (onMetaChanged) onMetaChanged (Airplay)
2020-08-15 16-37-36.740 [Info] (AirplayStream) Metadata support not enabled (HAS_EXPAT not defined)
2020-08-15 16-37-36.740 [Info] (start) Stream: {"fragment":"","host":"","path":"/shairport-sync","query":{"chunk_ms":"20","codec":"flac","devicename":"Multiroom","name":"Airplay","sampleformat":"44100:16:2"},"raw":"airplay:////shairport-sync?chunk_ms=20&codec=flac&devicename=Multiroom&name=Airplay&sampleformat=44100:16:2","scheme":"airplay"}
2020-08-15 16-37-36.750 [Error] (AirplayStream) Error opening metadata pipe, retrying in 500ms. Error: assign: Bad file descriptor
2020-08-15 16-37-36.750 [Info] (start) Creating stream acceptor for address: 0.0.0.0, port: 1704
2020-08-15 16-37-36.750 [Info] (main) number of threads: 4, hw threads: 4
2020-08-15 16-37-36.768 [Notice] (handleAccept) StreamServer::NewConnection: 192.168.178.59
2020-08-15 16-37-36.781 [Info] (onMessageReceived) Hello from b8:27:eb:dd:3c:58, host: bathroom, v0.20.0, ClientName: Snapclient, OS: Raspbian GNU/Linux 10 (buster), Arch: armv7l, Protocol version: 2
2020-08-15 16-37-36.828 [Notice] (handleAccept) StreamServer::NewConnection: 192.168.178.51
2020-08-15 16-37-36.840 [Info] (onMessageReceived) Hello from b8:27:eb:13:37:2d, host: living-room, v0.20.0, ClientName: Snapclient, OS: Raspbian GNU/Linux 10 (buster), Arch: armv7l, Protocol version: 2
2020-08-15 16-37-37.196 [Notice] (handleAccept) StreamServer::NewConnection: 192.168.178.10
2020-08-15 16-37-37.207 [Info] (onMessageReceived) Hello from b8:27:eb:d6:53:08, host: main, v0.20.0, ClientName: Snapclient, OS: Raspbian GNU/Linux 10 (buster), Arch: armv7l, Protocol version: 2
2020-08-15 16-37-37.250 [Error] (AirplayStream) Error opening metadata pipe, retrying in 500ms. Error: assign: Bad file descriptor
2020-08-15 16-37-37.392 [Notice] (handleAccept) StreamServer::NewConnection: 192.168.178.89
2020-08-15 16-37-37.404 [Info] (onMessageReceived) Hello from b8:27:eb:85:7c:bd, host: kitchen, v0.20.0, ClientName: Snapclient, OS: Raspbian GNU/Linux 10 (buster), Arch: armv7l, Protocol version: 2
2020-08-15 16-37-37.641 [Info] (Avahi) Service 'Snapcast' successfully established.
2020-08-15 16-37-37.685 [Notice] (handleAccept) StreamServer::NewConnection: 192.168.178.61
2020-08-15 16-37-37.697 [Info] (onMessageReceived) Hello from b8:27:eb:bd:06:a0, host: dressing-room, v0.20.0, ClientName: Snapclient, OS: Raspbian GNU/Linux 10 (buster), Arch: armv7l, Protocol version: 2
2020-08-15 16-37-37.750 [Error] (AirplayStream) Error opening metadata pipe, retrying in 500ms. Error: assign: Bad file descriptor
2020-08-15 16-37-38.251 [Error] (AirplayStream) Error opening metadata pipe, retrying in 500ms. Error: assign: Bad file descriptor
2020-08-15 16-37-38.751 [Error] (AirplayStream) Error opening metadata pipe, retrying in 500ms. Error: assign: Bad file descriptor
2020-08-15 16-37-39.251 [Error] (AirplayStream) Error opening metadata pipe, retrying in 500ms. Error: assign: Bad file descriptor
2020-08-15 16-37-39.752 [Error] (AirplayStream) Error opening metadata pipe, retrying in 500ms. Error: assign: Bad file descriptor

Two thing that fell into my eye.
[Info] (AirplayStream) Metadata support not enabled (HAS_EXPAT not defined)
and of course the actual error
[Error] (AirplayStream) Error opening metadata pipe, retrying in 500ms. Error: assign: Bad file descriptor

I did a ps to see with what parameters shairport-synv was started. I then started it separately with -vvvparameter and got this output.
command: /usr/local/bin/shairport-sync --name=Multiroom --output=stdout --use-stderr --get-coverart --metadata-pipename=/tmp/shairmeta.23645.5000 --port=5000 -vvv
output:

         0.000413332 "shairport.c:448" looking for configuration file at full path "/usr/local/etc/shairport-sync.conf"
         0.000773539 "shairport.c:1703" Started!
         0.000110676 "shairport.c:1730" software version: "3.3.7rc1-OpenSSL-Avahi-stdout-pipe-metadata-sysconfdir:/usr/local/etc"
         0.000039115 "shairport.c:1736" log verbosity is 3.
         0.000059062 "shairport.c:1751" The processor is running little-endian.
         0.000036719 "shairport.c:1784" disable resend requests is off.
         0.000029270 "shairport.c:1788" diagnostic_drop_packet_fraction is 0.000000. A value of 0.0 means no packets will be dropped deliberately.
         0.000035469 "shairport.c:1789" statistics_requester status is 0.
         0.000027448 "shairport.c:1794" rtsp listening port is 5000.
         0.000028958 "shairport.c:1795" udp base port is 6001.
         0.000026094 "shairport.c:1796" udp port range is 10.
         0.000027031 "shairport.c:1797" player name is "Multiroom".
         0.000026771 "shairport.c:1798" backend is "stdout".
         0.000029739 "shairport.c:1799" run_this_before_play_begins action is "(null)".
         0.000028333 "shairport.c:1800" run_this_after_play_ends action is "(null)".
         0.000081042 "shairport.c:1801" wait-cmd status is 0.
         0.000032083 "shairport.c:1802" run_this_before_play_begins may return output is 0.
         0.000028750 "shairport.c:1803" run_this_if_an_unfixable_error_is_detected action is "(null)".
         0.000030677 "shairport.c:1804" run_this_before_entering_active_state action is  "(null)".
         0.000027343 "shairport.c:1805" run_this_after_exiting_active_state action is  "(null)".
         0.000027084 "shairport.c:1806" active_state_timeout is  10.000000 seconds.
         0.000034947 "shairport.c:1807" mdns backend "(null)".
         0.000027344 "shairport.c:1808" userSuppliedLatency is 0.
         0.000082031 "shairport.c:1811" interpolation setting is "basic".
         0.000081927 "shairport.c:1812" interpolation soxr_delay_threshold is 30.
         0.000076979 "shairport.c:1813" resync time is 0.050000 seconds.
         0.000080885 "shairport.c:1814" allow a session to be interrupted: 0.
         0.000076718 "shairport.c:1815" busy timeout time is 120.
         0.000075417 "shairport.c:1816" drift tolerance is 0.001995 seconds.
         0.000079062 "shairport.c:1817" password is "(null)".
         0.000076250 "shairport.c:1818" ignore_volume_control is 0.
         0.000074947 "shairport.c:1822" volume_max_db is not set
         0.000075833 "shairport.c:1824" volume range in dB (zero means use the range specified by the mixer): 0.
         0.000078594 "shairport.c:1828" volume_range_combined_hardware_priority (1 means hardware mixer attenuation is used first) is 0.
         0.000079114 "shairport.c:1830" playback_mode is 0 (0-stereo, 1-mono, 1-reverse_stereo, 2-both_left, 3-both_right).
         0.000080781 "shairport.c:1831" disable_synchronization is 0.
         0.000074896 "shairport.c:1832" use_mmap_if_available is 1.
         0.000077395 "shairport.c:1834" output_format automatic selection is enabled.
         0.000075469 "shairport.c:1838" output_rate automatic selection is enabled.
         0.000078854 "shairport.c:1842" audio backend desired buffer length is 1.000000 seconds.
         0.000079427 "shairport.c:1844" audio_backend_buffer_interpolation_threshold_in_seconds is 0.000000 seconds.
         0.000078905 "shairport.c:1845" audio backend latency offset is 0.000000 seconds.
         0.000143385 "shairport.c:1847" audio backend silence lead-in time is "auto".
         0.000075781 "shairport.c:1851" zeroconf regtype is "_raop._tcp".
         0.000077083 "shairport.c:1852" decoders_supported field is 1.
         0.000074740 "shairport.c:1853" use_apple_decoder is 0.
         0.000093802 "shairport.c:1854" alsa_use_hardware_mute is 0.
         0.000076197 "shairport.c:1858" no special mdns service interface was requested.
         0.000164270 "shairport.c:1862" configuration file name "/usr/local/etc/shairport-sync.conf" resolves to "/usr/local/etc/shairport-sync.conf".
         0.000096615 "shairport.c:1868" metadata enabled is 1.
         0.000082239 "shairport.c:1869" metadata pipename is "/tmp/shairmeta.23645.5000".
         0.000078073 "shairport.c:1871" metadata socket address is "(null)" port 0.
         0.000080468 "shairport.c:1872" metadata socket packet size is "500".
         0.000076719 "shairport.c:1873" get-coverart is 1.
         0.000074478 "shairport.c:1891" loudness is 0.
         0.000074219 "shairport.c:1892" loudness reference level is -20.000000
         0.000502290 "rtsp.c:157" Creating metadata queue "pipe".
         0.000080885 "rtsp.c:157" Creating metadata queue "multicast".
         0.014819271 "mdns_avahi.c:209" avahi: service 'C72BFE8537E4@Multiroom' group is not yet committed.
         0.003713685 "mdns_avahi.c:244" avahi: request to add "_raop._tcp" service with metadata
         0.002022545 "mdns_avahi.c:375" avahi_dacp_monitor_start Avahi DACP monitor successfully started
         0.000603070 "mdns_avahi.c:213" avahi: service 'C72BFE8537E4@Multiroom' group is registering.
         0.911547311 "mdns_avahi.c:180" avahi: service 'C72BFE8537E4@Multiroom' successfully added.

shairport-sync had been built with ./configure --with-stdout --with-avahi --with-ssl=openssl --with-metadata --with-pipe like in issue #622

/usr/local/etc/shairport-sync.conf is empty
and /etc/shairport-sync.conf is a copy of /etc/shairport-sync.conf.sample and in its original state.

/etc/snapserver.conf has the following changes
stream = airplay:///shairport-sync?name=Airplay&devicename=Multiroom
and
codec = ogg

Looks all more or less fine to me. What can be wrong?

@patrickschaper
Copy link
Author

By the way: Everything else works fine

@lealoureiro
Copy link

hello!

I have same issue

@badaix
Copy link
Owner

badaix commented Aug 16, 2020

Looks like it has been build without this expat support?
Is it from the Debian package or did you compile it from source?
(Disclaimer: I'm a lucky non iDevice owner and just merged this meta data feature from a pull request)

@lealoureiro
Copy link

i compiled shairport-sync from source with commands referred in snapcast docs

@badaix
Copy link
Owner

badaix commented Aug 16, 2020

Ok, but I'm talking about snapcast. Expat is an XML library, I guess that shairport sync provides meta information in XML format

@lealoureiro
Copy link

snapcast I installed from the Debian package

@badaix
Copy link
Owner

badaix commented Aug 16, 2020

The development snapshot is now built with expat:
develop_snapshot_amd64
develop_snapshot_armhf

@patrickschaper
Copy link
Author

Looks like it has been build without this expat support?
Is it from the Debian package or did you compile it from source?
(Disclaimer: I'm a lucky non iDevice owner and just merged this meta data feature from a pull request)

Used the release package snapserver_0.20.0-1_armhf.deb

@badaix
Copy link
Owner

badaix commented Aug 17, 2020

Can you please test the development snapshot linked above?

@patrickschaper
Copy link
Author

The development snapshot is now built with expat:
develop_snapshot_amd64
develop_snapshot_armhf

I cleaned everything up and then used the 0.21 development release but it did not create any config files.
Neither did the 0.20 development release create any config files.
So I used the 0.20 public release again and then upgraded with the 0.21 development version.

Now everything is there but the error still exists. Repeating [Error] (AirplayStream) Error opening metadata pipe, retrying in 500ms. Error: assign: Bad file descriptor

snapserver --version: snapserver v0.21.0

@badaix
Copy link
Owner

badaix commented Aug 17, 2020

What config file is missing? /etc/snapserver.conf?
Does the 0.21 still print this log line?:

2020-08-15 16-37-36.740 [Info] (AirplayStream) Metadata support not enabled (HAS_EXPAT not defined)

Did you compile Shairport-sync with the --with-metadata flag, as descibed here?

@lealoureiro
Copy link

still have same issue with 0.21

i compiled Shairport-sync with this command:

./configure --with-stdout --with-avahi --with-ssl=openssl --with-metadata

@badaix
Copy link
Owner

badaix commented Aug 17, 2020

Does the 0.21 still print this log line?:

2020-08-15 16-37-36.740 [Info] (AirplayStream) Metadata support not enabled (HAS_EXPAT not defined)

Maybe @frafall or @cmfcmf can help out here?

@patrickschaper
Copy link
Author

Did you compile Shairport-sync with the --with-metadata flag, as descibed here?

Yes

@badaix
Copy link
Owner

badaix commented Aug 18, 2020

Does the 0.21 still print this log line?:

2020-08-15 16-37-36.740 [Info] (AirplayStream) Metadata support not enabled (HAS_EXPAT not defined)

@patrickschaper
Copy link
Author

patrickschaper commented Aug 18, 2020

Here is a full reproduction. I'm on a Raspberry Pi 3b with Raspbian Buster.
First, let's clean:

sudo rm $(which shairport-sync)
sudo apt remove -y snapserver
sudo rm -f /etc/snapserver.conf /etc/default/snapserver ~/.config/snapserver/server.json /var/lib/snapserver/server.json
rm -rf ~/shairport-sync

Now let's get a fresh shairport-sync binary.

cd ~
git clone https://github.com/mikebrady/shairport-sync.git
cd shairport-sync
autoreconf -i -f
./configure --with-stdout --with-avahi --with-ssl=openssl --with-metadata
make
sudo make install

shairport-sync --version returns 3.3.7rc1-OpenSSL-Avahi-stdout-metadata-sysconfdir:/usr/local/etc

With shairport-sync being set up. I take the 0.21 deb and install it.
(Downloaded snapshot to my Mac and used scp to copy snapserver_0.21.0-1_armhf.deb to my home directory)

cd ~
sudo apt install -y ./snapserver_0.21.0-1_armhf.deb

No config files
So we create a simple /etc/snapserver.conf with:

[stream]
stream = airplay:///shairport-sync?name=Airplay

Start the server just like that snapserver
and the output shows:

2020-08-18 09-36-46.057 [Notice] (init) Settings file: "/home/pi/.config/snapserver/server.json"
2020-08-18 09-36-46.069 [Info] (Avahi) Adding service 'Snapcast'
2020-08-18 09-36-46.076 [Info] (PcmStream) PcmStream sampleFormat: 48000:16:2
2020-08-18 09-36-46.076 [Info] (PcmStream) metadata={
2020-08-18 09-36-46.076 [Info] (PcmStream)     "STREAM": "default"
2020-08-18 09-36-46.076 [Info] (PcmStream) }
2020-08-18 09-36-46.077 [Info] (Server) onMetaChanged (default)
2020-08-18 09-36-46.077 [Info] (PipeStream) PipeStream mode: create
2020-08-18 09-36-46.077 [Info] (Server) Stream: {"fragment":"","host":"","path":"/tmp/snapfifo","query":{"chunk_ms":"20","codec":"flac","name":"default","sampleformat":"48000:16:2"},"raw":"pipe:////tmp/snapfifo?chunk_ms=20&codec=flac&name=default&sampleformat=48000:16:2","scheme":"pipe"}
2020-08-18 09-36-46.078 [Info] (PipeStream) Stream: default, connect to pipe: /tmp/snapfifo, fd: 9, pipe size: 65536
2020-08-18 09-36-46.078 [Error] (PosixStream) Exception: end of file
2020-08-18 09-36-46.078 [Info] (ControlServer) Creating TCP acceptor for address: 0.0.0.0, port: 1705
2020-08-18 09-36-46.078 [Error] (ControlServer) error creating TCP acceptor: bind: Address already in use, code: system:98
2020-08-18 09-36-46.078 [Info] (ControlServer) Creating HTTP acceptor for address: 0.0.0.0, port: 1780
2020-08-18 09-36-46.079 [Error] (ControlServer) error creating HTTP acceptor: bind: Address already in use, code: system:98
2020-08-18 09-36-46.079 [Info] (StreamServer) Creating stream acceptor for address: 0.0.0.0, port: 1704
2020-08-18 09-36-46.079 [Error] (StreamServer) error creating TCP acceptor: bind: Address already in use, code: system:98
2020-08-18 09-36-46.079 [Info] (main) number of threads: 4, hw threads: 4
2020-08-18 09-36-46.178 [Info] (PipeStream) Stream: default, connect to pipe: /tmp/snapfifo, fd: 11, pipe size: 65536
2020-08-18 09-36-46.279 [Info] (PipeStream) Stream: default, connect to pipe: /tmp/snapfifo, fd: 11, pipe size: 65536
2020-08-18 09-36-46.379 [Info] (PipeStream) Stream: default, connect to pipe: /tmp/snapfifo, fd: 11, pipe size: 65536
2020-08-18 09-36-46.479 [Info] (PipeStream) Stream: default, connect to pipe: /tmp/snapfifo, fd: 11, pipe size: 65536
2020-08-18 09-36-46.580 [Info] (PipeStream) Stream: default, connect to pipe: /tmp/snapfifo, fd: 11, pipe size: 65536
2020-08-18 09-36-46.680 [Info] (PipeStream) Stream: default, connect to pipe: /tmp/snapfifo, fd: 11, pipe size: 65536
2020-08-18 09-36-46.781 [Info] (PipeStream) Stream: default, connect to pipe: /tmp/snapfifo, fd: 11, pipe size: 65536
2020-08-18 09-36-46.881 [Info] (PipeStream) Stream: default, connect to pipe: /tmp/snapfifo, fd: 11, pipe size: 65536
2020-08-18 09-36-46.982 [Info] (PipeStream) Stream: default, connect to pipe: /tmp/snapfifo, fd: 11, pipe size: 65536
2020-08-18 09-36-47.083 [Info] (PipeStream) Stream: default, connect to pipe: /tmp/snapfifo, fd: 11, pipe size: 65536
2020-08-18 09-36-47.128 [Info] (Avahi) Service 'Snapcast' successfully established.
2020-08-18 09-36-47.184 [Info] (PipeStream) Stream: default, connect to pipe: /tmp/snapfifo, fd: 11, pipe size: 65536
2020-08-18 09-36-47.284 [Info] (PipeStream) Stream: default, connect to pipe: /tmp/snapfifo, fd: 11, pipe size: 65536
2020-08-18 09-36-47.384 [Info] (PipeStream) Stream: default, connect to pipe: /tmp/snapfifo, fd: 11, pipe size: 65536
2020-08-18 09-36-47.485 [Info] (PipeStream) Stream: default, connect to pipe: /tmp/snapfifo, fd: 11, pipe size: 65536
2020-08-18 09-36-47.585 [Info] (PipeStream) Stream: default, connect to pipe: /tmp/snapfifo, fd: 11, pipe size: 65536
2020-08-18 09-36-47.685 [Info] (PipeStream) Stream: default, connect to pipe: /tmp/snapfifo, fd: 11, pipe size: 65536

snapserver --version returns snapserver v0.21.0

@badaix
Copy link
Owner

badaix commented Aug 18, 2020

So the expat warning disappeared, one problem solved.
Snapserserver should call the sharepoint binary with --metadata-pipename=/tmp/shairmeta.<pid>.<port>

code:

    pipePath_ = "/tmp/shairmeta." + cpt::to_string(getpid()) + "." + cpt::to_string(port_);
    params_ = params_wo_port_ + " \"--metadata-pipename=" + pipePath_ + "\" --port=" + cpt::to_string(port_);

This stream = airplay:///shairport-sync?name=Airplay will start whatever shairport-sync is in your path (should be fine, because shairport-sync --version seems to start your newly compiled binary), but you could also configure the whole path.
Please check if shairport is actually started with --metadata-pipename=... (e.g. with ps aux|grep shairport), and that the pipe is actually created by shairport. You can also test this on command line: start shairport with --metadata-pipename=/tmp/shairport-pipe and check if it creates /tmp/shairport-pipe and try to cat the pipe.

@badaix
Copy link
Owner

badaix commented Sep 1, 2020

no reponse, closing

@badaix badaix closed this as completed Sep 1, 2020
@zonywhoop
Copy link

I'm running into this same error message:

Nov 29 17:54:36 daplex snapserver[85085]: Error opening metadata pipe, retrying in 500ms. Error: assign: Bad file descriptor
Nov 29 17:54:36 daplex snapserver[85085]: Exception: end of file

I'm running v0.22.0-1 from the debian build along with shairport-sync v3.3.5 from buster-backports. Everything works fine, you just get the error reported. It also looks like snapserver isn't cleaning up old fifo's on close either as is seen below:

ps output showing the processes

snapser+  115873  1.4  0.0 311904 11516 ?        Ssl  19:50   0:07 /usr/bin/snapserver --logging.sink=system --server.datadir=/var/lib/snapserver
snapser+  115887  1.1  0.0 733096 15988 ?        Sl   19:50   0:05 /usr/bin/shairport-sync --name=WholeHouse --output=stdout --use-stderr --get-coverart --metadata-pipename=/tmp/shairmeta.115873.5000 --port=5000

shairmeta files in /tmp

prw-rw-rw- 1 snapserver snapserver 0 Nov 30 19:41 /tmp/shairmeta.115681.5000
prw-rw-rw- 1 snapserver snapserver 0 Nov 30 20:01 /tmp/shairmeta.115873.5000
prw-rw-rw- 1 snapserver snapserver 0 Nov 28 01:34 /tmp/shairmeta.1608.5000
prw-rw-rw- 1 snapserver snapserver 0 Nov 29 17:48 /tmp/shairmeta.84908.5000
prw-rw-rw- 1 snapserver snapserver 0 Nov 29 17:54 /tmp/shairmeta.85085.5000

@badaix badaix reopened this Dec 4, 2020
@badaix
Copy link
Owner

badaix commented Dec 4, 2020

I remember that @cmfcmf fixed this feature with #537 after I broke it with some refactoring. Maybe he can help :)
I've never used it and I don't have Apple hardware, so it's hard for me to dig into it and the original author of this issue stopped responding :(

@badaix badaix added the bug label Dec 4, 2020
@badaix
Copy link
Owner

badaix commented Dec 4, 2020

Just tried it out: compiled and configured shairport-sync and started snapserver:

2020-12-04 23-18-23.346 [Info] (Server) Stream: {"fragment":"","host":"","path":"/home/johannes/Develop/shairport-sync/shairport-sync","query":{"chunk_ms":"20","codec":"flac","name":"shairport","sampleformat":"44100:16:2"},"raw":"airplay:////home/johannes/Develop/shairport-sync/shairport-sync?chunk_ms=20&codec=flac&name=shairport&sampleformat=44100:16:2","scheme":"airplay"}
2020-12-04 23-18-23.347 [Info] (PcmStream) PcmStream: default, sampleFormat: 48000:16:2
2020-12-04 23-18-23.347 [Info] (PcmStream) Stream: default, metadata={
2020-12-04 23-18-23.347 [Info] (PcmStream)     "STREAM": "default"
2020-12-04 23-18-23.347 [Info] (PcmStream) }
2020-12-04 23-18-23.347 [Info] (Server) onMetaChanged (default)
2020-12-04 23-18-23.347 [Info] (PipeStream) PipeStream mode: create
2020-12-04 23-18-23.347 [Info] (Server) Stream: {"fragment":"","host":"","path":"/tmp/snapfifo","query":{"chunk_ms":"20","codec":"flac","name":"default","sampleformat":"48000:16:2"},"raw":"pipe:////tmp/snapfifo?chunk_ms=20&codec=flac&name=default&sampleformat=48000:16:2","scheme":"pipe"}
2020-12-04 23-18-23.348 [Error] (AirplayStream) Error opening metadata pipe, retrying in 500ms. Error: assign: Bad file descriptor
2020-12-04 23-18-23.349 [Error] (PosixStream) Exception: end of file
2020-12-04 23-18-23.349 [Info] (ControlServer) Creating TCP acceptor for address: 0.0.0.0, port: 1705
2020-12-04 23-18-23.349 [Info] (ControlServer) Creating HTTP acceptor for address: 0.0.0.0, port: 1780
2020-12-04 23-18-23.349 [Info] (StreamServer) Creating stream acceptor for address: 0.0.0.0, port: 1704
2020-12-04 23-18-23.349 [Info] (main) number of threads: 4, hw threads: 8
2020-12-04 23-18-23.674 [Notice] (StreamServer) StreamServer::NewConnection: 127.0.0.1
2020-12-04 23-18-23.679 [Info] (Server) Hello from 5c:3a:45:56:e2:b7, host: Laptop, v0.23.0, ClientName: Snapclient, OS: Linux Mint 20, Arch: x86_64, Protocol version: 2
2020-12-04 23-18-23.848 [Info] (AirplayStream) Metadata pipe opened: /tmp/shairmeta.29859.5000
2020-12-04 23-18-23.848 [Info] (AirplayStream) Waiting for metadata, retrying in 2500ms
2020-12-04 23-18-23.998 [Notice] (Avahi) Service name collision, renaming service to 'Snapcast #2'
2020-12-04 23-18-23.998 [Info] (Avahi) Adding service 'Snapcast #2'
2020-12-04 23-18-25.006 [Notice] (ControlServer) ControlServer::NewConnection: 127.0.0.1
2020-12-04 23-18-25.403 [Info] (Avahi) Service 'Snapcast #2' successfully established.
2020-12-04 23-18-26.349 [Info] (AirplayStream) Waiting for metadata, retrying in 2500ms
2020-12-04 23-18-28.849 [Info] (AirplayStream) Waiting for metadata, retrying in 2500ms
2020-12-04 23-18-31.349 [Info] (AirplayStream) Waiting for metadata, retrying in 2500ms
2020-12-04 23-18-33.849 [Info] (AirplayStream) Waiting for metadata, retrying in 2500ms

so everything is fine: snapserver launches shairport-sync and opens the metadata pipe. Please note that the pipe is created by shairport-sync and snapserver just connects to it. In the first attempt the pipe has not been created yet, but 500ms later in the second atttempt snapserver finds and opens the pipe.
The only issue is that shairport-sync doesn't remove the pipe when it exists. So I suggest to report this issue in shairport-sync.

@badaix badaix removed the bug label Dec 4, 2020
@badaix badaix closed this as completed Dec 4, 2020
@badaix badaix reopened this Dec 5, 2020
@badaix
Copy link
Owner

badaix commented Dec 5, 2020

Snapserver will now delete the pipe on exit

@badaix badaix added the next release fixed in develop branch and will be part of the next release label Dec 5, 2020
@badaix badaix closed this as completed Jan 10, 2021
@Wumms
Copy link

Wumms commented Jan 19, 2022

Two thing that fell into my eye.
[Info] (AirplayStream) Metadata support not enabled (HAS_EXPAT not defined)

I had a related error yesterday while trying to compile the developbranch. Solved it by adding -DHAS_EXPAT and -lexpat to the compiler-/ linker flags like this:

ADD_CFLAGS="-I/root/boost_1_78_0 -DHAS_EXPAT" \
ADD_LDFLAGS="-lexpat" \
make

For completeness, the enabled code (https://github.com/badaix/snapcast/blob/master/server/streamreader/airplay_stream.hpp):

// Expat is used in metadata parsing from Shairport-sync.
// Without HAS_EXPAT defined no parsing will occur.
#ifdef HAS_EXPAT
#include <expat.h>
#endif

@xorob0
Copy link

xorob0 commented Feb 5, 2022

I have this issue with Debian packages on 0.26

@yubiuser
Copy link
Contributor

You need to call make with

make HAS_EXPAT=1

see fdcdf8e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next release fixed in develop branch and will be part of the next release
Projects
None yet
Development

No branches or pull requests

7 participants