No Audio (HDMI, 3.5mm)

OS: balenaOS 2.50.1+rev1
Base Image: balenalib/%%BALENA_MACHINE_NAME%%-node:12-run (intel-nuc)
Application is based on:


Device: Intel Nuc

I have been unable to get any audio output through HDMI or 3.5 Jack. I have attempted to use speaker-test, aplay & playing a video without success. I was able to previously create an .asoundrc file with specific hardcoded values that allowed audio to play through HDMI however this isn’t a valid solution due to the application running on many different devices with varying hardware configs.

I’m lead to believe that I shouldn’t have to do any configuration at all in order to get the sound working.

Previously working configuration ($HOME/.asoundrc):

pcm.!default {
    type hw
    card 0
    device 3
}
ctl.!default {
    type hw
    card 0
    device 3
}

aplay -L output:

null
    Discard all samples (playback) or generate zero samples (capture)
sysdefault:CARD=PCH
    HDA Intel PCH, ALC283 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC283 Analog
    Front speakers
surround21:CARD=PCH,DEV=0
    HDA Intel PCH, ALC283 Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, ALC283 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, ALC283 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, ALC283 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, ALC283 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, ALC283 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
hdmi:CARD=PCH,DEV=0
    HDA Intel PCH, HDMI 0
    HDMI Audio Output
hdmi:CARD=PCH,DEV=1
    HDA Intel PCH, HDMI 1
    HDMI Audio Output
hdmi:CARD=PCH,DEV=2
    HDA Intel PCH, HDMI 2
    HDMI Audio Output
hdmi:CARD=PCH,DEV=3
    HDA Intel PCH, HDMI 3
    HDMI Audio Output
hdmi:CARD=PCH,DEV=4
    HDA Intel PCH, HDMI 4
    HDMI Audio Output
dmix:CARD=PCH,DEV=0
    HDA Intel PCH, ALC283 Analog
    Direct sample mixing device
dmix:CARD=PCH,DEV=3
    HDA Intel PCH, HDMI 0
    Direct sample mixing device
dmix:CARD=PCH,DEV=7
    HDA Intel PCH, HDMI 1
    Direct sample mixing device
dmix:CARD=PCH,DEV=8
    HDA Intel PCH, HDMI 2
    Direct sample mixing device
dmix:CARD=PCH,DEV=9
    HDA Intel PCH, HDMI 3
    Direct sample mixing device
dmix:CARD=PCH,DEV=10
    HDA Intel PCH, HDMI 4
    Direct sample mixing device
dsnoop:CARD=PCH,DEV=0
    HDA Intel PCH, ALC283 Analog
    Direct sample snooping device
dsnoop:CARD=PCH,DEV=3
    HDA Intel PCH, HDMI 0
    Direct sample snooping device
dsnoop:CARD=PCH,DEV=7
    HDA Intel PCH, HDMI 1
    Direct sample snooping device
dsnoop:CARD=PCH,DEV=8
    HDA Intel PCH, HDMI 2
    Direct sample snooping device
dsnoop:CARD=PCH,DEV=9
    HDA Intel PCH, HDMI 3
    Direct sample snooping device
dsnoop:CARD=PCH,DEV=10
    HDA Intel PCH, HDMI 4
    Direct sample snooping device
hw:CARD=PCH,DEV=0
    HDA Intel PCH, ALC283 Analog
    Direct hardware device without any conversions
hw:CARD=PCH,DEV=3
    HDA Intel PCH, HDMI 0
    Direct hardware device without any conversions
hw:CARD=PCH,DEV=7
    HDA Intel PCH, HDMI 1
    Direct hardware device without any conversions
hw:CARD=PCH,DEV=8
    HDA Intel PCH, HDMI 2
    Direct hardware device without any conversions
hw:CARD=PCH,DEV=9
    HDA Intel PCH, HDMI 3
    Direct hardware device without any conversions
hw:CARD=PCH,DEV=10
    HDA Intel PCH, HDMI 4
    Direct hardware device without any conversions
plughw:CARD=PCH,DEV=0
    HDA Intel PCH, ALC283 Analog
    Hardware device with all software conversions
plughw:CARD=PCH,DEV=3
    HDA Intel PCH, HDMI 0
    Hardware device with all software conversions
plughw:CARD=PCH,DEV=7
    HDA Intel PCH, HDMI 1
    Hardware device with all software conversions
