Menu

#124 Firewire device scan fails if device has no model_name

0.72
Fixed
Tetsujin
None
Medium
Linux
Unspecified
Defect
2015-06-11
2015-05-31
Tetsujin
No

My DV camera doesn't work in WCS. (Perhaps nobody else has one of these anymore? :) ) I did a bit of digging into the code to figure out why.

The first problem I identified is that the FWFind.sh script in ~/.webcamstudio doesn't produce the desired output on my system, because (for whatever reason) when I connect my camera, nothing appears in /sys/bus/firewire/devices/fw1/model_name. Here's what's happening:

  • "grep . /sys/bus/.../fw*/model_name" matches just one file, and as a result grep doesn't print the filename. (Adding -H to the grep command could fix that.)
  • As a result, no entries are added to fwDevice[] in FindFires.java (around line 93)
  • As a result of that, despite the GUID for the camera being correctly obtained, the loop which builds the list of firewire devices (around FindFires.java:115) adds nothing to the result list.
  • As a result of that, when I add a DV camera within the WCS UI, I can't start capture from the device, and when I click on the firewire icon to choose the device to capture from, nothing appears (which ends up being a bit confusing, because the UI thinks there's a selection list being displayed, and interferes with keyboard operation until I hit escape or something to break out of the selection)

Incidentally, while there's a very low chance of it happening in practice, using the ampersand shell operator in FWFind.sh is a bad idea. The two processes could potentially write to the output stream at the same time, causing output from one process to appear in the middle of a line of output from the other. I'd recommend avoiding that in other scripts.

I am working on a patch to fix this, and more generally to get DV support working on my machine. Hopefully it will be ready for submission in a few days. My initial experiences with WCS have been a bit frustrating but it seems like it has the potential to be a really useful tool, perhaps I can help get it there.

Discussion

  • Tetsujin

    Tetsujin - 2015-06-01

    I didn't really think about the format of the ticket when I submitted it... and I don't see an option to edit the ticket. Perhaps this will help:

    What steps will reproduce the problem?
    1: Attach a DV camcorder whose profile in /sys/bus/firewire/devices does not provide a model name (mine is a Sony DCR-TRV17 Handycam)
    2: In WCS, add a DV camera as a source.
    2a: (optional) in the new DV camera source window, click on the Firewire logo to try to select a source.

    What is the expected output?
    Working DV camera output

    What do you see instead?
    DV source window shows no video from camera (because it doesn't know the camera's GUID, so the dvgrab command with the --guid argument fails). Sources list doesn't appear when button is pressed (because WCS could find no sources).

    The Operating system you are using (Linux, Windows etc)?
    Linux (Debian stable)

    What version ofWebcamStudioare you using?
    0.73

    What version of Java are you using?
    java version "1.7.0_75"
    OpenJDK Runtime Environment (IcedTea 2.5.4) (7u75-2.5.4-2)
    OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)

    What is your Webcamera vendor, model and version?
    Sony DCR-TRV17 Handycam

     
  • Tetsujin

    Tetsujin - 2015-06-01

    I think I've got my patch in good working order...

    Apart from the fact that the existing FindFires.java wasn't finding my camera, I felt the implementation was a bit fragile: For instance, a fw1 device with no model_name in sysfs would also cause fw2 and fw3 to not appear in WCS. So I felt the best approach was to gut the old implementation entirely and replace it with something that should be a bit more predictable.

    Since my camcorder doesn't have a model_name in sysfs I needed something else to populate the list in the UI with: I chose the format "vendor_name model_name (/dev/fw1)" - so my camcorder now shows up as "Sony (/dev/fw1)"

    One little wrinkle I encountered is that my camcorder apparently has some kind of sub-device associated with it in sysfs: it shows up as /sys/bus/firewire/devices/fw1.0 - I can't imagine we'd want it to show up in the list in the UI, and since the directory doesn't have a guid inside, it doesn't. All's well that ends well, though we may need to give more thought to how to handle those cases.

    I've tested this patch on one machine, with one camera. It appears to be working but further testing would be wise. The only other Firewire device I have to test with is an old iSight, and I can't readily test it until I get a power supply for my Firewire adapter. And even then, it's not a DV camera, so testing with it may not accomplish much. If somebody can try this out with other DV cameras, or other Firewire devices (Does WCS support Firewire audio?) I think that would be prudent.

    If the patch needs revision, if I missed a coding style requirement or there's some other issue with it, talk to me. If it's something I can fix, I'll fix it.

     
  • Soylent TV

    Soylent TV - 2015-06-01

    Thanks George, i will try to test the patch, but my problem is that i don't have any DV camera at the moment.
    I will try to ask a friend to borrow his one like he do when i was tried to implement DV Streams in WS.
    If you want to find someone for testing try in the G+ community:
    https://plus.google.com/communities/110329269823088092206
    If you want to join the project, please send me a mail at soylent.tv@gmail.com
    Thanks.
    karl.

     
  • Tetsujin

    Tetsujin - 2015-06-11
    • status: New --> Fixed
    • assigned_to: George Caswell
     
  • Tetsujin

    Tetsujin - 2015-06-11

    Fixed as of r585

     

Log in to post a comment.