# Problem with computer startup and sounds not being heard

**URL:** <https://discourse.nodered.org/t/problem-with-computer-startup-and-sounds-not-being-heard/81252>\
**Category:** General\
**Created:** [12 September 2023 20:50 UTC](https://discourse.nodered.org/t/problem-with-computer-startup-and-sounds-not-being-heard/81252 "2023-09-12T20:50:39Z")\
**Posts on this page:** 15\
**Page:** 2

<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:** [14 September 2023 07:30 UTC](https://discourse.nodered.org/t/problem-with-computer-startup-and-sounds-not-being-heard/81252/21 "2023-09-14T07:30:20Z")

</div>

It is most unlikely it is node red, it is something outside node red that is not ready.  
To find how long you have to wait you could reboot, open node red, and keep clicking the inject till it works. Then you can look in syslog to see what happened just before that time.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [14 September 2023 07:34 UTC](https://discourse.nodered.org/t/problem-with-computer-startup-and-sounds-not-being-heard/81252/22 "2023-09-14T07:34:07Z")

</div>

In a perfect world that would work.

Alas when I load firefox it takes a few minutes before I can use it.

I have about `43` WINDOWS open and some have a few tabs some have A LOT!  
It takes a lot of time.

So it kind of isn't practical. ☹

But it gives me an idea.

---

<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:** [14 September 2023 07:53 UTC](https://discourse.nodered.org/t/problem-with-computer-startup-and-sounds-not-being-heard/81252/23 "2023-09-14T07:53:49Z")

</div>

> [@Trying\_to\_learn](#):
>
> Alas when I load firefox it takes a few minutes before I can use it.

Are you running FF on the pi?!!!  
Have you got any GUI stuff auto running on boot? If so it is probably just the pi working flat out on startup preventing your output from working.

Run FF on your PC and keep it open on the editor, then you just need to refresh the page when node red is up.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [14 September 2023 07:54 UTC](https://discourse.nodered.org/t/problem-with-computer-startup-and-sounds-not-being-heard/81252/24 "2023-09-14T07:54:53Z")

</div>

This is on the NUC.

Intel 7i5 thing.

---

<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:** [14 September 2023 08:40 UTC](https://discourse.nodered.org/t/problem-with-computer-startup-and-sounds-not-being-heard/81252/25 "2023-09-14T08:40:01Z")

</div>

Oh yes, you did say that I think. Still, running the browser on another machine would allow you to get into the editor immediately node red is up.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [14 September 2023 08:49 UTC](https://discourse.nodered.org/t/problem-with-computer-startup-and-sounds-not-being-heard/81252/26 "2023-09-14T08:49:51Z")

</div>

What I've done is made a _flow_ that starts counting every second NR is _alive_ sending that to the TTS node.

When that gets its self working I will hear the value.  
_xx minutes yy seconds_

I'll just wait until next boot/session.

Does that sound like a nominal strategy?

---

<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:** [14 September 2023 09:10 UTC](https://discourse.nodered.org/t/problem-with-computer-startup-and-sounds-not-being-heard/81252/27 "2023-09-14T09:10:30Z")

</div>

That is a good idea. I would do it a little slower though, it will take more than a second to say, so you will end up with them getting queued up continuously. Perhaps do it every 5 seconds.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [14 September 2023 09:11 UTC](https://discourse.nodered.org/t/problem-with-computer-startup-and-sounds-not-being-heard/81252/28 "2023-09-14T09:11:27Z")

</div>

Touche. You said 5 seconds too.

Yeah, I realised that after posting.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [14 September 2023 14:09 UTC](https://discourse.nodered.org/t/problem-with-computer-startup-and-sounds-not-being-heard/81252/29 "2023-09-14T14:09:04Z")

</div>

> [@Trying\_to\_learn](#):
>
> Ok, sorry, thought:
> 
> How can I learn to make my installation wait for the ALSA (sound) device to be ready?

As most, if not all services on most Linux installs start up using systemd scripts, you can configure the Node-RED script to wait for other services to have started.

Have a look at the `[service]` section of the script file spec for systemd as well as the `[unit]` section which has `requires` and `after`. There is also a `[timer]` section where you can define a delayed startup.

[systemd (www.freedesktop.org)](https://www.freedesktop.org/wiki/Software/systemd/)

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [14 September 2023 20:41 UTC](https://discourse.nodered.org/t/problem-with-computer-startup-and-sounds-not-being-heard/81252/30 "2023-09-14T20:41:36Z")

</div>

Just booted today.  
Same problem.

With the script running I got 30 seconds.

# BUT!

Alas that isn't accurate.

Why?

Because of how I did the script. (Silly me)

I started a `trigger` node (only that I could then stop it when I got the desired output, rather than a `inject` node sending an output every second.

Put that into a `counter` node (sorry: `count`).  
That is how many seconds.

But as the `trigger` was every `5` seconds the time needed is 5 \* 30.  
ie: 150 seconds.

STRANGE as I had it (before this) set to 180 seconds before starting.

So there may be something else going on in the mix causing this problem.

Thanks @TotallyInformation

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [12 October 2023 08:16 UTC](https://discourse.nodered.org/t/problem-with-computer-startup-and-sounds-not-being-heard/81252/31 "2023-10-12T08:16:57Z")

</div>

Folks, sorry, it has been a while for me to post about this.

This is a test flow/code I have that is started a short time after booting.

```auto
[{"id":"3873937e50fb8fa2","type":"inject","z":"fe5670ff.ea94e","name":"Startup","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"10","topic":"","payload":"","payloadType":"date","x":100,"y":1320,"wires":[["3808cb58b5131dd7"]]},{"id":"3808cb58b5131dd7","type":"trigger","z":"fe5670ff.ea94e","name":"Clock","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"-1","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":215,"y":1320,"wires":[["9487e7a21eb9a291"]],"l":false},{"id":"d66151331cf82699","type":"inject","z":"fe5670ff.ea94e","name":"STOP","props":[{"p":"reset","v":"true","vt":"bool"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":90,"y":1400,"wires":[["3808cb58b5131dd7","9487e7a21eb9a291","79f3d1175311ff50"]]},{"id":"9487e7a21eb9a291","type":"counter","z":"fe5670ff.ea94e","name":"","init":"0","step":"1","lower":"","upper":"59","mode":"increment","outputs":"1","x":265,"y":1320,"wires":[["557407571bfbf994"]],"l":false},{"id":"f8777ebbf11de5b5","type":"link call","z":"fe5670ff.ea94e","name":"","links":["cf92980dadbeed9f"],"linkType":"static","timeout":"30","x":680,"y":1320,"wires":[["cb4fbc327699ea01"]]},{"id":"3423dd4b8318abbd","type":"debug","z":"fe5670ff.ea94e","name":"COUNT","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1190,"y":1320,"wires":[]},{"id":"9254560c11f1ad38","type":"change","z":"fe5670ff.ea94e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"count","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":1320,"wires":[["f8777ebbf11de5b5"]]},{"id":"267536ae99635aa1","type":"switch","z":"fe5670ff.ea94e","name":"59?","property":"count","propertyType":"msg","rules":[{"t":"eq","v":"59","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":470,"y":1360,"wires":[["2ba9458152698855"]]},{"id":"2ba9458152698855","type":"counter","z":"fe5670ff.ea94e","name":"","init":"0","step":"1","lower":null,"upper":null,"mode":"increment","outputs":"1","x":670,"y":1360,"wires":[["27ab4716c9ebc475"]]},{"id":"a0d4096f2907ad1e","type":"debug","z":"fe5670ff.ea94e","name":"COUNT","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":830,"y":1400,"wires":[]},{"id":"c2f36a3eac3c4b11","type":"template","z":"fe5670ff.ea94e","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{minutes}} minutes {{payload}}","output":"str","x":1010,"y":1320,"wires":[["3423dd4b8318abbd","d163f6686c928fd9"]]},{"id":"27ab4716c9ebc475","type":"change","z":"fe5670ff.ea94e","name":"","rules":[{"t":"set","p":"minutes","pt":"flow","to":"count","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":850,"y":1360,"wires":[["a0d4096f2907ad1e"]]},{"id":"cb4fbc327699ea01","type":"function","z":"fe5670ff.ea94e","name":"get minutes","func":"let minutes = flow.get('minutes') || 0;\nmsg.minutes = minutes;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":1320,"wires":[["c2f36a3eac3c4b11"]]},{"id":"557407571bfbf994","type":"function","z":"fe5670ff.ea94e","name":"mod 5","func":"let x = msg.count;\nif (x % 5 == 0)\n{\n return msg;\n}\nreturn;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":320,"y":1280,"wires":[["5362988ff6eec273"]]},{"id":"03ee2be1e4a4c5b7","type":"trigger","z":"fe5670ff.ea94e","name":"","op1":"close","op2":"open","op1type":"str","op2type":"str","duration":"4","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":330,"y":1240,"wires":[["7d369ee5b2d6c42b"]]},{"id":"7d369ee5b2d6c42b","type":"change","z":"fe5670ff.ea94e","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":425,"y":1240,"wires":[["d163f6686c928fd9"]],"l":false},{"id":"79f3d1175311ff50","type":"change","z":"fe5670ff.ea94e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"foo","tot":"str"},{"t":"delete","p":"reset","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":215,"y":1240,"wires":[["03ee2be1e4a4c5b7"]],"l":false},{"id":"5362988ff6eec273","type":"junction","z":"fe5670ff.ea94e","x":390,"y":1320,"wires":[["9254560c11f1ad38","267536ae99635aa1"]]},{"id":"d163f6686c928fd9","type":"gate","z":"fe5670ff.ea94e","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","statusCmd":"status","persist":false,"storeName":"memory","x":860,"y":1080,"wires":[["9af43c00.e81b5"]]},{"id":"9af43c00.e81b5","type":"play audio","z":"fe5670ff.ea94e","name":"","voice":"42","x":1110,"y":1000,"wires":[]}]

```

NO FOREIGN NODES!

Oops, sorry.

`node-red-contrib-counter`

It _speaks_ the uptime every 5 seconds.

So you hear:  
_zero minutes 5 seconds_  
_zero minutes 10 seconds_  
_zero minutes 15 seconds_

And so on.

Until the `STOP` button/inject node is pressed.

I am hearing NOTHING.

Also, if/when I open the tab with that code it is NOT counting.

Which may explain why I'm hearing nothing.  
Ok, I'll cop that.

It waits 10 seconds from start before it starts running.  
Yes, I will change it to another (higher) value - like maybe 30 seconds.

Though I feel I have been there already.

Still no output.

I know this is also NOT using the `watson voice` node.  
Which is what I want to use at the end of the day.  
This is just to indicate to me when the sound thing gets its act together. Then I make the delay on the `inject` node to _talk to me_ slightly bigger than that interval.

---

<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:** [12 October 2023 08:31 UTC](https://discourse.nodered.org/t/problem-with-computer-startup-and-sounds-not-being-heard/81252/32 "2023-10-12T08:31:11Z")

</div>

Add debug nodes to the flow and work out which node is not doing as it should.

---

<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:** [12 October 2023 08:40 UTC](https://discourse.nodered.org/t/problem-with-computer-startup-and-sounds-not-being-heard/81252/33 "2023-10-12T08:40:32Z")

</div>

> [@Trying\_to\_learn](#):
>
> NO FOREIGN NODES!

Also got gate and play audio in there (easily deleted of course as not needed)

But you've a link call in it that has no-where to go ☹

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [12 October 2023 09:06 UTC](https://discourse.nodered.org/t/problem-with-computer-startup-and-sounds-not-being-heard/81252/34 "2023-10-12T09:06:54Z")

</div>

Thanks.

Seems I am blind to some things I have done.

Which is not good / worrying.

I'll dig into the link node and what it is supposed to be doing.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [11 December 2023 09:07 UTC](https://discourse.nodered.org/t/problem-with-computer-startup-and-sounds-not-being-heard/81252/35 "2023-12-11T09:07:18Z")

</div>

Closed on 11 December 2023 09:07 UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/problem-with-computer-startup-and-sounds-not-being-heard/81252.md?page=1)
