Closed vale-max closed 2 years ago
Right now I am on the move, next week I'll handle it Best Jan
On Mon, Sep 12, 2022, 1:28 AM vale-max @.***> wrote:
Hello Jvan, I was experiencing a looong time between when the example-3 was started and when sound was actually heard when the program was started by the rtsp server and stdout and stderr were going to pipes.
The strange thing was that it paused several seconds after writing on stderr "try to start" and when the programName was actually written out. I suspected the issue was again with the streamer so I added some dumb log lines going to stderr in streamer.cpp and the problem was not showing anymore.
so I did some further test and, I've no idea why, using std:err to output messages was basically hanging everything for several seconds. Tried to add some std::endl and std::flush here and there but the problem was still there. Finally I changed the code to use fprintf and everything seems to work smoothly.
You can view, comment on, or merge this pull request online at:
https://github.com/JvanKatwijk/dab-cmdline/pull/87 Commit Summary
- 68f9ce2 https://github.com/JvanKatwijk/dab-cmdline/pull/87/commits/68f9ce2631043a3b54bef1b856acfc298241b06f Using fprintf instead of std:err to avoid lags
File Changes
(2 files https://github.com/JvanKatwijk/dab-cmdline/pull/87/files)
- M example-3/main.cpp https://github.com/JvanKatwijk/dab-cmdline/pull/87/files#diff-34a20f036ac1ec065d72d79641dc2c53b74eace25d08db662771da3c6142dca9 (10)
- M example-3/streamer.cpp https://github.com/JvanKatwijk/dab-cmdline/pull/87/files#diff-1250c7ec56efbf230cd9f2ad242758db95b5a04f8ab06cf4028c5d7b54577e67 (4)
Patch Links:
- https://github.com/JvanKatwijk/dab-cmdline/pull/87.patch
- https://github.com/JvanKatwijk/dab-cmdline/pull/87.diff
— Reply to this email directly, view it on GitHub https://github.com/JvanKatwijk/dab-cmdline/pull/87, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCPHQDAMS2NAOMQQMNSN5TV5ZTLVANCNFSM6AAAAAAQJ7OECQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
done
Hello Jvan, I was experiencing a looong time between when the example-3 was started and when sound was actually heard when the program was started by the rtsp server and stdout and stderr were going to pipes.
The strange thing was that it paused several seconds after writing on stderr "try to start" and when the programName was actually written out. I suspected the issue was again with the streamer so I added some dumb log lines going to stderr in streamer.cpp and the problem was not showing anymore.
so I did some further test and, I've no idea why, using std:err to output messages was basically hanging everything for several seconds, writing the log lines from the streamed was evidently forcing the flush of some buffer. I removed the new log lines from the streamer and tried to add some std::endl and std::flush here and there but the problem was still there. Finally I changed the code to use fprintf and everything seems to work smoothly.