No Sound on BalenaDash Kiosk

I did a fresh pull of this project and updated the pi 4 I’ve been working with yesterday morning. For the most part it looks like everything is working correctly, and even a couple little bugs seem to be resolved… Except one major issue that wasn’t immediately apparent, there is no sound coming from the video that plays once an hour on the web page that is displayed by the pi. Is there a new variable that needs to be set in order to allow audio to play through HDMI? Any help would be greatly appreciated, and sooner the better as this is a slightly bigger issue than I thought it would be at first. Thank you!

Hi there,

There are a few reasons while this could happen.
One it could be that the broweser is not playing (how the video might be embedded)
If you add https://www.yout-ube.com/watch?v=dQw4w9WgXcQ to the LAUNCH_URL parameter, do you hear any sound?

On the balenaSound project, we saw that sometimes the RaspberryPi 4 was showing issues playing sound on the HDMI1, therefore we recomment o use the HDMI0 (that is the one next to the power connector)
and plugging the HDMI before plugging the power

Also, have you tried plugging headphones into the RPi to se if there is some sound at all coming out?

try those points and that may give us a better insight of where the problem may lay.

Let us know how it went

1 Like

@JuanFRidano Thank you for the reply! I verified that I was using HDMI0, and I even tried HDMI1, and still no luck. Oddly enough though after restarting the pi about 5 times going back and forth between the youtube video and the page I am displaying the pi started playing sound… I have no idea what made it work, but I guess it might have just been an issue with how it was booting at first, but it worked itself out. Thank you for your help, I will let you know if anything else weird happens.

Awesome! glad to hear it is working, a bit of a shame we didn’t find out exactly what it was but definitely come back to us if something weird happens! Have fun with the project!

1 Like

So a couple days ago the pi 4 stopped playing sound again. I tried rebooting it a few times, as well as setting it to play the youtube video directly and nothing. The sound just stopped playing but the website is still displayed and the video plays as it should. Also, the pi was not rebooted or unplugged in this time that I remember. I am going to go ahead and try a new distro of balena-dash and see if that solves anything, but any suggestions would be greatly appreciated!

hey @rjoel98, I’m sorry to hear that. Is there anything in the logs that may hint us to a failing service ?

fell free to post anything that may look strange to you

Hi there, this is indeed strange behaviour. If there is image coming out of the HDMI port the audio should too.
You can try adding the audio block to your docker-compose.yml and see if it helps with getting audio out of the HDMI port consistently:

  audio:
    image: balenablocks/audio:raspberrypi4-64
    privileged: true
    ports:
      - 4317:4317
    environment:
      AUDIO_OUTPUT: RPI_HDMI0

Let me know if this helps. Cheers.

Hey y’all, sorry for the late reply. But after pushing the updated files to the project and restarting the pi, it has been working since. I didn’t see anything strange in the logs before I updated the pi either, but I will continue to monitor it.

I have added the audio block to the files I have on my local device, so if there are any further issues I will push it through and keep you all updated on that also.

Thank you for all the help

Thanks for the update! Do let us know on this thread if you see any issues again

Ok, so over a month of working and now the audio is no longer playing again. I guess the real issue first is that I can’t even test the audio because after it first stopped I decided to do what worked last time and updated to the latest pull in github, but now the raspberry pi doesn’t play youtube videos. It just loads and then says to try to restart the computer, but that doesn’t work either. Any suggestions on what might be going on here?

I also tried doing what @tmigone suggested and added the code below to the docker-compose.yml file, but that just failed when trying to build into balena on the cli, so I don’t know if that is even still an option, but I figured I would try regardless.

  audio:
    image: balenablocks/audio:raspberrypi4-64
    privileged: true
    ports:
      - 4317:4317
    environment:
      AUDIO_OUTPUT: RPI_HDMI0

Any suggestions would be greatly appreciated. Thank you!

Hi there, when the build failed when you used the cli, what were the build logs saying?

So after a bit of digging I found that the first part was due to the version error that seems to be a known occurrence. After doing the suggested workaround I was able to get the latest pull, along with the added audio block. Unfortunately this still did not fix the issue with the YouTube video not loading, so I am still not able to verify if the audio is now assault playing.

I have switched the LAUNCH_URL to be directly on a youtube video, and here is what I see after about a minute of loading:

Any suggestions on what might be happening/where I should be looking for any other errors for this? Thank you!

