mikebrady / shairport-sync

AirPlay and AirPlay 2 audio player
Other
7.2k stars 571 forks source link

Active_start topic is not sent #1450

Closed DrNeoLamafa closed 2 years ago

DrNeoLamafa commented 2 years ago

Hello.

1) I use MQTT topics active_start and active_end, but they are not sent when I connect via airplay. They are sent, when I press play or pause on my smartphone. It's as if the play_start and play_end are being send topics. 2) I know this doesn't apply to shairport, but maybe you can help me. When I press play/pause or rewind a track, I hear crackling/clicks in the speakers. It seems to me that the problem is with alsa, but I do not know what to do. My configuration is orangepi 3 LTS and Ubuntu 18.04 Linux core 4.9.118. ALSA backend.

4.1-dev-231-g3c278493-AirPlay2-OpenSSL-Avahi-ALSA-soxr-metadata-mqtt-sysconfdir:/etc

mqtt =
{
        enabled = "yes"; // set this to yes to enable the mqtt-metadata-service
        hostname = "192.168.1.124"; // Hostname of the MQTT Broker
        port = 1883; // Port on the MQTT Broker to connect to
        username = "mqtt"; //set this to a string to your username in order to enable username authentication
        password = "mqtt"; //set this to a string you your password in order to enable username & password authentication
//      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 = "shairport"; //MQTT topic where this instance of shairport-sync should publish. If not set, the general.name value is used.
        publish_raw = "no"; //whether to publish all available metadata under the codes given in the 'metadata' docs.
        publish_parsed = "yes"; //whether to publish a small (but useful) subset of metadata under human-understandable topics
//      empty_payload_substitute = "--"; // MQTT messages with empty payloads often are invisible or have special significance to MQTT brokers and readers.
//    To avoid empty payload problems, the string here is used instead of any empty payload. Set it to the empty string -- "" -- to leave the payload empty.
//      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 = "shairport"; //MQTT topic where this instance of shairport-sync should publish. If not set, the general.name value is used.
        publish_raw = "no"; //whether to publish all available metadata under the codes given in the 'metadata' docs.
        publish_parsed = "yes"; //whether to publish a small (but useful) subset of metadata under human-understandable topics
//      empty_payload_substitute = "--"; // MQTT messages with empty payloads often are invisible or have special significance to MQTT brokers and readers.
//    To avoid empty payload problems, the string here is used instead of any empty payload. Set it to the empty string -- "" -- to leave the payload empty.
//      Currently published topics:artist,album,title,genre,format,songalbum,volume,client_ip,
//      Additionally, messages at the topics play_start,play_end,play_flush,play_resume are published
        publish_cover = "yes"; //whether to publish the cover over mqtt in binary form. This may lead to a bit of load on the broker
//      enable_remote = "no"; //whether to remote control via MQTT. RC is available under `topic`/remote.
//      Available commands are "command", "beginff", "beginrew", "mutetoggle", "nextitem", "previtem", "pause", "playpause", "play", "stop", "playresume", "shuffle_songs", "volumedown", "volumeup"
};
mikebrady commented 2 years ago

Thanks for the post.

  1. The active_start and active_end messages are sent when a play begins and ends, not when a device connects to Shairport Sync.
  2. The crackle may be caused by the DAC being turned off and on again. There is a setting to prevent this — disable_standby_mode — which might be worth trying.
mikebrady commented 2 years ago

Hello again. You question give me an idea, so I've added two new messages -- conn and disc for AirPlay 2 only operation. They are sent when Shairport Sync is selected and deselected respectively. Maybe they might be useful. In MQTT they should show up as raw messages.

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.