Problem with computer startup and sounds not being heard

With all the other questions I'm asking, I've just noticed a possible problem with inject nodes and inject on strat up.

I have an inject node set to inject on startup to simply say "Hello there" for me.
Yes, it uses WATSON's speech node.

But I just booted about 49 minutes ago and it didn't say anything to me.

I'll do some more digging, but as you may know that my problems don't go away until I've made a fool of myself asking a question before they suddenly start to work.

On what platform? A Pi? I would guess that Node-RED starts up before ALSA does. So it probably runs but you don't get the sound output.

You should be able to adjust the Node-RED systemd startup and make it depend on ALSA's startup. Or simply experiment with some delays until the sound happens.

Sorry.

No the machine in question is an Intel NUC. (Main machine)

I extended the delay to 40 seconds and I am still not hearing anything.

Feed the output of the inject node into a debug node set to output to the console, then you can check in the startup log whether the inject does appear.

1 Like

So that will work?

Ok, thanks.

That is from a COLD start it will work?

Oh, console.... That's the log. Sorry. console and log. To me they are different.
So that is the node-red log - of course (again just wanna check.)

Instead of asking you would have been quicker to wire an inject node to a debug node configured like that, click the inject node and see if it appears in the log.

but it is on BOOT from COLD START.

Once booted it works fine - by the way.

Would that work?
And as I said: console and log to me are very different things.
But now I know and I hope I remember.

(The fun I had getting the time to be given to me with day and month name. That was fun.)

Where is the log file saved?
The only one I have documented is /var/log/nodered-install.log and that is for INSTALLING - isn't it?
Not the day to day happenings.

You were asking whether output to the console goes to the node red log, you could easily have tested that.
For cold boot you can look back in syslog or you can use journalctl with appropriate parameters.

Yeah, I kind of worked that out now.

LOGS are still another world to me. Paths, and all that.
But now I found the journalctl ...... I can see the log.
Then I look for what I want.

Thanks.

That will be looked at after next boot.

This morning:

sudo journalctl -r -u nodered | grep hello
[sudo] password for me: 
Sep 14 06:18:20 me-desktop Node-RED[1431]: 14 Sep 06:18:20 - [info] [debug:42940cf3.2c0a64] hello there

So it is being injected.

But I am not hearing any result.

Note: This is done 40 seconds after boot.
Increased to 120 seconds. Shall report what happens next time I boot the machine.

So the inject is firing, you need to change the thread title.

So just checked /var/log/daemon.log on my home server (debian buster). Node-RED started at

Sep 13 12:45:15 home NRMAIN[846]: 13 Sep 12:45:15 - [info] Settings file

ALSA finished starting at:

Sep 13 12:41:30 home alsactl[805]: alsactl 1.1.8 daemon started

So that was about a 4 minute difference! Slow startup on the old laptop. But then I have network and InfluxDB dependencies set on my Node-RED startup so it can't get going until those are loaded fully and InfluxDB does take quite a while to start up.

But of course, if you have anything like an external (USB) sound-card or anything like that, USB takes quite a while to start as well.

Anyway, trawl through that log file - find your debug output and work out if there is anything not yet started.

1 Like

Thanks.

I wasn't meaning to sound like I am still complaining. I was only posting an update.

Yes, 40 seconds was (maybe) too quick.

I've increased it to 120 and shall see what happens next time.

Alas - of course - just now I am having other problems with the NUC.
(flat/low CMOS battery.)

When is/done NR start?
Obviously not at the immediate power on. It too has to be loaded/started.
So from when I see the Ubuntu splash screen to when the GUI is loaded doesn't seem to be 40 seconds.
But anyway.... I've now made it long enough that I should hear "hello there" next time I boot the computer.

Just checking also:
the journalctl is the one to see the log for NR stuff.
There is NOT a separate one that node red has other than the install log - which is of no use in this case.

journalctl typically does not write to disk. As I say, if you check the /var/log/daemon.log file, you will see all of the systemd startups and the Node-RED output in one place so you can check comparative times.

I can't remember exactly but I think that Dave's script installs a systemd script that only waits for the network. My own script waits for InfluxDB as well which takes a lot longer, especially on my old laptop which just has its built-in HDD spinning rust.

That isn't too much of a worry.

So long as I remember after the machine boots to look at the file.
Then look for the flags that the message is getting through.

(Sorry, forgot)

Booted.
120 second delay.

No sound/voice heard.
:frowning:
Longer again.

Ok, sorry, thought:

How can I learn to make my installation wait for the ALSA (sound) device to be ready?

If you click the inject after it is all up and running, does it work as expected?

Yes.

I hear the sound. (voice to txt).

Ok, so it is just a matter of waiting long enough.

Yes.

I am now waiting 180 seconds - not as yet tested.

It just doesn't seem believable it takes 3 minutes for NR to get itself together before it is working.