# balena os, audio issue, upboard

**URL:** <https://forums.balena.io/t/balena-os-audio-issue-upboard/361721>\
**Category:** balenaOS\
**Tags:** support, docker, sound\
**Created:** [September 9, 2022, 9:20am UTC](https://forums.balena.io/t/balena-os-audio-issue-upboard/361721 "2022-09-09T09:20:29Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aleksey](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@Aleksey](https://forums.balena.io/u/Aleksey)\
**Post date:** [September 9, 2022, 9:20am UTC](https://forums.balena.io/t/balena-os-audio-issue-upboard/361721/1 "2022-09-09T09:20:29Z")

</div>

Hi all.  
I faced the audio issue on the up-board.  
I use the balenablocks/audio but can’t hear anything.  
Here is my setup:  
Here my setup:

```auto
HOST OS VERSION
balenaOS 2.101.11
development
SUPERVISOR VERSION
14.0.14

```

Docker compouse:

```auto
services:
    audio:
        image: balenablocks/audio
        privileged: true
        environment:
            - AUDIO_OUTPUT=alsa_output.usb-soundcard-1.analog-stereo
        volumes:
            - 'pulse:/run/pulse'

    my-audio-app:
        build: ./audio-app
        volumes:
            - 'pulse:/run/pulse'

```

Here is the output of alpay --list-devices command:

```auto
bash-5.1# aplay -l
****List of PLAYBACK Hardware Devices****
card 0: Audio [Intel HDMI/DP LPE Audio], device 0: HdmiLpeAudio [Intel HDMI/DP LPE Audi]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Audio [Intel HDMI/DP LPE Audio], device 1: HdmiLpeAudio [Intel HDMI/DP LPE Audi]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Audio [Intel HDMI/DP LPE Audio], device 2: HdmiLpeAudio [Intel HDMI/DP LPE Audi]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: usb-soundcard-1 [USB Audio Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

```

And here is the output of the pactl list short sinks command:

```auto
bash-5.1# pactl list short sinks
0 alsa_output.usb-soundcard-1.analog-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED

```

My app is a small nodejs script that tries to play some audio.  
I tried to play some audio inside the audio container with the aplay command but no sound play out from the speakers.  
I have no idea where the problem can be.  
Can you suggest something?

---

<div class="post-metadata">

**Author:** ![james-cws](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@james-cws](https://forums.balena.io/u/james-cws)\
**Post date:** [September 9, 2022, 4:42pm UTC](https://forums.balena.io/t/balena-os-audio-issue-upboard/361721/2 "2022-09-09T16:42:57Z")

</div>

Hi aleksey, since you have

```auto
        volumes:
            - 'pulse:/run/pulse'

```

is it safe to assume you’re using UNIX sockets for the Pulse server? Can you make sure your client container has the `PULSE_SERVER` environment variable set as well, ideally in the Dockerfile; more details can be found in the the README for the audio block at [GitHub - balenablocks/audio: Audio building block for balenaOS, based on pulseaudio.](https://github.com/balenablocks/audio) and in particular the `Send/receive audio` section [GitHub - ramirogm/audio: Audio building block for balenaOS, based on pulseaudio.](https://github.com/ramirogm/audio#sendreceive-audio)

Otherwise it looks like you’re on the right track assuming your goal is to output audio on the USB soundcard. If you’re still having problems, are you willing to share your client container Dockerfile so we can make sure it’s correct?

---

<div class="post-metadata">

**Author:** ![Aleksey](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@Aleksey](https://forums.balena.io/u/Aleksey)\
**Post date:** [September 12, 2022, 4:46am UTC](https://forums.balena.io/t/balena-os-audio-issue-upboard/361721/4 "2022-09-12T04:46:44Z")

</div>

Hi @james-cws. My setup still doesn’t work.  
Here my client Dockerfile:

```auto
FROM balenalib/up-board-node:16-run

ENV PULSE_SERVER=unix:/run/pulse/pulseaudio.socket

RUN install_packages python pkg-config make g++ libpulse-dev

WORKDIR /usr/src
COPY . .

RUN npm install

CMD ["npm", "start"]

```

Thanks

---

<div class="post-metadata">

**Author:** ![Aleksey](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@Aleksey](https://forums.balena.io/u/Aleksey)\
**Post date:** [September 14, 2022, 12:35pm UTC](https://forums.balena.io/t/balena-os-audio-issue-upboard/361721/5 "2022-09-14T12:35:24Z")

</div>

@james-cws Still looking for help

---

<div class="post-metadata">

**Author:** ![james-cws](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@james-cws](https://forums.balena.io/u/james-cws)\
**Post date:** [September 15, 2022, 10:11pm UTC](https://forums.balena.io/t/balena-os-audio-issue-upboard/361721/6 "2022-09-15T22:11:27Z")

</div>

Hi aleksey, your Dockerfile looks about right, though it’s unclear what your audio source is. Are you able to use a local .wav similar to the example at [audio/Dockerfile.template at master · balenablocks/audio · GitHub](https://github.com/balenablocks/audio/blob/master/examples/nodejs/Dockerfile.template) to get a baseline?

---

<div class="post-metadata">

**Author:** ![Aleksey](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@Aleksey](https://forums.balena.io/u/Aleksey)\
**Post date:** [September 16, 2022, 10:08am UTC](https://forums.balena.io/t/balena-os-audio-issue-upboard/361721/7 "2022-09-16T10:08:33Z")

</div>

Hi @james-cws. I’m using your audio file. It’s stored in the file system and mapped in a docker container, but after your suggestion, I tried to load it while building. And it still doesn’t work.  
Docker file:

```auto
FROM balenalib/up-board-node:16-run

ENV PULSE_SERVER=unix:/run/pulse/pulseaudio.socket

RUN install_packages python pkg-config make g++ libpulse-dev
RUN curl https://www.kozco.com/tech/LRMonoPhase4.wav --silent --output sample.wav

WORKDIR /usr/src
COPY . .

RUN npm install

CMD ["npm", "start"]

```

---

<div class="post-metadata">

**Author:** ![james-cws](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@james-cws](https://forums.balena.io/u/james-cws)\
**Post date:** [September 16, 2022, 2:48pm UTC](https://forums.balena.io/t/balena-os-audio-issue-upboard/361721/10 "2022-09-16T14:48:43Z")

</div>

Hi aleksey, do you get any error messages when trying to play audio manually, ie trying to test the sample.wav using aplay?

The upboard isn’t a supported device for the audio block; you’re welcome to try but it’s going to require some experimentation & I can’t guarantee it will work. I see someone else has tried to get audio working in this [balena os - upboard - audio playout issue - #18 by gzett](https://forums.balena.io/t/balena-os-upboard-audio-playout-issue/344907/18) forum thread, could you review the posts there and see if any of the suggestions help?

---

<div class="post-metadata">

**Author:** ![Aleksey](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@Aleksey](https://forums.balena.io/u/Aleksey)\
**Post date:** [September 19, 2022, 9:21am UTC](https://forums.balena.io/t/balena-os-audio-issue-upboard/361721/12 "2022-09-19T09:21:52Z")

</div>

Hi @james-cws. Thanks. I have read [provided thread](https://forums.balena.io/t/balena-os-upboard-audio-playout-issue/344907/18) before starting my thread. I don’t see any error while playing audio through aplay. It looks like it’s playing but I can’t hear anything.

---

<div class="post-metadata">

**Author:** ![Aleksey](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@Aleksey](https://forums.balena.io/u/Aleksey)\
**Post date:** [September 26, 2022, 1:25pm UTC](https://forums.balena.io/t/balena-os-audio-issue-upboard/361721/13 "2022-09-26T13:25:05Z")

</div>

@james-cws Hi. I tried to use same configuration for RaspberryPI 3 and I still can’t hear anything. I tried 2 difference output devices and hear nothing. And with RPI 3 I see some errors and warinigs in terminal.

 ![image](https://global.discourse-cdn.com/balena/original/2X/e/e3abb3de206ab2f2adbb5340bc6e66384dde9d8a.png)  
Do you have some thoughts?

---

<div class="post-metadata">

**Author:** ![james-cws](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@james-cws](https://forums.balena.io/u/james-cws)\
**Post date:** [September 30, 2022, 8:15pm UTC](https://forums.balena.io/t/balena-os-audio-issue-upboard/361721/14 "2022-09-30T20:15:13Z")

</div>

Hi Aleksey,

It looks like you’re trying to validate your configuration for the upboard using a RPi 3? The error you’re seeing re DBUS is likely related to [rpi4: snd\_bcm2835 kernel module not being loaded on newer balenaOS versions · Issue #100 · balenablocks/audio · GitHub](https://github.com/balenablocks/audio/issues/100) and is (probably) unrelated to the issues you were seeing with the up-board (assuming that you don’t see the same errors on the up-board). You could try some of the proposed solutions in the linked github issue for your RPi 3 or, if the goal is just to verify your configuration, you could test on an older version of balenaOS.

For your up-board, it’s very difficult to say where the issue is - by default, the up-board device tree directs onboard audio to the ADC on the hat header via I2S so it’s possible you may need to manually add support to the OS for your particular USB audio device. You can start your investigation by looking into the output of `lsusb` and `lsmod` to see if your USB device is being detected properly & what, if any, driver is being used. It may also be helpful to search around on up-board specific forums or message boards and verify that your USB audio device is supported at all on the up-board.