Hi there - could you paste your docker-compose file into here, please?

Certainly, Below is the code I started with:

version: '2'
volumes:
  settings:
services:
  kiosk:
    restart: always
    build: ./kiosk
    privileged: true
    ports:
      - 8080:8080
    volumes:
      - 'settings:/data'
  scheduler:
    restart: always
    build: ./scheduler
    privileged: true
  wifi-connect:
    build: ./wifi-connect
    restart: always
    network_mode: host
    privileged: true
    labels:
      io.balena.features.dbus: '1'
      io.balena.features.firmware: '1'
  fbcp:
    image: balenablocks/fbcp
    privileged: true

And then I added this to the file to test, and got the same result:

audio:
    image: balenablocks/audio:raspberrypi4-64
    privileged: true
    ports:
      - 4317:4317
    environment:
      AUDIO_OUTPUT: RPI_HDMI0

Thank you!

Hi Ryan, just a quick note to say we have been able to duplicate this error, and are going to track and fix it in this GitHub Issue: Audio Renderer Error: Please Restart Your Computer · Issue #130 · balenalabs/balena-dash · GitHub

Thanks for your patience while troubleshooting and for letting us know about the error!

2 Likes

Hey @rjoel98

Just to let you know that the issue has been solved and closed. If you re-deploy your balenaDash app (by clicking the DWB button again, and selecting your existing app in the dialogue) - the fix will be deployed and audio will work again.

Thanks,
Phil

1 Like

Hey @phil-d-wilson

It appears the issue with the youtube video not playing has been resolved, but the audio from the video is still not playing through the HDMI onto the TV I am using. Is there another suggestions you all might have for this issue?

Hi

Take a look at the explanation my colleague wrote about this issue here

And you can find the workaround for this on our docs page - Support - Home - under the section No audio on HDMI output on Raspberry Pi 4. Can you confirm if that works for you?

Hey @anujdeshpande,

That does appear to be a similar issue as to what I am experiencing, but after trying the workaround it unfortunately does not fix the issue. I also am not seeing anything of use in the system logs for the kiosk, but I am going to go ahead and post them again just incase.

 kiosk Running balena base image entrypoint...
 kiosk  setting xserver-xorg-legacy/xwrapper/allowed_users from configuration file
 kiosk  Using default chromium flags
 kiosk  Enabling GPU acceleration
 kiosk  Adding user settings directory
 kiosk  Custom window size set to 
 kiosk  Enabling kiosk mode
 kiosk  Enabling cursor
 kiosk  2021/05/18 14:16:43 Command is '/home/chromium/launch.sh'
 kiosk  2021/05/18 14:16:43 Starting listening on port 8080
 kiosk  2021/05/18 14:16:44 Launch page with desiredURL = 'https://www.yout-ube.com/watch?v=dQw4w9WgXcQ'. Slack: false
 kiosk  2021/05/18 14:16:44 Redirecting to home page
 kiosk  2021/05/18 14:16:44 Running '/home/chromium/launch.sh https://www.yout-ube.com/watch?v=dQw4w9WgXcQ'
 kiosk  2021/05/18 14:16:44 Responded with home page
 kiosk  Running balena base image entrypoint...
 kiosk  setting xserver-xorg-legacy/xwrapper/allowed_users from configuration file
 kiosk  Using default chromium flags
 kiosk  Enabling GPU acceleration
 kiosk  Adding user settings directory
 kiosk  Custom window size set to 
 kiosk  Enabling kiosk mode
 kiosk  Enabling cursor
 kiosk  2021/05/18 14:17:36 Command is '/home/chromium/launch.sh'
 kiosk  2021/05/18 14:17:36 Starting listening on port 8080
 kiosk  2021/05/18 14:17:37 Launch page with desiredURL = 'https://www.yout-ube.com/watch?v=dQw4w9WgXcQ'. Slack: false
 kiosk  2021/05/18 14:17:37 Redirecting to home page
 kiosk  2021/05/18 14:17:37 Running '/home/chromium/launch.sh https://www.yout-ube.com/watch?v=dQw4w9WgXcQ'
 kiosk  2021/05/18 14:17:37 Responded with home page

Thank you for your help, and the great suggestion. I will keep looking into this to see if there is something else here!

Good to see its related here - might help us give a lead. Do you see any other error from the system?

Also, by any chance are you using a DAC with the system? (ref for supported dac: Support - Home)