# Omxplayer need help to play sounds on raspi

**URL:** <https://discourse.nodered.org/t/omxplayer-need-help-to-play-sounds-on-raspi/15643>\
**Category:** General\
**Created:** [17 September 2019 21:05 UTC](https://discourse.nodered.org/t/omxplayer-need-help-to-play-sounds-on-raspi/15643 "2019-09-17T21:05:33Z")\
**Posts on this page:** 15\
**Page:** 2

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [18 September 2019 15:00 UTC](https://discourse.nodered.org/t/omxplayer-need-help-to-play-sounds-on-raspi/15643/21 "2019-09-18T15:00:15Z")

</div>

`usr/bin/omxplayer`

try:

`/usr/bin/omxplayer`  
instead.

---

<div class="post-metadata">

**Author:** ![WhiteLion](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/whitelion/32/12266_2.png) [@WhiteLion](https://discourse.nodered.org/u/WhiteLion)\
**Post date:** [18 September 2019 15:03 UTC](https://discourse.nodered.org/t/omxplayer-need-help-to-play-sounds-on-raspi/15643/22 "2019-09-18T15:03:48Z")

</div>

I did... same result: [pic](http://puu.sh/EiDt5/1a2406642e.png)

---

<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 September 2019 15:21 UTC](https://discourse.nodered.org/t/omxplayer-need-help-to-play-sounds-on-raspi/15643/24 "2019-09-18T15:21:04Z")

</div>

What happens if you put in the name of a file that does not exist for the song file?

---

<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 September 2019 15:23 UTC](https://discourse.nodered.org/t/omxplayer-need-help-to-play-sounds-on-raspi/15643/25 "2019-09-18T15:23:28Z")

</div>

Also what do you see on output 1?

---

<div class="post-metadata">

**Author:** ![WhiteLion](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/whitelion/32/12266_2.png) [@WhiteLion](https://discourse.nodered.org/u/WhiteLion)\
**Post date:** [18 September 2019 15:25 UTC](https://discourse.nodered.org/t/omxplayer-need-help-to-play-sounds-on-raspi/15643/26 "2019-09-18T15:25:42Z")

</div>

[Click to see if file not exist (Code:1)](http://puu.sh/EiDO1/b90678e75a.png)

EDIT: I created test.sh with cmdline and tried to execute it with an exec node... same error (Code 255) .... hmmpf

---

<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 September 2019 15:37 UTC](https://discourse.nodered.org/t/omxplayer-need-help-to-play-sounds-on-raspi/15643/27 "2019-09-18T15:37:02Z")

</div>

And on output 1?

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [18 September 2019 15:37 UTC](https://discourse.nodered.org/t/omxplayer-need-help-to-play-sounds-on-raspi/15643/28 "2019-09-18T15:37:07Z")

</div>

> Error: not redy yet

This is the hint I think.

```auto
filename = "/home/pi/Desktop/lassedenken.mp3"
return {filename:filename,payload:"open"}

```

and next send the payload:

```auto
{payload:"playpause"}

```

---

<div class="post-metadata">

**Author:** ![WhiteLion](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/whitelion/32/12266_2.png) [@WhiteLion](https://discourse.nodered.org/u/WhiteLion)\
**Post date:** [18 September 2019 15:47 UTC](https://discourse.nodered.org/t/omxplayer-need-help-to-play-sounds-on-raspi/15643/29 "2019-09-18T15:47:06Z")

</div>

> [@bakman2](#):
>
> filename = "/home/pi/Desktop/lassedenken.mp3" return {filename:filename,payload:"open"}

thx ... result is: "The name org.mpris.MediaPlayer2.omxplayer was not provided by any .service files"  
leads me to this: [Error using debus for muting and unmuting · Issue #492 · popcornmix/omxplayer · GitHub](https://github.com/popcornmix/omxplayer/issues/492)

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [18 September 2019 15:48 UTC](https://discourse.nodered.org/t/omxplayer-need-help-to-play-sounds-on-raspi/15643/30 "2019-09-18T15:48:53Z")

</div>

Then i'm lost 😉  
I suspect that the omxplayer on commandline/exec node requires access to /dev and node-red does not have the privileges.

---

<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 September 2019 15:52 UTC](https://discourse.nodered.org/t/omxplayer-need-help-to-play-sounds-on-raspi/15643/31 "2019-09-18T15:52:57Z")

</div>

You still haven't told us what you see on output 1 when you use the exec node.

---

<div class="post-metadata">

**Author:** ![WhiteLion](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/whitelion/32/12266_2.png) [@WhiteLion](https://discourse.nodered.org/u/WhiteLion)\
**Post date:** [18 September 2019 15:53 UTC](https://discourse.nodered.org/t/omxplayer-need-help-to-play-sounds-on-raspi/15643/32 "2019-09-18T15:53:49Z")

</div>

bash / console output: File "/home/pi/songs/blabla.mp3" not found.

node red output:  
object  
code: 255  
message: string  
Command failed: /home/pi/Downloads/test.sh

---

<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 September 2019 15:55 UTC](https://discourse.nodered.org/t/omxplayer-need-help-to-play-sounds-on-raspi/15643/33 "2019-09-18T15:55:17Z")

</div>

I meant for the good file. Connect a debug node to output 1 and show us what you see.  
**Edit** That is for the direct call to omxplayer, not the script.

---

<div class="post-metadata">

**Author:** ![WhiteLion](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/whitelion/32/12266_2.png) [@WhiteLion](https://discourse.nodered.org/u/WhiteLion)\
**Post date:** [18 September 2019 16:02 UTC](https://discourse.nodered.org/t/omxplayer-need-help-to-play-sounds-on-raspi/15643/34 "2019-09-18T16:02:21Z")

</div>

[This is the output with a good file (output 1 and output 3)](http://puu.sh/EiEqD/7c60b173a1.png)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [18 September 2019 16:04 UTC](https://discourse.nodered.org/t/omxplayer-need-help-to-play-sounds-on-raspi/15643/35 "2019-09-18T16:04:05Z")

</div>

A quick google search for the error message you are getting `failed to open vchiq instance` finds this stack overflow question about running omxplayer on a Pi from Php code - [https://stackoverflow.com/questions/42583835/failed-to-open-vchiq-instance](https://stackoverflow.com/questions/42583835/failed-to-open-vchiq-instance)

Check the answers for the solution.

---

<div class="post-metadata">

**Author:** ![WhiteLion](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/whitelion/32/12266_2.png) [@WhiteLion](https://discourse.nodered.org/u/WhiteLion)\
**Post date:** [18 September 2019 16:47 UTC](https://discourse.nodered.org/t/omxplayer-need-help-to-play-sounds-on-raspi/15643/36 "2019-09-18T16:47:29Z")

</div>

Thx ! This is the solution for "exec node not working" and for "rpi-omxplayer does not play sounds":

```auto
sudo chmod 777 /dev/vchiq

```

Much thanx to all that quick and exelent help to all you guys who answered !!!  
@knolleary @Colin @bakman2 @ukmoose @afelix (no special order)  
See ya in my next thread 😉

[Previous page](https://discourse.nodered.org/t/omxplayer-need-help-to-play-sounds-on-raspi/15643.md?page=1)
