Snapserver/Snapclient does not work on RPi4 with LE 10.0.1 via HDMI

  • Dear all,

    maybe a problem someone else had already solved: Today I've been putting an RPi4 with LE 10.0.1 into action on a new Marantz NR1711 connected via HDMI0. With Snapclient deactivated on this machine, I can see via Settings -> System -> Audio -> Device the following entry which I picked: "ALSA-vc4-hdmi0 (vc4hdmi0), MJI marantz-AVR on HDMI". So far anything works like charm.

    Since this device is in the living room and I do have an additional RPi3 in the kitchen/dining room running a Snapclient, I would like to play sound via Snapserver/Snapclient to both of these machines like I was able to do in the past with an older RPi3 in the living room working as a Snapserver/Snapclient as well. Bluetooth is enabled on the new RPi4. But as soon as I switch on Snapclient as well on the RPi4 I can only see two entries: "PULSE: Default, Bluetooth Audio (PULSEAUDIO)" and "PULSE: Null Output, Null Output (PULSEAUDIO)". I picked the first, but no audio at all. The RPi3 in the kitchen/dining room is able to connect to Snapserver which I can see via Snapcast app on my mobile, but on none of the two machines there is any audio output.

    What exactly do I have to do to get this working? I've already spent a couple of hours but now my last idea faded away...

    Thanks in advance for hints of any kind!

  • In principle the Marantz should be able to work with bluetooth devices but the RPi4 is wired to the receiver with an HDMI cable, is properly recognized by it and properly plays audio via ALSA via the device as shown above.

    Snapserver/Snapclient are the official addons.

    With LibreELEC 9 on an RPi3 anything went fine and after switching on these addons I was able to select the Snapserver sink as audio output (being named "PULSE: Snapserver" or something like that) and the Snapclient running on the same machine was able to hook on and to play audio via a HifiBerry AMP2 HAT.

    But now the RPi 4 should only play audio via HDMI.

    Edited once, last by FHoevi (March 9, 2022 at 6:09 PM).

  • After looking into this thread on GitHub https://github.com/LibreELEC/LibreELEC.tv/issues/6309 I placed this into /storage/.config/autostart.sh:

    Bash
    #!/bin/sh
    pactl load-module module-null-sink sink_name="just_a_sink_1"
    pactl suspend-sink just_a_sink_1
    pactl load-module module-udev-detect
    pactl load-module module-allow-passthrough

    Now, after activating Snapserver addon, I can select the PULSE: Snapserver sink for audio output via system settings.

    So far, so good, but it still does not play any sound. One Snapclient (running on another RPi/Raspbian) is able to detect it and hook on. The other Snapclient which is running on the same machine as addon like Snapserver addon tells me via systemctl status service.snapclient that Started Snapclient. and Starting Raspberry Pi onboard audio. That's it. No usual additional message like Connected to 192.168.xx.xx. What else am I missing? Any hint would be highly appreciated.

    All in all it is quite annoying and unnecessarily time-consuming (even -wasting) that LE developers decided to not properly support established addons like Snapserver/client any longer by switching off general pulseaudio support. Why? I think that these addons are extremely useful, unlike many others you could find in various repos.

  • If I deactivate Snapclient addon and start snapclient from command line I am told that while a song or radio station is playing via Snapserver sink (Stream) No chunks available, (Alsa) Failed to get chunk, (Controller) diff to server [ms]: -0.005 and finally (Alsa) No chunk received for 5000ms. Closing ALSA. Bah.

  • Man, a couple of hours later I got it working with Raspberry OS bullseye instead of LE. It is a bit more of rather manual configuration work but it is definitely worth it. LE is history from my perspective now and for my personal use case of Kodi.

    The key in the end after all necessary configuring was to start Kodi via kodi --pulse, that did the job of providing me the Pulseaudio sink for snapserver which I set up before and now anything is working again like charm.

    And now I can do VNC again on that machine which is really nice as such.

  • Ok, I pick up this thread as I've got similar issues with snapclient on 10.0.3 RPi4.

    With snapclient addon active, the snapclient receives audio from snapserver (running on different machine), but kodi itself has no audio. Even in settings audio is greyed out.

    With snapclient deactivated, LE starts up and kodi has audio as it should. I'm even able to activate snapclient addon then and all is fine until next reboot :(

    Anyone with an idea?

  • I ran into similar problems when installing 10.0.0.4 on RPi4. I got it to work, finally. It's been a while, but I think I did the following:

    1. I wanted to run snapserver and stream output of Kodi to different snapclients (I have a different computer with decent soundcard running snapclient, among other things, connected to audio amplifier)

    2. If I remember correctly (and looking at the changes I made), the problem was that Kodi sound stream was passed to '/tmp/snapkodi' file which should be picked up by snapserver and streamed to clients. No matter what I've tried, snapserver would not play from that file.

    3. So in the end I ended up modifying 'snapserver.start' file and changed 'file' variable to point to the default '/tmp/snapfifo' file. That did most of the trick.

    4. The pulse and audio output settings have to be set correctly.

    Another thing to consider is that the version of plugin and hence the snapserver is quite old and newer versions might be fixed (either on plugin configuration part or snapserver part) - don't know yet.

    Guess I'll find out when I upgrade.

  • Absolutely not sure if I remember correctly, but I think it might have been related with the snapserver server not recognizing the commandline parameter of 'stream', resulting in using the default snapfifo file.

  • So I've updated and the snapserver (version 11.0.0.2) seems to work for me even though the changes I made were removed. At least those that I could find after such a long time after making them. It seems all is good right now.