plughw:CARD=PCH,DEV=8
    HDA Intel PCH, HDMI 2
    Hardware device with all software conversions
plughw:CARD=PCH,DEV=9
    HDA Intel PCH, HDMI 3
    Hardware device with all software conversions
plughw:CARD=PCH,DEV=10
    HDA Intel PCH, HDMI 4
    Hardware device with all software conversions

ls /dev/snd:

by-path    pcmC0D0c  pcmC0D10p  pcmC0D7p  pcmC0D9p
controlC0  pcmC0D0p  pcmC0D3p   pcmC0D8p  timer

Hi there,

Welcome to the forums. A colleague of mine has been working on audio projects lately, including on a NUC, and has found that they often have the sound card disabled and the volume set to zero. He’s suggested you do the following in a script:

amixer --card hda-intel --quiet cset numid=2 on,on  # Master Playback Switch --> turn on hardware
amixer --card hda-intel --quiet cset numid=1 87,87  # Master Playback Volume --> max volume

Let me know how you go.
Phil

Thanks for getting back to me.

Interestingly for me when running those commands I’m not able to use the card name (hda-intel) but need to use card number (0) otherwise I get errors but that’s all fine.

I’m also able to get a sound to play from the connected HDMI output however i’m only able to get an output when using speaker-test -c 2 -D hw:0,3 due to what I’m assuming is the default device being the audio jack (hw:0,0)

card 0: PCH [HDA Intel PCH], device 0: ALC283 Analog [ALC283 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 10: HDMI 4 [HDMI 4]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

So my issue is that I have an active HDMI connection (only 1 HDMI port) to a tv, I’m playing a video in a HTML5 player and am getting the video output correctly however there is no sound from the HDMI. My assumption being that ALSA is defaulting to the audio jack which seems wrong and should just be output the sound through HDMI as the is nothing plugged into the audio jack.

I am able to force the default audio device to the HDMI through the use of the .asoundrc I mentioned above however I can’t rely on that because the application will be running on many different devices (Intel Nuc, Giada, more). I need a solution that doesn’t require needing to set the default audio device to the relevant HDMI output as I’ll also have cases where the audio jack will be used for sound output instead of HDMI. Even if I can just force sound to play from all audio playback devices (3.5 & HDMI)

For the Giada player for reference: aplay -l

card 0: bytchtes8316 [bytcht-es8316], device 0: Audio (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: bytchtes8316 [bytcht-es8316], device 1: Deep-Buffer Audio (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Audio [Intel HDMI/DP LPE Audio], device 0: HdmiLpeAudio [Intel HDMI/DP LPE Audi]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Audio [Intel HDMI/DP LPE Audio], device 1: HdmiLpeAudio [Intel HDMI/DP LPE Audi]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Audio [Intel HDMI/DP LPE Audio], device 2: HdmiLpeAudio [Intel HDMI/DP LPE Audi]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Look forward to hearing back! I’m running out of ideas :sob:

I think most of your assumptions are correct. First the hda-intel thing won’t work as that is a naming thing my colleague did an audio primitive project he is working on, so it’s fine to use the card number.
Looks like something maybe botched in your setup, from our experience the audio jack in NUCs take over the HDMI audio ONLY IF you plug something in, so perhaps there is a hardware issue there where it doesn’t detect the plugged cable. I think forcing the default ALSA card is what I would do, though perhaps I would try this “official” approach instead of what you did (I think they are almost the same though): https://www.alsa-project.org/wiki/Setting_the_default_device

Now since you have multiple devices that operate differently yeah its gonna need multiple configurations. I don’t see an easy way around that unfortunately :frowning:

You might want to take a look at the audio primitive project my colleague is currently working on: https://github.com/balenalabs-incubator/audio-primitive as it is meant to drastically improve and abstract the way one uses audio on the balenaOS system. It might offer some inspiration or solve your problem. It is still very early work, so there are no guarantees (yet) but its in very active development and something we want to push and improve a lot since audio across heterogeneous fleets of device is something that causes a lot of pain for people.

It does seem that for the moment specific device configs is the solution. I will keenly watch the audio-primitive project for updates.
I’ve already found some useful info from looking through the repo.

For anyone reading this looking for a solution to the same problem I’m currently creating a config file in a script for relevant system like so:
File: $HOME/.asoundrc
Contents (determined with aplay -l):

  pcm.!default {
        type hw
        card 1
        device 2
   }

Thanks for the help!

hey there, thanks for the tip!