mikebrady / shairport-sync

AirPlay and AirPlay 2 audio player
Other
7.3k stars 574 forks source link

No metadata over udp #1408

Closed Joey-1970 closed 2 years ago

Joey-1970 commented 2 years ago

Hello!

I'm new with shairport-sync. I want to use metadata over udp. My config:

general = {
  name = "Caravan";
  output_backend = "pa";
}

metadata = {
  enabled = "yes";
  include_cover_art = "yes";
  cover_art_cache_directory = "/tmp/shairport-sync/.cache/coverart";
  socket_address="127.0.0.1";
  socket_port=5999;
  socket_msglength=2500;
}

sessioncontrol = {
  session_timeout = 20;
};

I see that there is a change bei the cover-file, but I don't get metadata over port 5999. Did I forget something?

Joachim

mikebrady commented 2 years ago

Thanks for the post. Let me check it out. What are you using to [try to] listen to the metadata on UDP?

Joey-1970 commented 2 years ago

Hello Mike, thanks for your reply. I try a udp-socket from an other (home-automation-)software. I read more and maybe I do not have install this udp-feature? shairport-sync -V says:

3.3.7-libdaemon-OpenSSL-Avahi-ALSA-jack-pa-dummy-stdout-pipe-soxr-convolution-metadata-mqtt-dbus-mpris-sysconfdir:/etc

Joachim

mikebrady commented 2 years ago

Hi Joachim. Thanks for the post. You don't need to install the feature -- once metadata is in the configuration and the settings have been configured, it will send the metadata over UDP.

AFAIK, it's working okay -- I've checked on a later version and it seems to be sending UDP packets as appropriate. I'll do a little more checking.

mikebrady commented 2 years ago

[Update] Just checked in Version 3.3.9 and it certainly is sending UDP packets. Then I checked for packets at port 5999:

$ sudo netcat -ul 5999

and, sure enough, data was getting through.

Joey-1970 commented 2 years ago

Hello Mike, many thanks for your reply. If I do "sudo netcat -ul 5999", nothing ist append untel I press ctrl C...

I try MQTT too:

general = {
  name = "Caravan";
  output_backend = "pa";
}

metadata = {
  enabled = "yes";
  include_cover_art = "yes";
  cover_art_cache_directory = "/tmp/shairport-sync/.cache/coverart";
  socket_address="127.0.0.1";
  socket_port=5999;
  socket_msglength=2500;
}

mqtt = {
  enabled = "yes"
  hostname = "127.0.0.1";
  port = 1883;
  username = "pi";
  password = "ips";
  capath = NULL; //set this to the folder with the CA-Certificates to be accepted for the server certificate. If not set, TLS is not used
  cafile = NULL; //this may be used as an (exclusive) alternative to capath with a single file for all ca-certificates
  certfile = NULL; //set this to a string to a user certificate to enable MQTT Client certificates. keyfile must also be set!
  keyfile = NULL; //private key for MQTT Client authentication
  topic = NULL;
  publish_raw = "yes";
  publish_parsed = "yes";
  publish_cover = "yes";
  enable_remote = "yes";
}

sessioncontrol = {
  session_timeout = 20;
};

But I get no metadata... It is an Reaspberry Pi 4 4GB with Raspberry Pi OS Bulleye. My home-automation-software is on the same system...

Any idea?

Joachim

mikebrady commented 2 years ago

Thanks. I’ll have to try it out. Could you update to the latest version (3.3.9) when you get a chance, please? Then we will be working on the same code.

Joey-1970 commented 2 years ago

..when you give me a "instruction" how to do it I will do it...;-)

mikebrady commented 2 years ago

Sure thing. Actually I just checked 3.3.7 and the metadata UDP feed isn't working on it (apologies!), so 3.3.9 should solve that problem.

There is a guide at UPDATING.md which -- depending on how you installed 3.3.7 -- might point you to INSTALL.md.

Please read it carefully and follow it closely. You should be careful to ensure that all vestiges of the present installation, except for the configuration file at /etc/shairport-sync.conf, are removed.

Joey-1970 commented 2 years ago

Hello Mike, may thanks for your support! But I think this not my day: `pi@RPiCaravan:~ $ git clone https://github.com/mikebrady/shairport-sync.git Klone nach 'shairport-sync' ...

remote: Enumerating objects: 17360, done.

remote: Counting objects: 100% (2425/2425), done.

remote: Compressing objects: 100% (965/965), done.

remote: Total 17360 (delta 1499), reused 2336 (delta 1438), pack-reused 14935

Empfange Objekte: 100% (17360/17360), 9.24 MiB | 9.71 MiB/s, fertig.

Löse Unterschiede auf: 100% (11706/11706), fertig.

pi@RPiCaravan:~ $ cd shairport-sync

pi@RPiCaravan:~/shairport-sync $ autoreconf -fi

-bash: autoreconf: Kommando nicht gefunden. (Command not found)`

Why this don't work?

Joachim

mikebrady commented 2 years ago

You need to install all those tools. See here.

Joey-1970 commented 2 years ago

Hello Mike, after hours of try and error it don't run. shairport-sync -V says

3.3.9-OpenSSL-Avahi-ALSA-soxr-metadata-mqtt-dbus-sysconfdir:/etc 

aI ke a short config to find the mistake:

general = {
  name = "Caravan";
}

