aMSN Forums
June 19, 2013, 08:27:12 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New forum for aMSN !!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Webcam bug introduced in CVS snapshot? [Patch provided]  (Read 7124 times)
dgr
Newbie

Offline Offline

Posts: 20


View Profile
« on: May 01, 2006, 08:03:20 pm »

Hi guys,

I've been using the CVS version for ages now but of course I've fallen back to using the CVS snapshot due to the SourceForge issues.

For a few days now, I've noticed a problem in the CVS snapshot that's caused my webcam to no longer work (Logitech Quickcam Messenger). I've not updated the drivers or kernel. The only thing that has changed is aMSN.

When aMSN loads, I see the following:
Code:
ioctl: VIDIOC_QUERYCAP(driver="DXç·ÄîZâ·±§¯·";card="˜(ü–¿˜ü–¿";bus_info="pRpÐÈ";version=132.208.12;capabilities=0xbf96fc88 [,?,?,?,?,?,?,?,AUDIO,?,?,?,READWRITE,ASYNCIO,STREAMING,?,(null),(null),(null)]): Unknown error 515


When I try to send webcam to any of my contacts, I see:
Code:
ioctl: VIDIOC_QUERYCAP(driver="";card="";bus_info="";version=0.0.0;capabilities=0x0 []): Unknown error 515


The contact doesn't get an image (just a blank screen) and the local webcam image on my screen freezes.

As I said, this was working fine about a week ago. Nothing on my system has changed at all (not even upgraded any .deb's recently). Has anyone else been experiencing this?
Logged
malteo
Newbie

Offline Offline

Posts: 15


View Profile
« Reply #1 on: May 01, 2006, 08:24:58 pm »

Quote from: "dgr"
Has anyone else been experiencing this?

Me.
Logged
dgr
Newbie

Offline Offline

Posts: 20


View Profile
« Reply #2 on: May 01, 2006, 10:49:49 pm »

The problem is with msncam.tcl. I have no idea at this stage what the problem is exactly but I created a diff between msncam.tcl in CVS (that hasn't been updated for weeks) and the version in the last CVS snapshot and applied the patch.

So reverting msncam.tcl back to an older version has fixed this but I can't pin point exactly what has broken it in the latest CVS snapshot.
Logged
dgr
Newbie

Offline Offline

Posts: 20


View Profile
« Reply #3 on: May 01, 2006, 11:56:35 pm »

Been playing around with this problem a bit more. Keep in mind this is the first time I've ever looked at Tcl and I don't know anything about the MSN protocol...

The problem exists in the SendFrame procedure of msncam.tcl, with the headers it sends. For some reason the current CVS snapshot sends incorrect headers (I think) so the frame isn't sent. If you add a "puts here" in SendFrame, you can see it only gets called once.

So what I've done is to comment out the code that builds the header that's sent with each frame, in Proc SendFrame (msncam.tcl) and replaced it with the old method of sending the frame header. This appears to work correctly although I have no idea what it may have broken.

Here is the patch of what I've changed to get things working (beware line wrapping!):

Code:
--- msncam.tcl.orig     2006-05-01 23:06:11.000000000 +0100
+++ msncam.tcl  2006-05-01 23:50:43.000000000 +0100
@@ -1523,14 +1523,16 @@
                                        setObjOption $encoder unique_id $uid
                                }
 
-                               # set basic header info
-                               set header "[binary format ccsssi 24 0 [::Webcamsn::GetWidth $encoder] [::Webcamsn::GetHeight $encoder] $is_keyframe [string length $data]]"
-                               # add ML20
-                               append header "\x4D\x4C\x32\x30"
-                               # add a unique identifier
-                               append header "$uid"
-                               # add a timestamp
-                               append header "[binary format i [clock clicks -milliseconds]]"
+#                              # set basic header info
+#                              set header "[binary format ccsssi 24 0 [::Webcamsn::GetWidth $encoder] [::Webcamsn::GetHeight $encoder] $is_keyframe [string length $data]]"
+#                              # add ML20
+#                              append header "\x4D\x4C\x32\x30"
+#                              # add a unique identifier
+#                              append header "$uid"
+#                              # add a timestamp
+#                              append header "[binary format i [clock clicks -milliseconds]]"
+                               set header "[binary format ssssi 24 [::Webcamsn::GetWidth $encoder] [::Webcamsn::GetHeight $encoder] $is_keyframe [string length $data]]"
+                               set header "${header}\x4D\x4C\x32\x30\x00\x00\x00\x00\x00\x00\x00\x00"
                                set data "${header}${data}"
 
                        }


