Multi Printer setup using gcode shell command does not play audio unless command used multiple times and only on second printer when shell script is run in background (&) #446

Closed
opened 2024-03-05 04:39:03 +01:00 by yourbuddydinec · 0 comments
yourbuddydinec commented 2024-03-05 04:39:03 +01:00 (Migrated from github.com)

Linux Distribution

Ubuntu 23.10.1

What happened

When trying to run a shell script that should play audio using aplay that runs in the background with & at the end of it some commands to not run unless you try to run them multiple times. It seems running it 3 times will get it to finally play the audio. The command itself seems to run as I have added echo TEST to it and it does show in the console but the audio just does not play. If the & is removed from the file it will play just fine every time though.

The weirdest thing is this ONLY happens on my second printer on the same computer. One is named E3 and the other S8 and the S8 one had the problem but not the E3 one despite the script being the same, the wav file being the same, and the config file being the same across both printer configs.

Broken one:

#!/bin/bash
aplay "$1" &

Working one:

#!/bin/bash
aplay "$1"

What did you expect to happen

Wav file to be played when the command is sent the first time and on both printers of a multi printer setup

How to reproduce

Include a & at the end of the script file. Happens for TTS ones as well using espeak.

Additional information

I have allso tried changing the command run from sh /scriptfilename to bash /scriptfilename to /scriptfilename and also tried changing #!/bin/bash to #!/bin/sh with no luck either

### Linux Distribution Ubuntu 23.10.1 ### What happened When trying to run a shell script that should play audio using aplay that runs in the background with & at the end of it some commands to not run unless you try to run them multiple times. It seems running it 3 times will get it to finally play the audio. The command itself seems to run as I have added echo TEST to it and it does show in the console but the audio just does not play. If the & is removed from the file it will play just fine every time though. The weirdest thing is this ONLY happens on my second printer on the same computer. One is named E3 and the other S8 and the S8 one had the problem but not the E3 one despite the script being the same, the wav file being the same, and the config file being the same across both printer configs. Broken one: ``` #!/bin/bash aplay "$1" & ``` Working one: ``` #!/bin/bash aplay "$1" ``` ### What did you expect to happen Wav file to be played when the command is sent the first time and on both printers of a multi printer setup ### How to reproduce Include a & at the end of the script file. Happens for TTS ones as well using espeak. ### Additional information I have allso tried changing the command run from s`h /scriptfilename` to `bash /scriptfilename` to `/scriptfilename` and also tried changing `#!/bin/bash` to `#!/bin/sh` with no luck either
Sign in to join this conversation.