Airplay crashes, better solution than reboot?

  • Dear All,

    I am using a PC with Tuneblade to stream music to my rpi 3b with libreelec 10.0.0 on it via Airblade. This shows up as "System Audio". There´ is one problem though:

    If I stop libreelec from receiving the stream using Kore on Android by pressing the stop button, I can no longer connect to libreelec with Tuneblade until the rpi has been rebooted. In other words, pressing stop simply crashes or stops the service.

    Now I could just stop the music by disconnecting on Tuneblade, but the thing is that sometimes if I watch a movie via libreelec, it suddenly gets interrupted when I for instance receive an email on the PC, which generates a sound that´s being sent via Airplay. Then when I start the movie again, the Airplay service has been shut down next time I want to hear music via Tuneblade, and I need to reboot the rpi.

    And.. it´s actually convenient for me to get those interruptions from the email program, theyre work related, but I could of course just remember to stop the Tuneblade stream before watching movies and use my mobile instead to warn me about emails, but unfortunately also a ton of other things, that I dont want to be bothered about, when Im watching a movie.

    So what Im looking for is an elegant way to restart Airplay from the shell without having to reboot. I have tried with systemctl restart avahi-daemon, but that didnt do the trick.

    Any advise?

    Thanks in advance!

  • Please provide a full debug log.

    How to post a log (wiki)

    1. Enable debugging in Settings>System Settings>Logging
    2. Restart Kodi
    3. Replicate the problem
    4. Generate a log URL (do not post/upload logs to the forum)

    use "Settings > LibreELEC > System > Paste system logs" or run "pastekodi" over SSH, then post the URL link
  • Thanks,

    I hope it´s ok that I used pastebin instead - wanted to amend a few directory and computer names for my own privacy.


    External Content pastebin.com
    Content embedded from external sources will not be displayed without your consent.
    Through the activation of external content, you agree that personal data may be transferred to third party platforms. We have provided more information on this in our privacy policy.

  • Code
    Nov 29 03:02:46.876670 LibreELEC librespot[851]: *** WARNING *** The program 'librespot' uses the Apple Bonjour compatibility layer of Avahi.
    Nov 29 03:02:46.877042 LibreELEC librespot[851]: *** WARNING *** Please fix your application to use the native API of Avahi!
    Nov 29 03:02:46.877266 LibreELEC librespot[851]: *** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
    Nov 29 03:02:49.220662 LibreELEC wpa_supplicant[412]: wlan0: Failed to initiate sched scan
    Nov 29 03:02:51.374606 LibreELEC pulseaudio[311]: W: [pulseaudio] sap.c: sendmsg() failed: Connection refused

    Can you disable Apple Bonjour somehow on TuneBlade?

    Also consider to update to LE 10.0.3 (use the .update folder method).

  • Before you dig further first fix your power supply issues - RPi is reporting undervoltage which is known to cause all sorts of weird issues

    Code
    RPi throttled=0x50005

    This should read 0x0

    so long,

    Hias

  • Code
    Nov 29 03:02:46.876670 LibreELEC librespot[851]: *** WARNING *** The program 'librespot' uses the Apple Bonjour compatibility layer of Avahi.
    Nov 29 03:02:46.877042 LibreELEC librespot[851]: *** WARNING *** Please fix your application to use the native API of Avahi!
    Nov 29 03:02:46.877266 LibreELEC librespot[851]: *** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
    Nov 29 03:02:49.220662 LibreELEC wpa_supplicant[412]: wlan0: Failed to initiate sched scan
    Nov 29 03:02:51.374606 LibreELEC pulseaudio[311]: W: [pulseaudio] sap.c: sendmsg() failed: Connection refused

    Can you disable Apple Bonjour somehow on TuneBlade?

    Also consider to update to LE 10.0.3 (use the .update folder method).

    No, Tuneblade does not have such an option, but I tried to stop the Apple Bonjour service in Windows, which results in that Tuneblade cannot connect to the Rpi.

    I may try an update, but I always have my worries about new bugs being introduced when updating, so I guess I´ll find time to do a backup of the current system and then do the update.


    Before you dig further first fix your power supply issues - RPi is reporting undervoltage which is known to cause all sorts of weird issues

    Code
    RPi throttled=0x50005

    This should read 0x0

    so long,

    Hias

    Tried that a while ago by connecting a more powerful charger to the pi, but the result was the same.

    Edited once, last by jazzlpunk: Merged a post created by jazzlpunk into this post. (December 1, 2022 at 12:34 AM).

  • Tried that a while ago by connecting a more powerful charger to the pi, but the result was the same.

    Use the official power supply and if you connected bus-powered USB drives remove them or use a powered USB hub. It's really pointless digging futher until you resolved the power issues - would you complain to the mechanics that your car stutters and suddenly stops because you are out of fuel?

    so long,

    Hias

  • Use the official power supply and if you connected bus-powered USB drives remove them or use a powered USB hub. It's really pointless digging futher until you resolved the power issues - would you complain to the mechanics that your car stutters and suddenly stops because you are out of fuel?

    so long,

    Hias

    As mentioned, a charger with sufficient power = reading of 0x0 was tried a while ago with the same result, but I shall glad see if I can dig up an original charger to see if that makes any difference.


    LE 10.0.3 runs fine on my RPi3B+.

    Thanks, what I´m referring to is issues with for instance Airplay, buffering and other stuff that I have seen causing me issues whenever I went from one version to another.

    Edited once, last by jazzlpunk: Merged a post created by jazzlpunk into this post. (December 1, 2022 at 1:46 AM).


  • Thanks, what I´m referring to is issues with for instance Airplay, buffering and other stuff that I have seen causing me issues whenever I went from one version to another.

    If you say so. /shrug

    Apple Bonjour is a big source of trouble. You've been installed it on your Windows machine together with TuneBlade. Try to find an alternative. Explain your target setup for music streaming, and we will see what we can do. :)

  • Reviving this thread, now that I got everything running on a pi4b instead with latest libreelec and a sufficient PSU. The problem has not gone away, so I am pasting a new debug log:

    External Content pastebin.com
    Content embedded from external sources will not be displayed without your consent.
    Through the activation of external content, you agree that personal data may be transferred to third party platforms. We have provided more information on this in our privacy policy.


    Hopefully somebody has a good advise.

    Thanks in advance!

    Edited once, last by jazzlpunk (August 4, 2023 at 2:40 PM).

  • Note: The below was moved from a new thread with the same topic that I created because this thread was more than 120 days old, which however got deleted and put here instead by staff. Its nearly identical to the first post here so it can be ignored by whoever is reading this. Although it may seem confusing, I am leaving it, just in case the staff member found that there was a reason to do it like this.

    Dear All,

    I am using a PC with Tuneblade to stream music to my rpi 4b with latest official libreelec (also happened on pi3b and libreelec 10.0.0) on it via Airblade. This shows up as "System Audio". There´ is one problem though:

    If I stop libreelec from receiving the stream using Kore on Android by pressing the stop button, I can no longer connect to libreelec with Tuneblade until the rpi has been rebooted. In other words, pressing stop simply crashes or stops the service.

    Now I could just stop the music by disconnecting on Tuneblade, but the thing is that sometimes if I watch a movie via libreelec, it suddenly gets interrupted when I for instance receive an email on the PC, which generates a sound that´s being sent via Airplay. Then when I start the movie again, the Airplay service has been shut down next time I want to hear music via Tuneblade, and I need to reboot the rpi.

    And.. it´s actually convenient for me to get those interruptions from the email program, theyre work related, but I could of course just remember to stop the Tuneblade stream before watching movies and use my mobile instead to warn me about emails, but unfortunately also a ton of other things, that I dont want to be bothered about, when Im watching a movie.

    So what Im looking for is an elegant way to restart Airplay from the shell without having to reboot (or prevent airplay from being shut down in the first place). I have tried with systemctl restart avahi-daemon, but that didnt do the trick.

    Here is a log file made when the the problem took place:

    External Content pastebin.com
    Content embedded from external sources will not be displayed without your consent.
    Through the activation of external content, you agree that personal data may be transferred to third party platforms. We have provided more information on this in our privacy policy.

    Any advise?

    Edited once, last by jazzlpunk (August 11, 2023 at 8:54 AM).

  • Da Flex Sorry, but I thought that I should follow the recommendation of the forum to open a new thread rather than reply to this old one.

    That's to avoid discussions about outdated software environments.

    Posting the same issue for the same software environment makes no sense.

    In your case, the LE updates didn't changed things, so you can stay on the same thread.

  • I think you're correct with your analysis, and AirPlay service was killed at some point:

    Code
    2023-08-03 15:12:12.406 T:1109    debug <general>: AIRTUNES: AirPlay not running - stopping player

    I've sent a message to the devs. It seems to be a bug.

  • Please update to latest LE. I don't think it will fix the issue, but you'll get more attention from devs.

    Thanks for all your info and contacting the devs! As far as I can see, its already the latest version that I am using? Update is set to automatic, but when changing to manual, there are no versions I can upgrade to.