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

    Dave MathAuthor
    Contributor I
    January 13, 2022

    Ok, I made some changes to get the resolution up to 800X600 to show cover art at double pixels on the 1080P Plasma TV.  Ideally this would contain a watch dog to see resolution natively and format the art properly.  I went the manual route to fix it for my display.

    You can set the overscan values to drop or slide the frame a few pixels. I found if you change these by more than 1-9 then it breaks the image mapping from the memory buffer.

    I set the screen type and resolution:

    hdmi_group=2

    hdmi_mode=9

    hdmi_cvt=800 600 60 6 0 0 0

    Finally, used the last post in this thread, from 2019 to clear the screen and remove the cursor at boot as my new higher resolution screen had some system messages:

    https://forums.raspberrypi.com/viewtopic.php?t=60615

     

    Lyricist III
    January 14, 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.

    Thank you so much, I was trying to install on Monday and running into trouble.

     

    After fixing Pillow I now the following error message:

     


    pi@raspberrypi:~/sonos $ python3 sonos.py
    display_power=1
    screen brightness set
    Traceback (most recent call last):
      File "/home/pi/sonos/sonos.py", line 293, in <module>
        initscreen()
      File "/home/pi/sonos/sonos.py", line 76, in initscreen
        blit(img,(0,0))
      File "/home/pi/sonos/sonos.py", line 66, in blit
        fb.seek(4 * (fbw - w), 1)
    OSError: [Errno 28] No space left on device
     

    Dave MathAuthor
    Contributor I
    January 14, 2022

    make sure you remove the installer for the old pillow and any other .zip files.  Your file system is full...

    Lyricist III
    January 14, 2022

    make sure you remove the installer for the old pillow and any other .zip files.  Your file system is full...

    I went back and deleted the zip file. I tried a fresh install because things weren’t working.

    I’m going to try a different SD card and see if that fixes it.

    Lyricist III
    January 14, 2022

    Same error message with a new SSD card:

    pi@raspberrypi:~/sonos $ python3 sonos.py                                       
    display_power=1
    screen brightness set
    Traceback (most recent call last):
      File "/home/pi/sonos/sonos.py", line 293, in <module>
        initscreen()
      File "/home/pi/sonos/sonos.py", line 76, in initscreen
        blit(img,(0,0))
      File "/home/pi/sonos/sonos.py", line 66, in blit
        fb.seek(4 * (fbw - w), 1)
    OSError: [Errno 28] No space left on device

    I used sudo raspi-config, advanced options, A1 expand the file system.

    Unfortunately still getting the same message despite available space.


    pi@raspberrypi:~ $ df -h
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/root        29G  1.4G   27G   5% /
    devtmpfs         87M     0   87M   0% /dev
    tmpfs           215M     0  215M   0% /dev/shm
    tmpfs            86M  612K   86M   1% /run
    tmpfs           5.0M  4.0K  5.0M   1% /run/lock
    /dev/mmcblk0p1  253M   49M  204M  20% /boot
    tmpfs            43M     0   43M   0% /run/user/1000
    pi@raspberrypi:~ $
     


     

    chicks
    January 14, 2022

    The device causing the error is the framebuffer.  Make sure it’s configured correctly per the details. 

    Lyricist III
    January 14, 2022

    The device causing the error is the framebuffer.  Make sure it’s configured correctly per the details. 

    I’m sorry, I believe I haven’t changed anything in the config.txt except the HDMI output. I’m not sure what you are referring to.

    I actually have the Hyperpixel 4” touch en route via USPS and plan to use as you described in your original post. Just wanted to get things working on a monitor before it arrived.

    Lyricist III
    January 15, 2022

    The device causing the error is the framebuffer.  Make sure it’s configured correctly per the details. 

    Here is my config:

     

    # For more options and information see
    # http://rpf.io/configtxt
    # Some settings may impact device functionality. See link above for details

    # uncomment if you get no picture on HDMI for a default "safe" mode
    #hdmi_safe=1

    # uncomment the following to adjust overscan. Use positive numbers if console
    # goes off screen, and negative if there is too much border
    #overscan_left=16
    #overscan_right=16
    #overscan_top=16
    #overscan_bottom=16

    # uncomment to force a console size. By default it will be display's size minus
    # overscan.
    #framebuffer_width=1280
    #framebuffer_height=720

    # uncomment if hdmi display is not detected and composite is being output
    #hdmi_force_hotplug=1

    # uncomment to force a specific HDMI mode (this will force VGA)
      hdmi_group=2
      hdmi_mode=87
      hdmi_cvt=800 480 60 6 0 0 0

    # uncomment to force a HDMI mode rather than DVI. This can make audio work in
    # DMT (computer monitor) modes
     hdmi_drive=1

    # uncomment to increase signal to HDMI, if you have interference, blanking, or
    # no display
    #config_hdmi_boost=4

    # uncomment for composite PAL
    #sdtv_mode=2

    #uncomment to overclock the arm. 700 MHz is the default.
    #arm_freq=800

    # Uncomment some or all of these to enable the optional hardware interfaces
    #dtparam=i2c_arm=on
    #dtparam=i2s=on
    #dtparam=spi=on

    # Uncomment this to enable infrared communication.
    #dtoverlay=gpio-ir,gpio_pin=17
    #dtoverlay=gpio-ir-tx,gpio_pin=18

    # Additional overlays and parameters are documented /boot/overlays/README

    # Enable audio (loads snd_bcm2835)
    dtparam=audio=on

    # Automatically load overlays for detected cameras
    camera_auto_detect=1

    # Automatically load overlays for detected DSI displays
    display_auto_detect=1

    # Enable DRM VC4 V3D driver
    dtoverlay=vc4-kms-v3d
    max_framebuffers=2

    # Disable compensation for displays with overscan
    disable_overscan=1

    [cm4]
    # Enable host mode on the 2711 built-in XHCI USB controller.
    # This line should be removed if the legacy DWC2 controller is required
    # (e.g. for USB device mode) or if USB support is not required.
    otg_mode=1

    [all]

    [pi4]
    # Run as fast as firmware / board allows
    arm_boost=1

    [all]
     

    Lyricist III
    January 18, 2022

    I tried a new install with Hyperpixel attached and interesting I’m getting the same result regarding frame buffering being out of space. https://github.com/retired-guy/Sonos-Remote/archive/refs/heads/master.zip

    pi@raspberrypi:~/sonos $
    pi@raspberrypi:~/sonos $ python3 sonos.py
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    Can't connect to pigpio at localhost(8888)

    Did you start the pigpio daemon? E.g. sudo pigpiod

    Did you specify the correct Pi host/port in the environment
    variables PIGPIO_ADDR/PIGPIO_PORT?
    E.g. export PIGPIO_ADDR=soft, export PIGPIO_PORT=8888

    Did you specify the correct Pi host/port in the
    pigpio.pi() function? E.g. pigpio.pi('soft', 8888)
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    'NoneType' object has no attribute 'send'
    Traceback (most recent call last):
      File "/home/pi/sonos/sonos.py", line 288, in <module>
        initscreen()
      File "/home/pi/sonos/sonos.py", line 72, in initscreen
        blit(img,(0,0))
      File "/home/pi/sonos/sonos.py", line 62, in blit
        fb.seek(4 * (fbw - w), 1)
    OSError: [Errno 28] No space left on device
     

    chicks
    January 18, 2022

    You’ll want to start up a few things at bootup, so over in file /etc/rc.local

    add the following lines just before the “exit 0” line at the end (make sure pigpiod has been installed):

    # Start pigpiod

    /usr/bin/pigpiod

    # Turn off HDMI
    /usr/bin/tvservice -o

    exit 0

     

    Also, make sure the Hyperpixel overlay has been installed and configured (you should see the bootup process on the Hyperpixel if it’s properly configured), rotated as desired, and the touchscreen calibrated.

    With the LCD screen installed, there may be two framebuffers, /dev/fb0 and /dev/fb1.  We want to make sure the Hyperpixel shows up as /dev/fb0

     

    This stuff assumes some Linux and Python experience, not a cakewalk for noobs.