Closed Setsua closed 3 years ago
Can confirm, on Gen1 when issuing the MQTT command, the playback stops after about one minute, even when the vacuum is idle.
Having a peek in the source code reveals that Valetudo is running sox as a new subprocess, with the parameters
sox -v VOLUME URL_TO_FILE -d
- exactly as from the terminal.
Is Valetudo trying to access the audio device, or is it something invoked by the player process (the robot controller software)?
It seems that Valetudo dies at some point. The log shows the following (read from bottom to top):
2021-03-31T17:06:21.236Z Timesync packet received
2021-03-31T17:06:21.232Z Robot connected
2021-03-31T17:06:13.406Z Connected successfully to mqtt server
2021-03-31T17:06:12.794Z Probed last id = 1001 using get_status (3 retries)
2021-03-31T17:06:11.783Z Webserver is running on port 80 (http)
2021-03-31T17:06:11.777Z Dummycloud is spoofing 203.0.113.1:8053 on 127.0.0.1:8053
2021-03-31T17:06:11.671Z No ssl key found. Expected path: /mnt/data/valetudo/key.pem
2021-03-31T17:06:11.669Z No ssl cert found. Expected path: /mnt/data/valetudo/cert.pem
2021-03-31T17:06:11.542Z timesync: 31 Mar 19:06:11 ntpdate[11467]: step time server 185.229.201.11 offset 2.004471 sec
2021-03-31T17:06:08.580Z Loading configuration file: /mnt/data/valetudo/config.json
at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
at Socket.Readable.push (_stream_readable.js:213:10)
at readableAddChunk (_stream_readable.js:272:9)
at addChunk (_stream_readable.js:297:12)
at Socket.emit (events.js:314:20)
at Socket.ondata (_stream_readable.js:718:22)
at Writable.write (/snapshot/valetudo/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:307:11)
at writeOrBuffer (/snapshot/valetudo/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:398:5)
at doWrite (/snapshot/valetudo/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:409:139)
at Writable.writable._write (/snapshot/valetudo/node_modules/mqtt/lib/client.js:335:5)
at work (/snapshot/valetudo/node_modules/mqtt/lib/client.js:321:12)
at MqttClient._handlePacket (/snapshot/valetudo/node_modules/mqtt/lib/client.js:410:12)
at MqttClient._handlePublish (/snapshot/valetudo/node_modules/mqtt/lib/client.js:1277:12)
at MqttClient.emit (events.js:314:20)
at MqttClient.messageCallback (/snapshot/valetudo/lib/MqttClient.js:225:11)
at MqttClient.handleCustomCommand (/snapshot/valetudo/lib/MqttClient.js:735:21)
TypeError: Cannot read property 'kill' of null
^
this.soundProc.kill();
/snapshot/valetudo/lib/MqttClient.js:735
Can you please check whether this test build will fix playing sounds issues for you?
Can you please check whether this test build will fix playing sounds issues for you?
I can test in a few hours. I've been playing around with the source code, but didnt really find anything "suspicious", regarding the sound playback. Before I install the test build, what did you change?
See 822dd43a4. I guess it should fix sox from hanging.
Had to chmod+x the binary, but it seems to be a fix! Internet radio stream has been playing for approx. 5 minutes without errors.
Restarting the sound while it is playing kills the sox process. Repeated starting and stopping works fine without crashes or issues.
Okay, thanks for checking.
If I send a play_sound command the sound output stops exactly after 1 minute 15 seconds but the sox player process and wget are still running. If I issue the exact same command directly via terminal the speaker keeps outputting sound.
steps to reproduce: publish packet
topic: valetudo/rockrobo/custom_command payload: { "command": "play_sound", "location": "https://st03.sslstream.dlf.de/dlf/03/128/mp3/stream.mp3", "volume": 0.04 }
Sound playback stops after 1:15
Terminal Command: play -v 0.04 https://st03.sslstream.dlf.de/dlf/03/128/mp3/stream.mp3 -d
Soundplayback keeps up
EDIT: Last lines of strace on /usr/bin/sox process
gettimeofday({1615573872, 444299}, NULL) = 0 ioctl(5, SNDRV_PCM_IOCTL_WRITEI_FRAMES, 0xbecff8fc) = 0 ioctl(5, SNDRV_PCM_IOCTL_SYNC_PTR, 0x44ae8) = 0 gettimeofday({1615573872, 522475}, NULL) = 0 gettimeofday({1615573872, 522905}, NULL) = 0 gettimeofday({1615573872, 523179}, NULL) = 0 write(2, "\rIn:0.00% 00:01:15.01 [00:00:00."..., 79