# Unable to get audio out of 3.5mm jack

**URL:** <https://discourse.nodered.org/t/unable-to-get-audio-out-of-3-5mm-jack/58580>\
**Category:** General\
**Created:** [18 February 2022 07:04 UTC](https://discourse.nodered.org/t/unable-to-get-audio-out-of-3-5mm-jack/58580 "2022-02-18T07:04:22Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark.lucas](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mark.lucas](https://discourse.nodered.org/u/mark.lucas)\
**Post date:** [18 February 2022 07:04 UTC](https://discourse.nodered.org/t/unable-to-get-audio-out-of-3-5mm-jack/58580/1 "2022-02-18T07:04:22Z")

</div>

Hi All,

I'm sure this is a fairly common issue, however, I am unable to find a solution.  
I am trying to create a warning system using node red (raspberry pi) and a two way radio.  
I cant get the speakerpi node to work properly. I have installed the ```  
sudo apt-get install libasound2-dev

```nohighlight

msg : Object
object
_msgid: "03484813242dca83"
speech: "test message"
player: "error"

 Choose Output 
Stream based
 Channel 
Stereo
 Bit Depth 
16 Bit
 Sample Rate (HZ) 
22,050 Hz
 Name

```

I'm not sure why I am getting this error. I'm thinking its an issue with what im injecting.  
Any help would be appreciated.

Thanks,  
Mark.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [18 February 2022 11:41 UTC](https://discourse.nodered.org/t/unable-to-get-audio-out-of-3-5mm-jack/58580/2 "2022-02-18T11:41:32Z")

</div>

Welcome to the forum Mark!

Did you make sure to set the audio settings (per the [readme](https://flows.nodered.org/node/node-red-contrib-speakerpi) for the node)?  
did you try - outside or NR - to play audio?  
what file format did you send to the node?

What version of Node-RED and node.js are you running (take a look at the NR startup log to get this)

I just tried it and it works for me.

Please export your flow and attachet to a reply:

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<div class="post-metadata">

**Author:** ![mark.lucas](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mark.lucas](https://discourse.nodered.org/u/mark.lucas)\
**Post date:** [18 February 2022 13:14 UTC](https://discourse.nodered.org/t/unable-to-get-audio-out-of-3-5mm-jack/58580/3 "2022-02-18T13:14:52Z")

</div>

Hi Zenofmud,

Thanks for your welcome and quick reply.  
I have played audio outside NR (via youtube to the speaker jack).  
The audio is fine from YT. So electrically the speakers and circuit are fine.  
I did follow the readme and set up the node as suggested but still can't get it to work.

I am sending text to the node to do txt to speech. using a msg.speech string.

I don't have acess to the Raspberry Pi at the moment as it is at work, but I will post the code when I'm in the office next.

Its a new install so I presume its the latest edition of NR however I'm not 100% sure.

are you able to post your working code/demo flow so I can try it on another Raspberry Pi over the weekend ?

Thanks,  
Mark

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [18 February 2022 15:24 UTC](https://discourse.nodered.org/t/unable-to-get-audio-out-of-3-5mm-jack/58580/4 "2022-02-18T15:24:24Z")

</div>

here is the test flow. You will need a `wav` file to test with

```auto
[{"id":"18c51ceca19c7b54","type":"inject","z":"126b675229328575","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":320,"y":140,"wires":[["59da6b0c65cc40e5"]]},{"id":"59da6b0c65cc40e5","type":"speakerpi-output","z":"126b675229328575","choose":"givenfile","filename":"/home/pi/audio/word1.wav","channels":"1","bitdepth":"16","samplerate":"22050","name":"","x":520,"y":140,"wires":[["663ec6350a63d436"]]},{"id":"663ec6350a63d436","type":"debug","z":"126b675229328575","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":770,"y":140,"wires":[]},{"id":"651b3627d9e879dc","type":"debug","z":"126b675229328575","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":630,"y":240,"wires":[]},{"id":"90b852f3e618d295","type":"catch","z":"126b675229328575","name":"","scope":null,"uncaught":false,"x":440,"y":240,"wires":[["651b3627d9e879dc"]]}]

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [18 February 2022 16:03 UTC](https://discourse.nodered.org/t/unable-to-get-audio-out-of-3-5mm-jack/58580/5 "2022-02-18T16:03:31Z")

</div>

> [@mark.lucas](#):
>
> Its a new install so I presume its the latest edition of NR however I'm not 100% sure.

New install of what? The pi OS includes an old version of node-red, so unless you have installed node red (probably using the method suggested in the [node red docs](https://nodered.org/docs/getting-started/raspberrypi)) then it will not be up to date.

---

<div class="post-metadata">

**Author:** ![mark.lucas](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mark.lucas](https://discourse.nodered.org/u/mark.lucas)\
**Post date:** [18 February 2022 23:57 UTC](https://discourse.nodered.org/t/unable-to-get-audio-out-of-3-5mm-jack/58580/6 "2022-02-18T23:57:47Z")

</div>

Its ver 2.2.1 using the instructions from the NR website.

Cheers

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [19 February 2022 10:18 UTC](https://discourse.nodered.org/t/unable-to-get-audio-out-of-3-5mm-jack/58580/7 "2022-02-19T10:18:35Z")

</div>

Did the test flow I provided work?

---

<div class="post-metadata">

**Author:** ![mark.lucas](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mark.lucas](https://discourse.nodered.org/u/mark.lucas)\
**Post date:** [19 February 2022 11:18 UTC](https://discourse.nodered.org/t/unable-to-get-audio-out-of-3-5mm-jack/58580/8 "2022-02-19T11:18:16Z")

</div>

Thanks Paul,

No, unfortunately it just output static to the speakers.  
When i play the same wav file on vlc via the raspberry pi desktop it works fine.

The debug node indicates that the speakerpi node played the file.

Do you have any suggestions that i could try?

Thanks.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [19 February 2022 11:26 UTC](https://discourse.nodered.org/t/unable-to-get-audio-out-of-3-5mm-jack/58580/9 "2022-02-19T11:26:22Z")

</div>

Ok, let me get some basic info  
What model Pi? `cat /proc/device-tree/model`  
What OS? `lsb_release -c`  
What version of NR and Node.js (you can get this from the NR startup log) I note you have NR 2.2.1

---

<div class="post-metadata">

**Author:** ![mark.lucas](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mark.lucas](https://discourse.nodered.org/u/mark.lucas)\
**Post date:** [19 February 2022 11:50 UTC](https://discourse.nodered.org/t/unable-to-get-audio-out-of-3-5mm-jack/58580/10 "2022-02-19T11:50:46Z")

</div>

> [@zenofmud](#):
>
> cat /proc/device-tree/model

Raspberry Pi 3 Model B Plus Rev 1.3

Codename: bullseye

19 Feb 11:49:48 - [info] Node-RED version: v2.2.2  
19 Feb 11:49:48 - [info] Node.js version: v14.19.0  
19 Feb 11:49:48 - [info] Linux 5.10.92-v7+ arm LE

---

<div class="post-metadata">

**Author:** ![mark.lucas](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mark.lucas](https://discourse.nodered.org/u/mark.lucas)\
**Post date:** [19 February 2022 11:52 UTC](https://discourse.nodered.org/t/unable-to-get-audio-out-of-3-5mm-jack/58580/11 "2022-02-19T11:52:05Z")

</div>

I upgraded to 2.2.2 to see if that would resolve the issue. it didn't make any difference.

thanks,  
mark

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [19 February 2022 12:14 UTC](https://discourse.nodered.org/t/unable-to-get-audio-out-of-3-5mm-jack/58580/12 "2022-02-19T12:14:01Z")

</div>

Open a terminal window and enter `amixer` and show me the results please.  
For reference I get:

```auto
Simple mixer control 'Headphone',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback -10239 - 400
  Mono: Playback 31 [97%] [0.31dB] [on]

```

---

<div class="post-metadata">

**Author:** ![mark.lucas](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mark.lucas](https://discourse.nodered.org/u/mark.lucas)\
**Post date:** [20 February 2022 03:22 UTC](https://discourse.nodered.org/t/unable-to-get-audio-out-of-3-5mm-jack/58580/13 "2022-02-20T03:22:05Z")

</div>

> [@zenofmud](#):
>
> amixer

pi@raspberrypi:~ $ amixer  
Simple mixer control 'Master',0  
Capabilities: pvolume pswitch pswitch-joined  
Playback channels: Front Left - Front Right  
Limits: Playback 0 - 65536  
Mono:  
Front Left: Playback 65500 [100%] [on]  
Front Right: Playback 65500 [100%] [on]  
Simple mixer control 'Capture',0  
Capabilities: cvolume cswitch cswitch-joined  
Capture channels: Front Left - Front Right  
Limits: Capture 0 - 65536  
Front Left: Capture 65536 [100%] [on]  
Front Right: Capture 65536 [100%] [on]

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [20 February 2022 09:13 UTC](https://discourse.nodered.org/t/unable-to-get-audio-out-of-3-5mm-jack/58580/14 "2022-02-20T09:13:17Z")

</div>

Hmmm that doesn't look like it is the audio jack - I believe the audio jack it mono.

here is something I found [audio - sound output stuck on HDMI (working) - Raspberry Pi Stack Exchange](https://raspberrypi.stackexchange.com/questions/113997/sound-output-stuck-on-hdmi-working) that might help out.

Also what happens if you force audio to the 3.5mm jack - see [Raspberry Pi - Configuring Audio Output - YouTube](https://www.youtube.com/watch?v=dklzB3CpAQE)

---

<div class="post-metadata">

**Author:** ![mark.lucas](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mark.lucas](https://discourse.nodered.org/u/mark.lucas)\
**Post date:** [20 February 2022 10:17 UTC](https://discourse.nodered.org/t/unable-to-get-audio-out-of-3-5mm-jack/58580/15 "2022-02-20T10:17:36Z")

</div>

![Audio Rpi](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/6/36886583d8de2e97005a4bb346a1256c996629b6.jpeg)  
Hi mate,

I only have the headphones as a option.  
also, when I play audio from the web browser on the rpi using youtube or vlc, it is fine.  
I believe the issue might be something node red or node related as it works fine outside of NR.

---

<div class="post-metadata">

**Author:** ![mark.lucas](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mark.lucas](https://discourse.nodered.org/u/mark.lucas)\
**Post date:** [20 February 2022 10:18 UTC](https://discourse.nodered.org/t/unable-to-get-audio-out-of-3-5mm-jack/58580/16 "2022-02-20T10:18:54Z")

</div>

When I play my .wav file on vlc, it plays fine. the same .wav file played using the speakerpi node on node red just produces static.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [20 February 2022 10:27 UTC](https://discourse.nodered.org/t/unable-to-get-audio-out-of-3-5mm-jack/58580/17 "2022-02-20T10:27:34Z")

</div>

No idea if this will help you or not but this is what I use to play .mp3 on an old Model B

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/1/81cbf3d8e0bce1b651e9b553d649e8a0d4b2723e.png)

IIRC I had to install sudo apt install mpg123

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [20 February 2022 10:29 UTC](https://discourse.nodered.org/t/unable-to-get-audio-out-of-3-5mm-jack/58580/18 "2022-02-20T10:29:27Z")

</div>

> [@mark.lucas](#):
>
> I believe the issue might be something node red or node related as it works fine outside of NR.

Except it works fine for me, so it is something about your setup vrs mine. One difference is I'm using the 'lite' version - no desktop. I'm going to flash an SD card with the latest and see what happens. Check back in an hour.

---

<div class="post-metadata">

**Author:** ![mark.lucas](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mark.lucas](https://discourse.nodered.org/u/mark.lucas)\
**Post date:** [20 February 2022 10:44 UTC](https://discourse.nodered.org/t/unable-to-get-audio-out-of-3-5mm-jack/58580/19 "2022-02-20T10:44:43Z")

</div>

Thanks, Ill give this a try too.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [20 February 2022 11:40 UTC](https://discourse.nodered.org/t/unable-to-get-audio-out-of-3-5mm-jack/58580/20 "2022-02-20T11:40:51Z")

</div>

Ok, it is working for me. Note I did have to issue the command `amixer cset numid=3 1` (as explained in the node's README) to hear anything

Raspberry Pi 3 Model B Rev 1.2  
bullseye  
Node-RED version: v2.2.2  
Node.js version: v14.19.0

`amixer` results  
pi@clearpi:~/.node-red $ amixer  
Simple mixer control 'Master',0  
Capabilities: pvolume pswitch pswitch-joined  
Playback channels: Front Left - Front Right  
Limits: Playback 0 - 65536  
Mono:  
Front Left: Playback 1 [0%] [on]  
Front Right: Playback 1 [0%] [on]  
Simple mixer control 'Capture',0  
Capabilities: cvolume cswitch cswitch-joined  
Capture channels: Front Left - Front Right  
Limits: Capture 0 - 65536  
Front Left: Capture 65536 [100%] [on]  
Front Right: Capture 65536 [100%] [on]

So it's not Node-RED or node-red-contrib-speakerpi node. It could mean that something else you have installed on the Pi is causing the issue...

[Next page](https://discourse.nodered.org/t/unable-to-get-audio-out-of-3-5mm-jack/58580.md?page=2)
