custom firewall / iptables LOG / librespot

  • Dear All,

    I am running a custom firewall rules.v4 with currently LibreELEC-RPi4.aarch64-13.0-nightly-20251126-257c8e7. Unfortunately, my custom iptables firewall is a bit to strict to let librespot be detectable by spotify. I want to debug the dropped packets by LOG statements like


    -A INPUT -p udp -j LOG --log-level warning --log-prefix "UDP DROP:"


    Unfortunately, I do not get any iptables LOG messages in dmesg, journalctl -k, or kodi.log.

    How can I get the iptables LOG messages?


    If I flush all firewall rules, librespot is detectable, with my custom firewall it is not detectable anymore. Any hints here? Which ports need to be open?


    Thanks in advance for your help.

  • Go to Best Answer
  • You have to load the used modules: modprobe xt_LOG

    To make loading persistent create /storage/.config/modules-load.d/iptables.conf with one module name per line.

  • Thanks for your advise. implemented both suggestions. After a reboot the module xt_LOG is loaded:

    I successfully got some iptables LOG messages in journalctl -k
    and can now start to debug my firewall. Thanks.

    Edited once, last by FUEL4EP: Correction (November 27, 2025 at 5:04 PM).

  • With mlae's advices I could nail down my librespot problem:


    In /storage/.kodi/userdata/addon_data/service.librespot/settings.xml I defined the zeroconf-port as follows:

    <settings version="2"> 
       <setting id="name">Librespot@{7777}</setting> 
       <setting id="dnd_kodi" default="true">false</setting> 
       <setting id="backend" default="true" /> 
       <setting id="player" default="true" /> 
       <setting id="alsa_device" default="true">hw:2,0</setting> 
       <setting id="options" default="true">--zeroconf-port 55555</setting> 
    </settings>

    However, the option for zeroconf-port seems not to be used. After a reboot a


    grep -i "librespot" /storage/.kodi/temp/kodi.log | tail -n 100


    still shows a random port for librespot's event handler listening on port and not the specified 55555:


    2025-11-28 11:25:36.831 T:1948     info <general>: Librespot: Event handler listening on port 52239

    What are I am doing wrongly to prefefine the zeroconf-port of librespot?

    The version of librespot is librespot 12.80.4.2
    / 0.8.0 049eb6e (Built on 2025-11-11, Build ID: NtYMPwJe, Profile: release).


    Thanks in advance.

    Edited 2 times, last by FUEL4EP: added version info of librespot (November 28, 2025 at 1:32 PM).

  • Quote

    12.80.4.3 (coming soon) implements an explicit zeroconf port parameter

    That's great news.

    I had librespot running with zeroconf in an older version, but this feature stopped working after some updates of libreeelec and librespot.


    Quote

    "options" is not supported, but PRs are always welcome.

    Which repositories would apply?

  • Quote

    12.80.4.3 (coming soon) implements an explicit zeroconf port parameter

    Whow, the release was faster than I expected:

    LibreELEC-RPi4.aarch64-13.0-nightly-20251128-85c6ad7

    is implementing the improvement librespot: Add setting for zerconf port #10643 .

    And even better, I got it working in conjunction with my custom firewall rules.ip4:

    The trick is to manually edit the setttings.xml file

    /storage/.kodi/userdata/addon_data/service.librespot/settings.xml

    as follows

    Code
    <settings version="2">
        <setting id="name" default="true">Librespot@{}</setting>
        <setting id="dnd_kodi" default="true">false</setting>
        <setting id="backend" default="true" />
        <setting id="player" default="true" />
        <setting id="alsa_device" default="true">hw:2,0</setting>
        <setting id="zeroconf_fixed" default="true">true</setting>
        <setting id="zeroconf_port" default="50252">55555</setting>
    </settings>


    55555 is the zeroconf-port used in my custom firewall.

    Thanks to the team for this great work!

  • Thanks for your feedback.

    Quote

    Should be possible with "standard" addon configuration. If not, it need to be fixed!

    I x-checked again and can confirm that I got today a possibility to change the zeroconf port in the librespot configuration GUI:

    I am quite sure that yesterday evening after upgrading to LibreELEC-RPi4.aarch64-13.0-nightly-20251128-85c6ad7 the last two lines were not shown. Yesterday evening the userdata settings.xml was still the old one from a very previous librespot version, see at the beginning of this thread.

    /storage/.kodi/userdata/addon_data/service.librespot/settings.xml

    Thanks again for your great support.