metadata = {
  enabled = "yes";
  include_cover_art = "yes";
  cover_art_cache_directory = "/tmp/shairport-sync/.cache/coverart";
  socket_address="127.0.0.1";
  socket_port=5999;
  socket_msglength=2500;
}

sessioncontrol = {
  session_timeout = 20;
};

systemctl status shairport-sync.service:

● shairport-sync.service - Shairport Sync - AirPlay Audio Receiver
     Loaded: loaded (/lib/systemd/system/shairport-sync.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/shairport-sync.service.d
             └─override.conf
     Active: activating (start-pre) since Sat 2022-01-22 18:26:19 CET; 504ms ago
       Docs: man:shairport-sync(7)
             file:///usr/share/doc/shairport-sync/README.md.gz
             https://github.com/mikebrady/shairport-sync
Cntrl PID: 2279 (sleep)
      Tasks: 1 (limit: 4915)
        CPU: 15ms
     CGroup: /system.slice/shairport-sync.service
             └─2279 /bin/sleep 3

Jan 22 18:26:19 RPiCaravan systemd[1]: Starting Shairport Sync - AirPlay Audio Receiver...

But I can't find it on Airplay a target...

Joachim

mikebrady commented 2 years ago

Thanks for the report. This is what I see for a correctly set up service:

● shairport-sync.service - Shairport Sync - AirPlay Audio Receiver
     Loaded: loaded (/lib/systemd/system/shairport-sync.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2022-01-24 10:27:54 CET; 22s ago
   Main PID: 95768 (shairport-sync)
      Tasks: 12 (limit: 2268)
     Memory: 4.9M
     CGroup: /system.slice/shairport-sync.service
             └─95768 /usr/local/bin/shairport-sync

Jan 24 10:27:54 ubuntu2004 systemd[1]: Started Shairport Sync - AirPlay Audio Receiver.

It looks as if your version of there service is not starting up properly.

So, let me suggest that you ensure you totally remove any script / service / startup files (as mentioned in the update and installing guides) and then to a $ sudo make install to (re)install them and try starting the service again.

Joey-1970 commented 2 years ago

Hello Mike,

many thanks for your support! Delete the files and reinstall make that the server run again! :-)

My config file now:

metadata = {
  enabled = "yes";
  include_cover_art = "yes";
  cover_art_cache_directory = "/tmp/shairport-sync/.cache/coverart";
  socket_address="127.0.0.1";
  socket_port=5999;
  socket_msglength=2500;
};

general = {
  name = "Caravan";
};

But metadata still don't run, after sudo netcat -ul 5999 nothing happens...

I try mqtt with this part:

mqtt = {
  enabled = "yes"
  hostname = "127.0.0.1";
  port = 1883;
  username = "pi";
  password = "ips";
  capath = NULL; //set this to the folder with the CA-Certificates to be accepted for the server certificate. If not set, TLS is not used
  cafile = NULL; //this may be used as an (exclusive) alternative to capath with a single file for all ca-certificates
  certfile = NULL; //set this to a string to a user certificate to enable MQTT Client certificates. keyfile must also be set!
  keyfile = NULL; //private key for MQTT Client authentication
  topic = NULL;
  publish_raw = "yes";
  publish_parsed = "yes";
  publish_cover = "yes";
  enable_remote = "yes";
}

But then the server stop!

Joachim

mikebrady commented 2 years ago

Hi Joachim. Thanks for the update, and well done getting the system running. It can be quite tricky if you haven't done it before. Would you be kind enough to do post the results of the following commands, please? Here the are:

$ shairport-sync -C

and

$ systemctl status shairport-sync
Joey-1970 commented 2 years ago

Hello Mike,

here the output:

pi@RPiCaravan:~ $ shairport-sync -C
pi@RPiCaravan:~ $ systemctl status shairport-sync
● shairport-sync.service - Shairport Sync - AirPlay Audio Receiver
     Loaded: loaded (/lib/systemd/system/shairport-sync.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/shairport-sync.service.d
             └─override.conf
     Active: active (running) since Mon 2022-01-24 19:55:33 CET; 20h ago
    Process: 22221 ExecStartPre=/bin/sleep 3 (code=exited, status=0/SUCCESS)
   Main PID: 22223 (shairport-sync)
      Tasks: 12 (limit: 4915)
        CPU: 10min 8.791s
     CGroup: /system.slice/shairport-sync.service
             └─22223 /usr/local/bin/shairport-sync

Jan 24 19:55:30 RPiCaravan systemd[1]: Starting Shairport Sync - AirPlay Audio Receiver...
Jan 24 19:55:33 RPiCaravan systemd[1]: Started Shairport Sync - AirPlay Audio Receiver.

Joachim

Joey-1970 commented 2 years ago

Hello Mike,

I now change the config to:

general = {
  name = "Caravan";
};

mqtt = {
  enabled = "yes"
  hostname = "127.0.0.1";
  port = 1883;
  publish_raw = "yes";
  publish_parsed = "yes";
  publish_cover = "yes";
  enable_remote = "yes";
};

Now I get data in my software over MQTT!

Thats a very good thing! I will look how it will work now!

Joachim

mikebrady commented 2 years ago

Excellent news, Joachim!

Joey-1970 commented 2 years ago

Hello Mike,

many thanks for your support!!

For information:

Did this run in your application?

Joachim

github-actions[bot] commented 2 years ago

This issue has been inactive for 45 days so will be closed 7 days from now. To prevent this, please remove the "stale" label or post a comment.