![]() |
Flashcam project for Linux (bounty for N800?)
Hello there:
I recently sent my N800 to my brother-in-law in the Navy so that he can call home from wifi hotspots at his various ports of call. Now that the N800 is at my $200 strike price to repurchase, I'm going to be ordering one again. (I wasn't using it as much when I got an EEE PC because I ended up using the EEE to travel for work, and the net savings on total PC weight meant that I wasn't carrying the N800 as much. However, I do miss the walkaround aspects of the N800 quite a bit. Even though it does weigh down a shirt pocket, it is pocketable! :) My post has to do with the Flashcam project for Linux. I was told that the camera would never work on the EEE PC running linux because flash did not support the hardware profiles for Linux. However, about 6 weeks ago, I learned of a hack that made it work -- and very well. Why would this hack not work on the N series? IMO, if the camera could be enabled in tokbox and youtube, etc. on the N8X00 devices, it would be a real killer app. Anyway, I'm just a user, and have no programming skills to contribute. :) However, I am willing to donate $ to start a bounty if somebody can use the vloopback (vlback.sh) hack to make the camera work on the N800. This is a new thread because while I see a lot of posts about the lack of flash support, I do think that this method might hold some promise. |
Re: Flashcam project for Linux (bounty for N800?)
I tried, a ****ing pain in the ***.
Camera type gets shifted from RGB to UYYV when the internet call applications open. I edit code to accept that, I get a thousand more errors. When I get no errors, I try out the script to run the browser (I installed bash to make sure the script worked right) and I open the webpage and then the vloopback program crashes. |
Re: Flashcam project for Linux (bounty for N800?)
can the internet call application be disabled? a lot more people i know have flash versus the internet call application :)
|
Re: Flashcam project for Linux (bounty for N800?)
|
Re: Flashcam project for Linux (bounty for N800?)
Quote:
It compiles very easily (with a few changes) but it crashes on me. if I could develop properly, I'd look into it but I can't figure it out :) |
Re: Flashcam project for Linux (bounty for N800?)
I guess I'll look into the SIP route. Man, what a lost opportunity for Nokia. The original PC application rocked -- why did they have to discontinue it?
|
Re: Flashcam project for Linux (bounty for N800?)
Hi Qwerty12,
It's Olivier the author of The Flashcam Project. I don't have a N800 myself but I'd be please to help. How? I can write a few line of codes that could tell me exactly what's wrong with program. Hopefully this would lead to a fix. Do not hesitate to contact me. Which you should have done already IMHO :) -Olivier (Swift) |
Re: Flashcam project for Linux (bounty for N800?)
Quote:
Thanks for taking the time to sign up and reply here :). I'm not a developer so I can't really do any debugging or high level analysing (see, I don't know what I am on about :P). Unfortunately, I don't have any free time ATM but when I do, the best I can do is give logs etc. It compiles cleanly btw, and I won't hesitate :) Best Regards, qwerty12 (BTW: I think your program is great, I want it to work too :)) |
Re: Flashcam project for Linux (bounty for N800?)
In flashcam.c when it does a VIDIOC_G_FMT, it gives an error (the string has a typo as _S_). The _S_FMT works, but maybe the _CAPTURE doesn't have a "get".
Building had one problem on my system where I had to define CONFIG_VIDEO_V4L1_COMPAT in the module source file for the include to pick up all the structures. |
Re: Flashcam project for Linux (bounty for N800?)
I bypassed the above call, and defaulted things to the camera's 640x480.
Then it didn't like the video format (switch around line 120) - UYVY from the camera, YUYV to the loopback. I get video in the window, but I'm bright green with a purple background... I just rewrote a "default:" case with different displacements (yuyv as 0123 becomes uyvy as 0123, or y moves from 0,2 to 1,3, u from 1 to 0 and v from 3 to 2). It works. Does it do audio? |
Re: Flashcam project for Linux (bounty for N800?)
|
Re: Flashcam project for Linux (bounty for N800?)
Wow, thanks!
Hope it works on diablo... |
Re: Flashcam project for Linux (bounty for N800?)
http://www.zdez.org/flashcam-1.1-nok.tgz has a build directory with the files and a brief readme. Still highly experimental, but for those who want to change my quick and ugly hack into something decent I thought I would post it. Also go to the flashcam page http://www.swift-tools.net/Flashcam/ for setup and other info.
|
Re: Flashcam project for Linux (bounty for N800?)
Update: http://www.zdez.org/fcnok-1.1a.tgz has just the flashcam and flashcam.c files. Setting the right resolution prevents the 4x magnification (so it looks normal in the small window), plus some optimization and ignoring EIO, which works well. (the 640x480 original will be reduced to 160x120 but have a much slower frame rate).
Note: I had to load things as root - I don't think I have all the permissions right, but I need to use/work the install script to change the perms right |
Re: Flashcam project for Linux (bounty for N800?)
One other note - it appears the video loopback module doesn't block the write, so the flashcam program runs continuously. It uses about 9% of CPU when it does. The red light is on continuously and it would be nice if it was only on demand.
Also it appears not to need the LD_PRELOAD and .so - but /dev/video0 will appear so you need to make sure you select the Video loopback and not the undefined device. |
Re: Flashcam project for Linux (bounty for N800?)
Ah, it seems external sites might want to open the "first" webcam.
This is fixed (I haven't tried a reboot!) without the preload by swapping /dev/video0 and /dev/video1 (mv video0 video3; mv video1 video0; mv video3 video1). Flashcam then proxies video1 to video2, but it seems to work when it didn't before. (update - the camera and videocam applications don't work with the devices reversed - I suppose a script or something could do it when flashcam starts up). http://www.newgrounds.com/portal/view/326194 has a quick add webcam to game tutorial which worked. Also http://www.red5chat.com worked - I tried the demo, and the cam was visible on another computer (It didn't go both ways, but it was NAT so both the pad and the computer had the same IP). |
Re: Flashcam project for Linux (bounty for N800?)
Nice job Tom.
If you think your modifications are ok, can you provide me with latest one so I can merge the code into Flashcam? Full credits to you of course for this port. -Olivier (Swift) |
Re: Flashcam project for Linux (bounty for N800?)
One other bit of subterfuge that also works is to hexedit (or even sed) /usr/lib/browser/libflashplayer.so and change /dev/video to /dev/v4lv1, then copy (and set permissions) from "/dev/video1" or whatever the loopback output is to "/dev/v4lv10". No LD_PRELOAD needed.
Camera and videocam work (when the flashcam app is NOT running and using the camera). Note you need to have flashcam running before launching the page for flash to find the device. One of those status bar process runners works well (to start or killall flashcam). |
Re: Flashcam project for Linux (bounty for N800?)
I'm not sure how stable this is, but I did get the loopback device to block. The problem seems to be that this flag is easily set, but not always reset when the read endpoint opens or closes.
Code:
diff -Bburw /home/tz/sbnok/t/flashcam-1.1/vloopback-1.1.2/vloopback.c vloopback.c--- /home/tz/sbnok/t/flashcam-1.1/vloopback-1.1.2/vloopback.c 2008-03-27 04:30:34.000000000 -0500 |
Re: Flashcam project for Linux (bounty for N800?)
I have one more thing going now that I can get write to block.
I'm doing the write in a separate thread with a semaphore, so that while it blocks I won't open or start video. When it goes through, I open the capture device and ship frames until the write blocks again. I have a few race conditions to clean up, but aside from that it seems to work, so it could be run out of init as fcamd and would just sit there until flash came up and started pulling video (with the above hexedition). When I get it working I hope to form a .deb file (and contribute this mini version back to the project - but it is stripped as Nokia tablets only have one kind of hardware, so much probing and setting was cut out). |
Re: Flashcam project for Linux (bounty for N800?)
http://www.zdez.org/fcamini.tgz has a auto-on-off using a pthread for the write and ping-pong semaphores to automatically shut off the video when the write blocks.
This is just the source, compile script, and binary for the flashcammini program, the rest is in the earlier archive, and to work it needs the patch applied to vloopback. |
Re: Flashcam project for Linux (bounty for N800?)
Source tree, http://www.zdez.org/flashcam-1.1a-nok.tgz
and a .deb! http://www.zdez.org/flashcam-0.10.deb (note I don't include the simple flash test files from the Test directory in the source in the deb, but any site that uses flash and webcams including the tutorial in the earlier post should work). (There was an update to the deb a few minutes after this post - if /dev/v4lv1 isn't there after running/reboot you need the newer copy). I'd appreciate any feedback - if this works or not. Note that uninstalling does not revert the patched device path for libflashplayer.so, but it won't work without the flashcam stuff anyway and shouldn't affect anything else. |
Re: Flashcam project for Linux (bounty for N800?)
Cool! Do we run the vloopback from the command line? I'll have to give this a try when I get my replacement N800 tomorrow!
|
Re: Flashcam project for Linux (bounty for N800?)
It should be completely transparent and automatic.
Install the .deb file, and if you have a flash page with webcam support, it should "just work". (the test app does need the camera to be selected as it defaults to none, but most pages default to the first video device). |
Re: Flashcam project for Linux (bounty for N800?)
I can support that. Just played some weird flash game by waving my hands in front of the n800... Always wanted to do that ;)
|
Re: Flashcam project for Linux (bounty for N800?)
Link, please?
|
Re: Flashcam project for Linux (bounty for N800?)
Pretty incredible. There's a bit of a lag for me, but it's working fine -- i tested out a connection on mebeam. This is a pretty big step, I think for the N800 and N810 as it can make uploading live videos to facebook and youtube much easier. Under the right circumstances, you could probably broadcast live on ustream.
However, can I use the mic in flash? I don't see a mic option but I was under the impression that the mic always worked. Thanks again, and great job! (PS: I am more than happy to donate towards this project -- I was willing to help organize a bounty but you solved this too quickly! :)) |
Re: Flashcam project for Linux (bounty for N800?)
@ benson : There are a few here: http://www.extendedreality.com/webca...l#online_games
|
Re: Flashcam project for Linux (bounty for N800?)
I've seen the mic come up in an extended version of the "allow access" dialog (I think on the red5), but I haven't verified sound (I haven't found a site that would allow me - too busy getting it working).
|
Re: Flashcam project for Linux (bounty for N800?)
Odd. I'll try again. When I try to select a mic there are none listed.
|
Re: Flashcam project for Linux (bounty for N800?)
Is there a site or file that uses a mic? For me I get the access dialog, but no selector on the ones I've seen.
You might also need to use the plug-in mic/headset or a BT microphone. |
Re: Flashcam project for Linux (bounty for N800?)
Hmm... I did find one game, Flight over Sahara, which uses sound and video.
Unfortunately, I still don't have video working; it appears that sed was running out of disk trying to backup the file; the install seemed to succeed, though, it just didn't work. I'm working through it, but it seems the package isn't quite proper when dealing with low disk space... and I regret having no particular advice on how to improve it, not knowing debian packaging. I also (having manually seded without the .bak, and retrying the install) get these: Code:
insmod: cannot insert '/usr/lib/vloopback.ko': File exists (-1): File exists It works now, anyway, repeating so I could paste errors was the cure... (Works for video; I can't make it fire by sound using BT headset. Fortunately, tapping the screen fires.) Framerate is atrocious, but it is kinda cool... and low framerate means I can play it while typing this without getting run down. :D |
Re: Flashcam project for Linux (bounty for N800?)
Try www.mebeam.com which is like tokbox but requires no registration -- also has multiparty. i wonder if the n800 could handle more than 2 parties. :)
|
Re: Flashcam project for Linux (bounty for N800?)
if you look at /etc/init.d/flashcam, it has the sed script.
It swaps /dev/video for /dev/v4lv1 somewhere in the libflashplayer.so and tries to form a backup. It must be really low memory to have less than 10mb. |
Re: Flashcam project for Linux (bounty for N800?)
Well, of course it's really low memory. I'm running steady state about 4MB free for the past month. ;)
But I'm shifting to SD (and finally trying to install Diablo...) tomorrow. Had to wait till the end of the semester to mess with this stuff. :D |
Re: Flashcam project for Linux (bounty for N800?)
tz1: Just installed your deb and it works great! Great job on this!
|
Re: Flashcam project for Linux (bounty for N800?)
Is anybody having success with the mic working?
|
Re: Flashcam project for Linux (bounty for N800?)
Mic: The box for config will come up but not show any devices, so I don't know. The .so doesn't have a /dev/audio or /dev/dsp like I'd expect, but I can't be sure.
Mebeam.com did work, I was in stereo(scopic) since I have a PHS-300 and my macbook was on the motel's wireless. I could hear my Macbook on the Nokia, but not vice versa. |
Re: Flashcam project for Linux (bounty for N800?)
before vloopback is installed does audio work? i'm getting a replacement device tomorrow so I will try it out before i install it again. i'm impressed with how well the video works. this has the potential of being as big as video in skype would have been since services like tokbox work with any IM.
|
Re: Flashcam project for Linux (bounty for N800?)
This is amazing! The tablets keep getting better each day. One more thing the iPhone cant do! This works great with a flash based security program I wrote a few years ago, its like a mobile IP camera! Thanks a lot. One question though, how do I know if the program is running. Does it use a deamon to see if flash wants a camera or what? Running flashcam from xterm usually gives
Code:
Cannot open loop /dev/video2. (Device or resource busy) |
All times are GMT. The time now is 12:36. |
vBulletin® Version 3.8.8