Skip to main content
Contributor I
January 11, 2022

Sonos-HDMI by Retired Guy isn't outputting graphics...

  • January 11, 2022
  • 31 replies
  • 696 views

@Chicks, thank you for the port of your touchscreen controller to a view only HDMI code.  

I’ve got your code installed on my Pi Zero W, auto login to shell, the Sonos.py script auto-running and edited to my named speaker group, and it connected to the HDMI on the big-screen.  Unfortunately, the Pi isn’t showing the artwork/music on screen, just the bash prompt after the linux boot menu.

Can you direct me to what I am missing from the auto-run or the python or the output variable for the screen? Is there one more utility to be the front end?  Maybe my systmctrl of the Sonos app isn’t running?

I needed to chmod your utility to executable, so that should be OK now…. Thoughts?

    This topic has been closed for further comments. You can use the search bar to find a similar topic, or create a new one by clicking Create Topic at the top of the page.

    31 replies

    chicks
    January 11, 2022

    I don’t have this set up any more, or any Sonos products running at the moment, but a couple of things to check.

    Try sudo journalctl -u sonos.service  to see if/why it fails to start.

    Run sudo systemctl stop sonos.service, then start it manually from the cmd prompt:

       cd ~ 

       cd sonos

       python3 sonos.py

     

    Make sure you’ve done all the steps outlined, including giving the “pi” user membership in video group:

      sudo usermod -a -G video pi

     

    Around line 288 in sonos.py: fb = open(“/dev/fb0”, “wb”).  It’s possible that your pi is using fb1 for HDMI vs fb0, especially if there’s another screen installed locally.

     

    Dave MathAuthor
    Contributor I
    January 12, 2022

    Ok, thank you for the insight on the console view.  I’m getting a break at Image.py; which does exist in that directory.  I do not see libopenjp2.so.7 in the directory however.

      File "/home/pi/sonos/sonos.py", line 20, in <module>

        from PIL import Image

      File "/home/pi/.local/lib/python3.9/site-packages/PIL/Image.py", line 89, in <module>

        from . import _imaging as core

    ImportError: libopenjp2.so.7: cannot open shared object file: No such file or directory

    chicks
    January 12, 2022

    Ok, so looks like you didn’t do all the install steps from section 8 of the readme, specifically the jpg library install, which is required by PIL. 
     

    Starting here:

    sudo apt install libopen-jp2-7-dev

    sudo apt install libtiff5

    sudo apt install ttf-dejavu

    pip3 install soco

    pip3 install Pillow

    chicks
    January 12, 2022

    Actually, I my have documented that incorrectly. Try:

     

    sudo apt install libopenjp2-7-dev

     

    Dave MathAuthor
    Contributor I
    January 12, 2022

    That library was missing. Thank you.  So now I’m getting a crash without details.

    pi@raspberrysonos:~/sonos $ python3 sonos.py

    Illegal instruction

    This could be because of lack of fonts.  When I add the font library, after updating Debian on the Pi I get: E: Unable to locate package ttf-dejavu

    Can I use a default system font that is sans, to be more modern?  Did you pick that because it scales to large format better than system fonts?

    chicks
    January 12, 2022

    Did you run the install step for the font?

     

    sudo apt install ttf-dejavu

     

     

    Dave MathAuthor
    Contributor I
    January 12, 2022

    Yes, that was the line: When I add the font library, after updating Debian on the Pi I get: E: Unable to locate package ttf-dejavu

    I performed a package update too.  It still was not found. I got another version to install with the command: 

    sudo apt-get install --reinstall fonts-dejavu and fonts-dejavu-core

    This put them in the folder: 

    /usr/share/fonts/truetype/dejavu/

    So I created /usr/share/fonts/truetype/dejavu-ttl/ and copied them all there as well.

    Logs are non-detailed: Jan 12 00:33:07 raspberrysonos systemd[1]: sonos.service: Main process exited, code=killed, status=4/ILL

    Jan 12 00:33:07 raspberrysonos systemd[1]: sonos.service: Failed with result 'signal'.

    So that leads to my other question, can I pick another font that will scale well and be san serif/modern?

    chicks
    January 12, 2022

    Looks like the latest version (bullseye) of Raspberry Pi OS has dejavu already installed, and the package name has been changed, as you have found.  So, the font is not your issue.

    When troubleshooting, you never want to start it as a service.  Run it manually from the cmd prompt to see what errors are being thrown.  

    I’ll try to do the install on a fresh build in the next day or two, if you haven’t resolved.  I suspect, as this was built originally on the previous OS version, something else has changed with the OS to cause it to fail.

     

    chicks
    January 12, 2022

    So, the Python package managers have somehow messed up a bunch of packages, including Pillow. 

    https://github.com/piwheels/packages/issues/269

    So, downgrade to Pillow version 8.4.0:

       pip3 uninstall Pillow

       python3 -m pip install Pillow==8.4.0

    Should work now.  Fingers crossed.

    Dave MathAuthor
    Contributor I
    January 12, 2022

    Well done! That was it.  Amazing research to debug it, considering the blank error.  Thank you!  Have a tip jar?

    Resolution is huge on a 1080p Plasma in my shop, but I think I prefer the large artwork, vs small images...

    Dave