I ran across this post on the Home Assistant forum, which shows something very similar to what I want to achieve. However, there is something that is unclear to me: with Snapdroid, will I able to stream all audio from my Android device to the Snapcast server so that it doesn’t matter which app I use, or is this just some control device? I couldn’t make that clearly out from the GitHub repo of Snapdroid.

My desired use case is to use this in the same way I would with AirPlay on an iPhone, and be able to use my music player connected to my Jellyfin server, my podcast application or my YouTube frontend application to play audio that is cast to the Snapcast server.

  • cyberwolfieOP
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    Hehe, and for that I apologize! In case you are interested, here are the options I am so far considering. Still very much in the research phase, trying to figure out my specs before I buy any gear I don’t already have. I am not very experienced with this, so feel free to point out any baloney in the below text. Anything that could spare me time researching dead ends is gratefully received.

    Option 1: Snapcast

    Since I will be running a Raspberry Pi 4 with Home Assistant anyway (not yet set up properly), I would like to make use of the Snapcast integration in HA to run the Snapcast server and then set up a Raspberry Pi Zero W (with some 3.5mm extension) with all speakers I want to connect. Ideally these Zeros could be powered by the speaker themselves (through USB for example) to avoid two plugs, but I don’t know how realistic it is to achieve this, and I have not done much research into this yet.

    The issue that I so far have is that I don’t know how I can stream audio from my Android device to the Snapcast server. From my understanding, and what I hoped to clarify with this thread, is that it requires a specific audio source that the Snapcast can recieve audio from. Here is a list. This seems to my limited experience much more doable from my laptop running Linux than from my Android device. But I don’t know…

    Currently I will be investigating whether I can use audio streaming in scrcpy to stream audio to the Pi, and then route that via PulseAudio to Snapcast. I don’t know yet if this is a really cool idea or an incredibly stupid idea. I want to setup scrcpy for another purpose anyway, so why not try? :) It might introduce additional latency from my device to the speakers, but as this happens before the “distribution” from the server to the clients, I don’t think this would affect the synchronization. Also, I will never use this to speak on the phone with anyone, so that there is some latency doesn’t really matter to me. The biggest issue would be toggling this off and on - maybe via a remote command with KDE Connect or something like that. If I could set that up as a custom tile in the quick access menu in Android, that might work.

    All in all it seems a bit too convoluted though, so I don’t have too much faith in this.

    Option 2: balenaSound

    So this is the solution I first learned about as an alternative to Sonos, but I was turned off by the need to connect my devices via the internet to the balenaCloud hosted by the developers. However, either I missed this in the first round of research, or they have released it since, but OpenBalena exists which has much of the functionality of balenaCloud (but not all) and can be self-hosted. If I could get the server to run on my Raspberry Pi 4, and then flash balenaOS onto each Pi Zero W, this could provide what I want as I understand that it allows to stream audio directly to the Zero Ws via Bluetooth (with subsequent sync to the OpenBalena server via WiFi). It would be a much simpler solution than the one above, especially in terms of toggling it on and off on my Android device.

    A downside to this solution though, is that I believe I would not be able to install it on a Pi running Home Assistant OS (correct me if I am wrong), and that running HA through Docker makes installing new integrations a bit more cumbersome? Maybe that will pose no problem, as I don’t plan on using too many integrations anyway (Zigbee, Netatmo and a MQTT broker). I could perhaps also run a VM that runs Home Assistant OS?

    • OminousOrange@lemmy.ca
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      Wow, thanks for the detailed information! Hopefully you can get some direction that helps with your solution. For me, it’s starting to sound like OpenBalena might work. I’ve got an old PC running Proxmox for my services with HAOS in a VM and working great. If you go with that, you’ll just have to configure USB pass through for a ZigBee receiver and any other hardware.

      • cyberwolfieOP
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 year ago

        Nice. I don’t have much experience with VMs yet. Is USB pass-through easily configured?

        The Acrylic device also seems pretty nice - I’ll dig a little deeper on that one as well. The rabbit hole becomes ever deeper… :)

        • OminousOrange@lemmy.ca
          link
          fedilink
          English
          arrow-up
          2
          ·
          1 year ago

          I don’t think the hole ever has a bottom 😁. USB pass through is relatively straightforward, just took some searching as I was very new at Proxmox and most things Linux.

          The Arylic stuff looks promising if it can be local-only. It seems there’s a proprietary app, but I’ll continue to research that as well.

        • OminousOrange@lemmy.ca
          link
          fedilink
          English
          arrow-up
          2
          ·
          edit-2
          1 year ago

          Ok, a bit more digging and here’s what I’ve found. It seems perhaps I can be of assistance.

          • This guy has set up those Arylic Up2streams with the LinkPlay integration in HA, which looks to accomplish what you’re looking for.
          • Another viable HA integration looks to be Music Assistant, but the video makes it seem like it might be a bit clunky. Also looks like Apple music might not be an option.

          Either way, looks like LinkPlay or Music Assistant can do the work of Snapcast or balenaSound, but within HA, so no additional containers needed. Likely can avoid the Arylic app that way too if you go with those devices.

          My wife says no more toys at the moment, but if I were to implement this, I’d probably pick up one of those Up2Streams for each room and try out the LinkPlay integration.

          • cyberwolfieOP
            link
            fedilink
            English
            arrow-up
            2
            ·
            1 year ago

            Hm, the Music Assistant at least does not quite accomplish what I hope and it seems to rely on services such as Spotify or YT Music to be integrated. I couldn’t quite evaluate the LinkPlay-solution, but his comment on SD card corruption with RPis made me a bit worried for the balenaSound approach. I guess there’s a lot of write operations in such a setup, that can easily corrupt the SD cards. I wonder how often they kept failing for him - maybe it’ll end up being some sort of a “subscription fee” 😅

            My wife says no more toys at the moment, but if I were to implement this, I’d probably pick up one of those Up2Streams for each room and try out the LinkPlay integration.

            Then you have something to put on your list for Christmas, if that is something you celebrate :)

    • OminousOrange@lemmy.ca
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      1 year ago

      Just came across this device while rooting around for HA compatible solutions. Looks to be have lots of connectivity options. Might be a potential less wired option for your setup

      Have also seen Volumio mentioned a couple times.