Tvservice command hangs on all newly built images

My video streaming application is running in production powering 10+ TV channels. But since the last build, it hangs on startup. I traced it to the following shell command in my startup script:

tvservice -e "cea 5" --ntsc

That command never completes. You have to press Ctrl+C to get it to finish. Running tvservice -s has the same effect.

I checked out an old, known-good build, created a new branch, made a dummy commit to change the git revision, and pushed to balena-nocache. The problem persists.

Deriving my image from balenalib/raspberry-pi-debian:stretch-run-20190511 fixes the problem. Both balenalib/raspberry-pi-debian:stretch-run and balenalib/raspberry-pi-debian:buster-run I didn’t bother to test for the exact commit that broke it.

Steps to reproduce:

  1. Push any image based on balenalib/raspberry-pi-debian:stretch-run.
  2. Log into the container (not the host os) in the BalenCloud dashboard.
  3. Run tvservice -s
  4. Now derive your image from balenalib/raspberry-pi-debian:stretch-run-20190511 and try again.

I’ve found a temporary workaround, but I would really like to be able to get the latest security updates.

@whm I think this is related:

Try adding this to your Dockerfile (or integrating it with what you have):

RUN    apt-get update \
    && apt-get install libraspberrypi-bin=1.20180328-1~nokernel1 libraspberrypi0=1.20180328-1~nokernel1 --allow-downgrades -y \
    && rm -rf /var/lib/apt/lists/*

Edit: I just ran up a test device and can confirm I reproduced the hang you mentioned by running tvservice -s, and it was resolved by downgrading the firmware as above. Thanks for the detailed steps to reproduce!

1 Like


My balena-kodi application also no longer worked when I (re)deployed it today.

To fix it I did the following (very similar to what you did):

  1. used an older image (= balenalib/%%BALENA_MACHINE_NAME%%-node:12.1-stretch-run-20190511 ) in my Dockerfile.template instead of latest-stretch-run.
  2. removed apt-get upgrade -y in my Dockerfile.template
  3. I also installed fbset but it is not clear if this is really needed.

When I had the problem (as far as I remember) it also showed the tvservice when doing ps -ef but in the currently fixed installation tvservice is no longer appearing when doing ps -ef.

1 Like

@janvda it sounds like what I posted above would probably work in your case as well!

Indeed the change you suggested about adding libraspberrypi-bin=1.20180328-1~nokernel1 libraspberrypi0=1.20180328-1~nokernel1 --allow-downgrades -y worked for me in combination with latest image (= balenalib/%%BALENA_MACHINE_NAME%%-node:latest-stretch-run ) and also with apt-get upgrade -y

FYI my RUN command =

RUN apt-get clean && apt-get update && apt-get upgrade -y && apt-get install \
  libraspberrypi-bin=1.20180328-1~nokernel1 libraspberrypi0=1.20180328-1~nokernel1 --allow-downgrades -y \
  apt-utils \
  build-essential \
  libasound2-dev \

Thanks a lot.