The video setup I am doing for PyCon results in a bunch of terminal windows or tabs open, and having to click around to monitor status and debug problems. I am sure this can be done better. not really sure how, kinda depends on what can be done easily. The last thing I need is something else to debug, so the manager code needs to be fairly simple/stable/goodle.
I have seen python code that uses process.popen and dose stuff with stdout - I am guessing/hoping it can be displayed in a wx control (the code I saw was console based, so it just sent stuff to stdout, I am guessing with python print statements - didn't look into it too much.) Here are some details of what I am currently doing with terminal windows: (the details aren't really important, just the fact that there is a bunch of them.) term 1: c...@dv67:~$ dvswitch -h 192.168.1.14 -p 2000 this starts up a GUI that listens on 192.168.1.14:2000, and sends status messages to stdout, "source 1 connected" or "buffer full, dropping frames" term 2: c...@dv67:~$ dvsource-firewire -h 192.168.1.14 -p 2000 -c 0 INFO: Reading from Firewire card 0 INFO: Connecting to 192.168.1.14:2000 Capture Started This connects to the dvswitch process via 192.168.1.14:2000, reads a DV stream (like from a camera) from channel 0 (first firewire device) and sends the stream to dvswitch. term 3: c...@dv67:~$ dvsource-firewire -h 192.168.1.14 -p 2000 -c 1 (same thing, only 2nd firewire device) term 4: c...@dv67:~$ ssh ju...@dell30 "dvsource-firewire -h 192.168.1.14 -p 2000 -c 0" This ssh's to dell30 (uses keys so no pw entry) and runs a 2nd dvsource-firewire, which connects to back to the dvswitch process. term 5: c...@dv67:~/chiglug$ dvsink-files -h 192.168.1.14 -p 2000 foo INFO: Connecting to 192.168.1.14:2000 INFO: Created file foo-1.dv INFO: Created file foo-2.dv INFO: Stopped recording This connects, and gets a stream, saves it to disk, new file each time the user hits a button on the dvswitch gui. it will also report errors, like "disk full" or "lost connection" term 6: c...@dv67:~/chiglug$ watch -d ls -l Every 2.0s: ls -l Sun Feb 8 15:33:19 2009 -rw-r--r-- 1 carl carl 1200000 2009-02-08 15:28 foo-1.dv -rw-r--r-- 1 carl carl 30720000 2009-02-08 15:29 foo-2.dv This gives me a visual confirmation that data is being saved to disk. When the file size stops changing, I panic and start madly checking the outputs in the other 6 windows (5 term + 1 dvswitch gui.) One thing I have to contend with: the small firewire ports don't hold the cable to snug, and so it doesn't take much to giggle it loose. I can see that by opening up a nother term and check dmesg for [ 1482.136149] ieee1394: Node paused: ID:BUS[1-01:1023] GUID[002011010f00256d] When that happens, I have to kill the right dvsource-firewire process, (find it's term and hit ^C, or "pkill -9 dvgrab" if it's the only one on the box) then re-start it. Unless it is the primary feed, then I really want to kill all of the sources and start them back up so that the stream which has the good audio is the 1st source. And if a camera decides to give me 12 bit audio, that causes dvswitch to freak out with "mis-matched streams" and then I have to restart it, which causes all the clients to drop, which means I have to then restart them. This is when I think "There has to be something better." So I wrote a bash script: HP=-h localhost -p 2000 echo run>/tmp/run.gdb xterm -geometry 60x50+0+40 -e "gdb -x /tmp/run.gdb ~/vga2usb/src/dvswitch/dvswitch-trunk/build/src/dvswitch $HP" & sleep 3 xterm -geometry 60x10+0+5 -e "dvsource-file $HP -c 0" & sleep 1 xterm -geometry 60x10+0+15 -e "dvsource-file $HP -c 1 " & sleep 1 xterm -geometry 60x10+0+25 -e "ssh ju...@dell30 -c \"dvsource-file -h bla.bla -c 0\" " & sleep 1 xterm -geometry 60x5+0+35 -e "dvsink-files $HP foo" & sleep 1 It gives me lots of windows, I have no idea exactly what command is running in each, and no way to easily restart a process. I have to close the window, open a new one, and type in the command. yuck. it's different, but not better. So what I am fishing for: a config.xml file that had all these commands so that I can run one thing that would bring everything up, show me the outputs in some organzied UI, and let me selectively restart each one, or restart the whole thing. Having it react to outputs would be really cool too, like wait for "CONNECTED" before starting the next command, beep or flash if anything reports "^WARN.*" but I would really want that to be a version 2. Want to make sure the basics work first, ya know? Course this all relies one someone being comfy with .popen and stdio, which I am basically not. Anyone in here up on this? Carl K _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[email protected]
