<div dir="ltr">David,<div><br></div><div>So I&#39;ve installed CommandShell, and at first it appeared to work.</div><div><br></div><div>I could evaluate this:</div><div><br></div><div>CommandShell new processCommand: &#39;galculator&#39;<br></div><div><br></div><div>and it would open the calculator, and the PID held inside the foreground proxies corresponded directly to the running app&#39;s pid.</div><div><br></div><div>However, when I run omxplayer, using this command line:</div><div><br></div><div><div>CommandShell new processCommand: &#39;omxplayer -r --live --win &#39;&#39;54 58 400 447&#39;&#39; <a href="http://localhost:10088/?action=stream">http://localhost:10088/?action=stream</a>&#39;</div></div><div><br></div><div>I end up with our old friend, the shell pid and another process for omxplayer</div><div><br></div><div>I traced it in the debugger, all the way down to where the UnixOSProcessAccessor is sending #primForkExec:stdIn:stdOut:stdErr:argBuf:argOffsets:envBuf:envOffsets:workingDir:</div><div><br></div><div>The first argument to that message is &#39;/usr/bin/omxplayer&#39;</div><div><br></div><div>Yet I end up with this:</div><div><br></div><div><div>pi@raspberrypi ~ $ ps -ef | grep omx</div><div>pi        3182  3058  0 16:19 ?        00:00:00 /bin/bash /usr/bin/omxplayer -r --live --win 54 58 400 447 <a href="http://localhost:10088/?action=stream">http://localhost:10088/?action=stream</a></div><div>pi        3190  3182  9 16:19 ?        00:00:19 /usr/bin/omxplayer.bin -r --live --win 54 58 400 447 <a href="http://localhost:10088/?action=stream">http://localhost:10088/?action=stream</a></div></div><div><br></div><div>Why is this happening, and how can I fix it?</div><div><br></div><div>Thanks,</div><div>Jon</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 18, 2015 at 10:56 PM, David T. Lewis <span dir="ltr">&lt;<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Nov 18, 2015 at 09:12:51PM -0500, Jon Hylands wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I&#39;ve been playing around with Squeak 5.0 on a pi 2 (with the 7&quot; LCD<br>
&gt; touchscreen), and one of the things I&#39;d like to be able to do is run (and<br>
&gt; control) omxplayer from within Squeak.<br>
&gt;<br>
&gt; I did the same thing with Python, using this library:<br>
&gt; <a href="https://github.com/willprice/python-omxplayer-wrapper/tree/develop/omxplayer" rel="noreferrer" target="_blank">https://github.com/willprice/python-omxplayer-wrapper/tree/develop/omxplayer</a><br>
&gt;<br>
&gt; However, I don&#39;t really need all the fancy controls - what I really want is<br>
&gt; a way to launch it, and then a way to kill it. I&#39;ll be streaming live MJPEG<br>
&gt; video from a webcam, so there is no concept of pause/stop/etc. I need to<br>
&gt; kill it because I want the ability to choose one of a couple different<br>
&gt; video streams.<br>
&gt;<br>
&gt; I tried using OSProcess, but it gives me the pid of the shell script that<br>
&gt; launches the application, and not the application itself. I could certainly<br>
&gt; hack something using ps and grep, but I would prefer if there were a better<br>
&gt; way to do it.<br>
&gt;<br>
&gt; Any ideas?<br>
<br>
</span>Hi Jon,<br>
<br>
If you are trying to interact with an external process, you probably want<br>
CommandShell, which is a companion package meant to be used with OSProcess.<br>
The base OSProcess package has various utility methods (quite ill-advised<br>
with the benefit of hindsight) that run external programs under a unix<br>
shell. I originally intended that as a convenience, but it turns out to<br>
be more confusing than it is helpful.<br>
<br>
What you probably really want to do is run a program and interact with<br>
it directly by talking to its standard input stream and listening to its<br>
standard output and standard error streams. In most cases, the class<br>
PipeableOSProcess will do what you want. At a slightly higher level, if<br>
you need the very loose equivalent of unix shell parsing, ProxyPipeline<br>
may be a better fit. Slightly higher level, the class CommandShell<br>
provides all of the above with the option of opening a view on the command<br>
processing (much like a unix terminal window).<br>
<br>
So, if you want to interact directly with an external program, do not<br>
use OSProcess by itself. Load CommandShell and use one of the higher<br>
level classes that does not try to &quot;help&quot; you by running your program<br>
under /bin/sh.<br>
<br>
Dave<br>
<br>
<br>
</blockquote></div><br></div>