BluOS controller app on Linux

Answered

Comments

168 comments

  • Andrés Martinelli

    Thank you again!

    0
  • Paul van Grieken

    David S Thank you so much! You can't imagine how happy I am with your work!

    0
  • Paul S

    Thank you David!

    I did try and do this myself, but couldn't get Electron to run :-(

    Still don't understand why Bluesound can't do this for themselves!

    0
  • David S

    Since several folks here seem to have a hard time with this process, I'm currently writing a tool to automate the whole thing and will check it in on GitHub when I'm done. Should be pretty simple to use and the only requirement is that you have Node JS installed somewhere.

    0
  • David S

    Alright, everyone. Took a couple of hours and got it working. Feel free to inspect the (rushed and ugly) code if you want to see what it's doing, or just use the CLI tool already built for you in the GitHub releases section. The tool will automatically pull the latest version from Bluesound's Download page, extract it, unpack it, patch it, and build it for Linux. You do not have to define which version you want, it will always grab the latest version on their website. Whenever you get the "New Version available" message, just re-run this bs-patch tool and it will build it fresh for you :) I'll also try to keep up with sharing the built files here, but this should allow everyone to have the latest without having to wait for me.

    Please note the Prerequisite section on the GitHub Readme. You MUST have NodeJS installed already and then configure the tool with the location of your NodeJS bin folder. I'll eventually try to autodetect this, but having it specified was much easier.

    The GitHub repository for the tool can be found here: https://github.com/dave92082/bs-patch

    If you don't care about the code and just want to patch and build the BluOS Controller for yourself, head over to the releases page here: https://github.com/dave92082/bs-patch/releases and download the latest .tar.gz of the tool.

     

    I have included instructions in the README however I will include them here as well:

    1. Download the release
    2. Extract the bs-patch binary
    3. Execute which npm
    4. Copy the path to the bin folder
    5. Create a file named config.yaml in the same folder as the bs-patch binary and place the config entry `nodeBinPath: <your node bin path>`
    6. Execute ./bs-patch
    7. If all goes well, you should now have a folder named dist in the same location that you executed the bs-patch utility. This folder will contain the Snap and the AppImage
    8. (Hopefully) Enjoy your new BluOS Controller app on Linux
    1
  • Julien Jay

    A big thank to David S for his work, sharing and tuto !

    It took me less than 1 minute to install it, and it works like a charm.

    Then, it should be possible for the BluOS dev "dream" team to release BluOS Controller official linux package !

    0
  • Francesco Frassinelli

    Hi everybody,

    I just recently bought a PowerNode because I have seen this discussion and there is some kind of community support for Linux users.

    I have some issues with https://github.com/dave92082/bs-patch/issues/3 so I tried to do a simpler script to see how far I can go by myself: https://gist.github.com/frafra/7da949372cef4e420451553927fecb5c

    It is get stuck on "looking for players..." but I see from the output that it correctly detected my device, but it does not move forward. Any idea why?

    The appImage from David S worked :) Thanks! :)

     

    0
  • David S

    Francesco Frassinelli, I always get jealous when I see people that are good at bash :) You have all the steps correct, however, you forgot to actually patch the application for Linux support which is why you are getting stuck on "looking for players..." Under the hood, they are checking for Spotify and then checking for updates, both of which will hang the electron on Linux. 

     

    See the following three patches (string replacements). If you add them to your script it should work:

    https://github.com/dave92082/bs-patch/blob/5faae18d4d77578a6e68685664f92a7c61906ad7/main.go#L57

    https://github.com/dave92082/bs-patch/blob/5faae18d4d77578a6e68685664f92a7c61906ad7/main.go#L68

    https://github.com/dave92082/bs-patch/blob/5faae18d4d77578a6e68685664f92a7c61906ad7/main.go#L73

     

    That function call is <file>, <original>, <replacement>

    1
  • Francesco Frassinelli

    Thanks! I though it was optional, not mandatory. Now it works :-)

    Here is my version: https://github.com/frafra/bs-bashpatch

    0
  • Francesco Frassinelli

    Here we are again! I made a new release, which better documentation and instructions for Docker/Podman users, which should make easier to get consistent results.

    I do not plan to release a ready to use Linux version, even if it would be very easy to set up a continuous integration pipeline which would produce the latest BluOS controller for Linux and share it with everybody, as I do not know if Bluesound would be ok with that (due to licensing and trademark), even if the changes made are minimal.

    Antknee Williamson As it is trivial to produce a Linux edition and it would require a little effort to produce on your side (we did all the job for your developers), do you think we will get an official Linux package ever? It would make our life easier and attract more customers which use Linux. I was myself in doubt if buying a Powernode, but I did it as I have seen this forum discussion and as being myself a software developer I thought it could have been worth risking and trying to make the BluOS controller on Linux. This is also the most voted and commented discussion of the category " Controllers - Other". Having Linux users on your side could also mean that your developers could get more valuable bug reports and fix/workaround, as Linux users are more technical/advanced users usually. Thank you for listening!

    0
  • NG

    Hi guys.

    I just tried the 3.12.1 version (AppImage) on Fedora 33 and it seems to work perfectly (with Deezer as music service and a 2015 Powernode 2).

    Thx a lot David S .

    While I'm really glad there's a lot of people interested in a Linux version, I'm not a glad at all about Bluesound responsiveness: more than 1 year has passed since the original request and they didn't do anything.

    I'm actually pretty disappointed about this: the usual response from Bluesound seems always to be "future consideration...". Looking at the forum, the same seems to apply also to other topics for which there's a lot of requests from the customers.

    Anyway, given that we have to do it by ourselves, I'm available to help if I can (I'm not a SW developer but I'll be happy to "test" the new versions somehow).

    For the moment I reverted to the 3.12 because I wasn't able to install the new one that pulls the latest  version automatically (I got an error with Electron installation, therefore I installed Electron by myself and Electron seems to work, nevertheless the script complains about it. I guess it's something related to the Fedora environment).

    Errors are below if somebody can give a clue. I'll try again in the coming days when I have some more time.

    Anyway, I didn't write here to solve that problem, I just want to notify Bluesound that there's another customer interested in the Linux app.

    Cheers.

    INFO[0000] Reading config.yaml
    INFO[0000] Finding Latest BluOS Controller
    INFO[0002] Downloading Latest BlueOS controller: https://www.bluesound.com/wp-content/uploads/2020/11/BluOS-Controller-3.12.1.dmg
    Downloading... 98 MB complete
    INFO[0030] Extracting BlueOS Controller DMG
    INFO[0030] Extracting ASAR
    INFO[0030] Patching electron.js
    INFO[0030] Patching app.js - Update Check
    INFO[0030] Patching app.js - Update Platform
    INFO[0030] Adding electron dependency
    ERRO[0030] Error installing electron:
    INFO[0030] Adding electron-builder dependency
    ERRO[0030] Error installing electron:
    INFO[0030] Building Snap and AppImage
    ERRO[0030] Error extracting ASAR:
    INFO[0030] Cleaning up

     

     

    0
  • David S

    Hey NG,

    The tool that I posted about was a (very rough and ugly) attempt at letting folks patch and build for themselves. I'll continue to post the resultant builds as new versions are released, so if the tool to build it yourself doesn't work, just download the AppImage that I link in this thread instead. I try to stay on top of new releases however I use my phone more than the Linux app so I don't always notice it.

    Regarding the issue with the tool, I'll add extra logging to help diagnose the problem and let you know when it's updated. May take a couple of days before I can get back to it.

    0
  • NG

    Hi David S.

    For the moment I'm using the Appimage indeed and it works perfectly. 

    I'll play with the tool in the coming days.

    I'm using BluOs on Android (tablet or smartphone) 90% of the time, but I like the possibility of seeing the album covers and the track lists on a bigger screen :) 

    Thx again for your work.

    0
  • Francesco Frassinelli

    Hi NG,

    if you are willing to test, would you like to try mine? https://github.com/frafra/bs-bashpatch

    0
  • NG

    Hi Francesco Frassinelli.

    I will try yours in the coming days too.

    Actually I started from it but got stuck at the Docker thing and then got lost :)

    I don't have here the laptop I've been using yesterday so I can't replicate it now but I'll definitely try again.

    I must say I'm pretty new to Fedora (been using other distributions before) and got confused between the various Fedora packages.

    I will probably try it on Arch (it's more complicated, at least in my experience, but I feel I have more control) and then back to Fedora.

    Thanks to you too.

    0
  • Francesco Frassinelli

    Hi NG,

    I suggest you to use podman, instead of docker. podman does not require a daemon, extra repository, nor extra permissions; just install it and run the commands listed in the readme replacing "docker" with "podman". This is what I am using on my machine too actually :-)

    0
  • NG

    Francesco Frassinelli you made me curious, therefore I tried with podman...

    (found a Fedora desktop in a corner of my kitchen :)).

    So:

    A) podman build -t bs-bashpatch .

    went ok (it installed 45 packages).

    B) mkdir -p downloads output

    ok too.

    C) podman run --rm -v $PWD/output:/output -v $PWD/downloads:/downloads bs-bashpatch

    didn't work without privileges (Cannot write to 'downloads/BluOS-Controller-3.12.1.dmg' (Permission denied), therefore:


    D) sudo podman run --rm -v $PWD/output:/output -v $PWD/downloads:/downloads bs-bashpatch

    seems to work but it's not able to pull anything:

    Completed short name "bs-bashpatch" with unqualified-search registries (origin: /etc/containers/registries.conf)
    Trying to pull registry.fedoraproject.org/bs-bashpatch:latest...
    manifest unknown: manifest unknown
    Trying to pull registry.access.redhat.com/bs-bashpatch:latest...
    name unknown: Repo not found
    Trying to pull registry.centos.org/bs-bashpatch:latest...
    manifest unknown: manifest unknown
    Trying to pull docker.io/library/bs-bashpatch:latest...
    denied: requested access to the resource is denied
    Error: 4 errors occurred while pulling:
    * Error initializing source docker://registry.fedoraproject.org/bs-bashpatch:latest: Error reading manifest latest in registry.fedoraproject.org/bs-bashpatch: manifest unknown: manifest unknown
    * Error initializing source docker://registry.access.redhat.com/bs-bashpatch:latest: Error reading manifest latest in registry.access.redhat.com/bs-bashpatch: name unknown: Repo not found
    * Error initializing source docker://registry.centos.org/bs-bashpatch:latest: Error reading manifest latest in registry.centos.org/bs-bashpatch: manifest unknown: manifest unknown
    * Error initializing source docker://bs-bashpatch:latest: Error reading manifest latest in docker.io/library/bs-bashpatch: errors:
    denied: requested access to the resource is denied
    unauthorized: authentication required

    Do I have to change something in /etc/containers/registries.conf maybe?

    0
  • Francesco Frassinelli

    It needs to be run as regular user (non-root); in the second case the image is not found as you are executing it as root, but built it as regular user. I could publish a pre-made image in the future actually.

    I think that the container cannot access to the "downloads" folder because of SELinux. You should be able to add ":Z" at the end of each volume mount to make it work. The command would look like that:

    podman run --rm -v $PWD/output:/output:Z -v $PWD/downloads:/downloads:Z bs-bashpatch

    Let me know if that works and I will update my documentation (this is why testing is useful!). If you still get the same issue, you could try to temporarily disable SELinux with: `setenforce 0` as root user or with sudo.

    0
  • NG

    real time testing then... :o)

    ok for the :Z at the end: no need for root indeed.

    You should mention that lynx, 7z and nodejs have to be installed in any case: from the description it'd seem that they are not needed when using podman or docker (at least I understood it that way).

    ./bs-bashpatch.sh
    + URL=https://www.bluesound.com/downloads/
    +++ mktemp -d bluos-controller.XXX
    ++ realpath bluos-controller.rQb
    + tmp=/home/gilga/BluOs/bs-bashpatch-master/bluos-controller.rQb
    + trap cleanup INT QUIT TERM
    ++ lynx -dump -listonly -nonumbers https://www.bluesound.com/downloads/
    ++ grep -e '/BluOS-Controller-.*dmg'
    ./bs-bashpatch.sh: line 18: lynx: command not found

    Now it's downloading electron and it's taking ages.

    note: there are a lot of warnings from npm about deprecated urls.

    0
  • NG

    installed "patch" too which was missing, launched the app and... here we go!

     

    0
  • Francesco Frassinelli

    Hi again NG, and thanks for testing!

    No, these dependencies are not needed if you use podman: all the dependencies are included in the container, so your system is clean and the whole process should give more predictable results! The container is just the script + the dependencies, and it uses "downloads" as a cache folder and "output" to write the final AppImage.

    I could add a check for the various dependencies inside the script, thanks.

    0
  • NG

    Apparently some of the dependencies are installed automatically, some are not (lynx, 7z, nodejs and patch on this Fedora box).

    Anyway, it's not a big deal to install them.

    Tomorrow I'll try the same on the laptop.

    0
  • Francesco Frassinelli

    I think there is a misunderstanding. The dependencies are installed inside the container image, but they are not if you avoid using the container. `podman build` + `podman run` = nothing else is needed to get your AppImage in the "output" folder (no dependencies should be installed), while if you run the script manually (outside the container) the dependencies should be installed. I made the container just to avoid having to deal with the dependencies :)

    0
  • NG

    I think you're right.

    I built it with podman but then at some point I launched the script directly (hence the missing deps).

    It wasn't a very scientific approach I guess. :) but in the end I tested both script and podman...

    0
  • NG

    Hi again Francesco Frassinelli .

    I just performed the installation on the Fedora laptop with Podman.

    I confirm the need for :Z in the podman run command, as you suggested yesterday:

    podman run --rm -v $PWD/output:/output:Z -v $PWD/downloads:/downloads:Z bs-bashpatch

    Everything went smoothly: the 'BluOS Controller-3.12.1.AppImage' that has been generated, seems to work fine.

    Some minor comments about a couple of warnings that popped-up (they don't affect the usability of the app):

    1. after launching the app: (node:10053) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

    2. after closing the app (closing by clicking on the X in its window):

    Close event from Right click Quit or X red icon
    (node:10268) UnhandledPromiseRejectionWarning: Error: Script failed to execute, this normally means an error was thrown. Check the renderer console for the error.
    at WebFrame.e.startsWith.e.startsWith.WebFrame.<computed> [as _executeJavaScript] (electron/js2c/renderer_init.js:87:1542)
    at electron/js2c/renderer_init.js:139:429
    at electron/js2c/renderer_init.js:123:361
    at EventEmitter.<anonymous> (electron/js2c/renderer_init.js:127:872)
    at EventEmitter.emit (events.js:223:5)
    at Object.onMessage (electron/js2c/renderer_init.js:115:818)
    (node:10268) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
    (node:10268) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    Attempting to call a function in a renderer window that has been closed or released.
    Function provided here: electron.js:159:22
    Remote event names: closed

     

    Cheers,

    NG.

     

    0
  • Francesco Frassinelli

    Hi NG!

    Thank you for your testing. I will update the documentation with the custom ":Z" flag for podman and I will extend it to clarify the differences between running it with or without the container.

    The two messages you see are issues of the BluOS controller app (minor ones).

    I invite everybody to vote the very first post in this thread, which allow to vote the thread as a whole and to make more visible our interest in having a native BluOS controller app for Linux.

    0
  • David S

    Version 3.12.3 came out:

     

    If you have Snap:

    1. Download the snap from here: https://drive.google.com/file/d/1_bkcjIG_HU5SjtZOcegB2tVryIVApkMd/view?usp=sharing
    2. Run: snap install --dangerous BluOS_3.12.3_amd64.snap

    If you don't have Snap:

    1. Download the AppImage from here: https://drive.google.com/file/d/1H2MTWObfGnozetKjdwjOl2cqcvbuKxoq/view?usp=sharing
    2. Run: chmod +x 'BluOS Controller-3.13.3.AppImage'
    3. Run: ./'BluOS Controller-3.12.3.AppImage'
    2
  • Holger Dehnhardt

    Thanks again, David. 

    Works without any problem!

    0
  • Paul S

    Thank you!

    0
  • Francesco Frassinelli

    Have you tried to share a local folder adding a "Local share"? It looks like it would require an extra patch:

     

    [150707:0307/123547.175875:INFO:CONSOLE(966)] "sudo prompt done: Error: Command failed: /usr/bin/sudo -n -E --
    usage: sudo -h | -K | -k | -V
    usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
    usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
    [command]
    usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
    prompt] [-T timeout] [-u user] [VAR=value] [-i|-s] [<command>]
    usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
    prompt] [-T timeout] [-u user] file ...
    usage: sudo -h | -K | -k | -V
    usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
    usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
    [command]
    usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
    prompt] [-T timeout] [-u user] [VAR=value] [-i|-s] [<command>]
    usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
    prompt] [-T timeout] [-u user] file ...
    ", source: file:///tmp/.mount_BluOS%20fJnrjW/resources/app.asar/www/js/electron.js (966)

    0

Please sign in to leave a comment.