On another note, pausing webcam doesn't work. I don't know if it should do or not or if it's because of my patch that it's broken.
Logged
vivia
Administrator
Super Power User
*****
Offline Offline

Posts: 2464


View Profile
« Reply #4 on: May 02, 2006, 12:29:22 pm »

Thanx, another user also noticed that there's something wrong with the timestamp. Thanx for providing a patch though!

Please try this:

on startup of amsn: for example, file amsn line 59, add this:
Code:
set time_now [clock clicks -milliseconds]

when we set the headers: (replacing line 849 of msncam.tcl)
Code:
set timestamp [ expr { [clock clicks -milliseconds] - $::time_now } ]
append data "[binary format i $timestamp]"


and feedback Smiley
Logged
dgr
Newbie

Offline Offline

Posts: 20


View Profile
« Reply #5 on: May 02, 2006, 03:41:44 pm »

Thanks for the reply.

I setup the timestamp, as per your instructions and this didn't help - pausing the webcam still doesn't work.

I assume your instructions were just to fix the pause problem? Because I still have to comment out the header code in "Proc SendFrame" and replace it with some older code to get the webcam to send any frames.
Logged
vivia
Administrator
Super Power User
*****
Offline Offline

Posts: 2464


View Profile
« Reply #6 on: May 02, 2006, 03:44:34 pm »

It was not about the pause problem. In fact, I forgot to do the same changes in the part that deals with sending a paused frame. We are testing now... Smiley
Logged
dgr
Newbie

Offline Offline

Posts: 20


View Profile
« Reply #7 on: May 02, 2006, 03:58:05 pm »

Thanks again.

I'm also testing and have got a bit further with this one. I no longer need to comment out the header code in Proc SendFrame. It looks like the timestamp isn't formed correctly and thats what's causing the frame issue. More details when I get them, unless you guys beat me to it Smiley
Logged
vivia
Administrator
Super Power User
*****
Offline Offline

Posts: 2464


View Profile
« Reply #8 on: May 02, 2006, 04:30:46 pm »

Do subscribe to amsn-devel !!! And THANX A LOT for testing! Smiley We need people like you!

I was just testing with tjikkun and he noticed this:
Quote
webcam pausing currently checks:

                if {$state == "SEND"} {
                        setObjOption $sock state "PAUSED"
                        $window.pause configure -text "[trans
playwebcamsend]"
                } elseif {$state == "PAUSED" } {
                        setObjOption $sock state "SEND"
                        $window.pause configure -text "[trans
pausewebcamsend]"
                }

with a reflector conn. $state == "TSP_SEND"

I didn't look much at the webcam code so can someone else maybe change
this? DO we need TSP_PAUSED as well?


Another devel (Arieh) came up with another suggestion:
Quote
What I suggest is just taking the mod of the current clock ticks, something
like taking the value from the last decade or something. (this also saves
requiring of the $::time_now variable) ie:

Code:
set timestamp [ expr { [clock clicks -milliseconds] % 315360000 } ]
append data "[binary format i $timestamp]"

which also needs to be done for sending paused headers.

(EDIT: We know that the timestamp is not formatted correctly and this is what this fix was there for, not for the pausing issue!)

At this moment I don't have access to a webcam. Subscribe to amsn-devel to keep in touch with the rest of the developers about this and you'll surely hear from me again later. I'd like this to be fixed by tomorrow.
Logged
dgr
Newbie

Offline Offline

Posts: 20


View Profile
« Reply #9 on: May 02, 2006, 04:47:48 pm »

Excellent work. I'll subscribe to amsn-devel in just a moment.

My fix was the same as Arieh's, but I used the $::time_now variable instead. Having spent a while making sure it's all OK, I can confirm that Arieh's fix works perfectly for this bug.

I'll pass on the pause problem though Smiley Thanks!
Logged
vivia
Administrator
Super Power User
*****
Offline Offline

Posts: 2464


View Profile
« Reply #10 on: May 03, 2006, 01:35:34 pm »

Should be OK now, you just can't pause when you are using the reflector!
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #11 on: May 20, 2006, 12:06:39 am »

it is ok now AND you can pause when using the reflector.
Logged

KaKaRoTo
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!