-
-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT] tsanalyze: add timeout option #1438
Comments
Hi @lars18th
The most general way of analyzing a stream is the plugin. The command is there only for compatibility and simple file analysis. I won't make it more complex to duplicate features which are already present in the plugin. Using the plugin solves the Ctrl-C case. Ctrl-C is handled by the Note that, if some plugin hangs and |
OK. So, I accept (and I agree) with the idea of not improve more the However, the CTRL-C case is not solved as you think. Using a mixed binaries from Windows and Linux (running the Shell in WSL2, and the What you think? |
This is certainly an unusual configuration. When WSL2 is active, Hyper-V acts as a bare-metal hypervisor and Windows and WSL2 are two distinct virtual machines running side by side on top of it. I don't even know how to run processes on the two VM in the same command line. Probably some Microsoft trick which is equivalent to an ssh on the other VM for one of the commands. We can't of course expect Ctrl-C to be handled consistently on the process running in the other VM. |
Hi @lelegard ,
In fact, this is not want you think. WSL2 is only the Linux kernel from Microsoft running on Hyper-V in Type 2 mode. Nothing more. Then any process running on it is like a "container" process in the sense that it can interact with any other process without sharing kernel resources (shared memory, for example). However, process can interact using sockets, virtual devices , and of course pipes. So, inside a WSL2 shell (Bash or PS) you can start WIN and WSL2 process inside the same PIPE. It's not magic, and identically to systems with isolated contexts based on virtualization. That said (which is not relevant to TSDuck) the question is: could you add the |
Hi @lars18th About Hyper-V, sorry but Hyper-V is a type 1 hypervisor, not a type 2. There is plenty of online resources and descriptions on that. Windows is not the "host" as used in type 2 hypervisors. Even though you see it booting immediately when the PC boots, it is in fact "just another VM", side by side with the Linux kernel for WSL2 (when you boot it). There is also a hidden third VM where critical Windows processes run as well as a few drivers. This is active by default in Windows 11 (fresh installation, not upgrade from Windows 10) and can be activated / deactivated in the settings under complicated names such as "core isolation memory" or "hypervisor-based memory isolation", can't remember the exact name (Microsoft is always good at hiding obvious technical concepts behind complicated long names). If you want to experiment the difference, compare the installation process with VirtualBox. VBox is a type 2 hypervisor. You install it and you can immediately create and boot virtual machines because VBox is "only" an application on the Windows hosts. When you install / activate Hyper-V, on the other hand, you can't use it until you reboot the system. This is not only because of the usual Microsoft mantra "reboot after any modification". This is because the architecture changes completely. Instead of booting Windows, the system now boots Hyper-V first, as a type 1 hypervisor, which in turn automatically boots Windows in the first VM. This is hidden to give the impression that you booted Windows. But the reality underneath is different. About the termination of analysis, doesn't the |
Hi @lelegard , Thank you for the extense description of how works WSL2. Regarding the topic of the request...
Yes, it could achieve the same behaviour. However, I feel the parameter |
Is your feature request related to a problem?
When using the
tsanalyze
tool inside a PIPE with multiple tools, the CTRL+ interrupt (could) kill the process before it prints the data. Therefore, a simple method to enforce to print based on a timeout could be useful.Proposed solution:
My suggestion is to add the parameter
--timeout
to instruct to the tool to close it after printing the results when the timeout expires. Then it will be easy to do something like this:encoder | tsanalyze --timeout 30s
.Alternatives:
The alternative is to use the
tsp
tool with the analyze plugin (ie.tsp -P analyze -i 30 -w -c -O drop
). But this will be more user friendly.Additional information:
And perhaps it will be also useful to add the option to "pass through" the stream, like this:
encoder | tsanalyze --timeout 30s --passthrough | emitter
. In this case, the timeout doesn't close, but it prints at each iteration of the timeout.The text was updated successfully, but these errors were encountered: