twilly / odvr

Olympus Digital Voice Recorder Driver
GNU General Public License v3.0
28 stars 12 forks source link

odvr-0.1 not functioning correctly with VN-240PC #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Suse 10.2
libusb 0.1.12-27
libsndfile 1.0.17-21

usb 2-1: new full speed USB device using uhci_hcd and address 4
usb 2-1: new device found, idVendor=07b4, idProduct=020d
usb 2-1: new device strings: Mfr=1, Product=2, SerialNumber=0
usb 2-1: Product: DIGITAL VOICE RECORDER
usb 2-1: Manufacturer: OLYMPUS OPTICAL CO.,LTD.
usb 2-1: configuration #1 chosen from 1 choice
e1505:/home/tj/source/odvr-0.1 # ./odvr -l
Model: unknown
Folder A (-10 files):
Slot File         Size       Date          Quality
Folder B (-10 files):
Slot File         Size       Date          Quality
Folder C (-10 files):
Slot File         Size       Date          Quality
e1505:/home/tj/source/odvr-0.1 # ./odvr -r -l
Resetting...
Model: unknown
Folder A (-10 files):
Slot File         Size       Date          Quality
Folder B (-10 files):
Slot File         Size       Date          Quality
Folder C (-10 files):
Slot File         Size       Date          Quality
e1505:/home/tj/source/odvr-0.1 #

This is a VN-240PC with 1 ~1hour long recording stored in Folder A.  odvr
didn't show that the file exists nor did it download when I tried to with
switch -d a.  I'd be interested in helping out with the code however I have
minimal practical programming experience and knowledge of the USB protocol
and devices.  I haven't taken a look at the code yet but I'm also curious
about how you figured out how the device communicates on top of USB.

-T.J.

Original issue reported on code.google.com by formf...@gmail.com on 7 Nov 2007 at 4:42

GoogleCodeExporter commented 9 years ago
"-10 files" is a bit of error code leakage, and it means that usb_bulk_write() 
failed
with your device (olympusdvr.c:223). I'm not sure which exactly which error 
libusb
returned. I'll make an issue to address better error handling.

Can you run this for me? I want to see if the USB endpoint layout is any 
different
with your device:

$ lsusb -v -d 07b4:

As for figuring out the protocol, I used QEMU (with KVM) with a Windows XP 
session. I
then used Linux's usbmon to sniff the USB traffic. Running Snoopy within the 
Windows
session should work as well. If you already have a Windows machine at your 
disposal,
run Snoopy and log the data as you browse and download recordings.

Careful when looking at the code. It was originally a hack that quickly evolved 
into
a working tool. "Alpha quality" would be a compliment to it. I'll answer any
questions regarding the source code as best I can.

Original comment by tristan....@gmail.com on 7 Nov 2007 at 9:23

GoogleCodeExporter commented 9 years ago

Original comment by tristan....@gmail.com on 7 Nov 2007 at 9:25

GoogleCodeExporter commented 9 years ago
e1505:/home/tj/source/odvr-0.1 # lsusb -v -d 07b4:

Bus 002 Device 006: ID 07b4:020d Olympus Optical Co., Ltd Digital Voice Recorder
 VN-240PC
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass       255 Vendor Specific Subclass
  bDeviceProtocol       255 Vendor Specific Protocol
  bMaxPacketSize0         8
  idVendor           0x07b4 Olympus Optical Co., Ltd
  idProduct          0x020d Digital Voice Recorder VN-240PC
  bcdDevice            1.00
  iManufacturer           1 OLYMPUS OPTICAL CO.,LTD.
  iProduct                2 DIGITAL VOICE RECORDER
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              50
Device Status:     0x0000
  (Bus Powered)
e1505:/home/tj/source/odvr-0.1 #

Thanks for the info.  I'm a bit busy atm however so I don't know when I'll have
questions.

Original comment by formf...@gmail.com on 7 Nov 2007 at 4:18

GoogleCodeExporter commented 9 years ago
I just uploaded v0.1.1. Give it a shot and post the error. I don't expect this
release to fix VN-240PC support just yet.

Original comment by tristan....@gmail.com on 11 Nov 2007 at 1:49

GoogleCodeExporter commented 9 years ago
Will do.  I don't have the device with me atm... I'll give it a go when I get 
back home.

Original comment by n66...@gmail.com on 11 Nov 2007 at 3:51

GoogleCodeExporter commented 9 years ago
usb 2-1: new full speed USB device using uhci_hcd and address 2
usb 2-1: new device found, idVendor=07b4, idProduct=020d
usb 2-1: new device strings: Mfr=1, Product=2, SerialNumber=0
usb 2-1: Product: DIGITAL VOICE RECORDER
usb 2-1: Manufacturer: OLYMPUS OPTICAL CO.,LTD.
usb 2-1: configuration #1 chosen from 1 choice
tj@e1505:~/source/odvr-0.1.1> ./odvr
Failed to open Olympus device: couldn't claim DVR interface
tj@e1505:~/source/odvr-0.1.1> su
Password:
e1505:/home/tj/source/odvr-0.1.1 # ./odvr
Model: unknown
e1505:/home/tj/source/odvr-0.1.1 # ./odvr -l
Model: unknown
Couldn't get file count on Folder A: timed out writing to EP2 (device out of 
sync?)
Couldn't get file count on Folder B: timed out writing to EP2 (device out of 
sync?)
Couldn't get file count on Folder C: timed out writing to EP2 (device out of 
sync?)
e1505:/home/tj/source/odvr-0.1.1 # ./odvr -r -l
Resetting...
Model: unknown
Couldn't get file count on Folder A: timed out writing to EP2 (device out of 
sync?)
Couldn't get file count on Folder B: timed out writing to EP2 (device out of 
sync?)
Couldn't get file count on Folder C: timed out writing to EP2 (device out of 
sync?)
e1505:/home/tj/source/odvr-0.1.1 # ./odvr -e
Model: unknown
e1505:/home/tj/source/odvr-0.1.1 #

Original comment by n66...@gmail.com on 11 Nov 2007 at 9:28

GoogleCodeExporter commented 9 years ago
It looks like odvr just can't establish proper communication with the VN-240PC. 
It's
probably expecting a slightly different command prep packet. I'll need a USB 
traffic
dump to find the differences, so when you get some free time try to setup 
Snoopy on a
Windows machine that has the official software, or use the VM method. Save the 
log
and attach it here.

Original comment by tristan....@gmail.com on 12 Nov 2007 at 12:57

GoogleCodeExporter commented 9 years ago
Ok, I downloaded snoopy from here http://www.wingmanteam.com/usbsnoopy/ which 
didn't
work so I got this one... http://sourceforge.net/projects/usbsnoop/ which also 
didn't
work.  When I say don't work, I mean the program appears properly installed, 
and the
services that are supposed to be running look like they're running but no 
output is
produced.  I'm unfamiliar with the VM method so if you could give more of a
description of how to do that I'd try it out.

Original comment by n66...@gmail.com on 12 Nov 2007 at 3:42

GoogleCodeExporter commented 9 years ago
I tried using the SourceForge version of the program. It took a bit of 
fiddling, but
I installed the service, installed and restarted the device, and if nothing was
showing, I'd unplug and replug in the device. A log window should appear in 
Snoopy
when the device finally connects and is being sniffed.

As for the VM method, I used KVM (based on QEMU) and followed the QEMU guide on
connecting USB devices. Once I got the device working inside the VM, I loaded in
debugfs and usbmon, like so:

$ mount -t debugfs none /sys/kernel/debug
$ modprobe usbmon

You should see usbmon appear in the debugfs mount point. The numbered files
correspond to a specific USB bus (there are no device specific streams). See the
Linux documentation on usbmon (Documentation/usb/usbmon.txt).

Original comment by tristan....@gmail.com on 12 Nov 2007 at 4:07

GoogleCodeExporter commented 9 years ago
Alright here we go...

Original comment by n66...@gmail.com on 12 Nov 2007 at 4:35

Attachments:

GoogleCodeExporter commented 9 years ago
I had Digital Wave Player running while I was running snoopy which is what I 
think
the problem was before.

Original comment by n66...@gmail.com on 12 Nov 2007 at 4:36

GoogleCodeExporter commented 9 years ago
Ah! Very close! That log has just the basic startup of the device. Now set 
Snoopy up
and get that log going without DWP running, but don't close Snoopy yet. Then 
start
DWP and it should still sniff traffic.

In DWP, do some basic operations and note the order you do them in. For example:

1. Look into Folder A.
2. Look into Folder B.
3. Downloaded Folder A to computer.

Right now I'm mostly interested in listing files in folders.

Original comment by tristan....@gmail.com on 12 Nov 2007 at 4:43

GoogleCodeExporter commented 9 years ago
Well, I fired up DWP and attempted to download Folder A... It got about 3 
seconds
worth of file transfer in before I got a BSOD.  Also, Snoopy did not seem to 
see any
more than the original 6 packets even after I started the transfer. :S

Original comment by n66...@gmail.com on 12 Nov 2007 at 4:54

GoogleCodeExporter commented 9 years ago
I also forgot to mention that I don't see an option to list the folder contents 
of
the device through DWP, just the number of files it contains.

Original comment by n66...@gmail.com on 12 Nov 2007 at 5:01

GoogleCodeExporter commented 9 years ago
That's not good, not even the BSOD :\. BTW, I'm using SnoopyPro v0.22 to get
inside-Windows sniffing. A older version may explain instability. If you 
continue to
have issues getting a clean sniff of the USB traffic, then you might be forced 
to use
the virtual machine method. 

My DWP software allows you to browse the DVR to see what it has before 
downloading
(lower left window pane). Successfully replicating that feature was the first 
step in
getting my device to work.

Original comment by tristan....@gmail.com on 12 Nov 2007 at 5:07

GoogleCodeExporter commented 9 years ago
Guess so

Original comment by n66...@gmail.com on 12 Nov 2007 at 5:20

Attachments:

GoogleCodeExporter commented 9 years ago
That all looks alright to me. If it BSOD's on that, you'll need to do the VM 
method.

Original comment by tristan....@gmail.com on 12 Nov 2007 at 5:29

GoogleCodeExporter commented 9 years ago
Alright well I can't seem to get my usb devices functioning properly... Any 
advice?

Original comment by n66...@gmail.com on 13 Nov 2007 at 11:59

Attachments:

GoogleCodeExporter commented 9 years ago
I see what you did. You need to do the "usb_add" in the QEMU monitor, which is
accessed by CTRL-ALT-2. Start up your VM, go to the monitor, issue a "info 
usbhost"
and then do a "usb_add." CTRL-ALT-1 back to Windows, and you should see Windows 
add
new hardware.

Original comment by tristan....@gmail.com on 14 Nov 2007 at 4:08

GoogleCodeExporter commented 9 years ago
ugh... could not open /proc/bus/usb/devices in the qemu monitor...
It's documented here -
http://www.suseforums.net/index.php?showtopic=27788&pid=150557&mode=threaded&sho
w=&st=&#entry150557

Which means I'd have to compile a new kernel, downgrade to 10.1 or upgrade to 
10.3. 
I've been meaning to do that for a while but I don't know when I'll get to it so
we're kinda stalled here for a while. :(

Original comment by n66...@gmail.com on 14 Nov 2007 at 4:41

GoogleCodeExporter commented 9 years ago
Ouch. You could take a stab at compiling a kernel. Take the distro kernel and 
modify
that option to build a module. With the module you can mount usbdevfs.

In any case, I'll keep monitoring this bug. Update it whenever you feel like it 
:).

Original comment by tristan....@gmail.com on 14 Nov 2007 at 7:27

GoogleCodeExporter commented 9 years ago
I tweaked some code for issue #5 (problem with a VN-120PC). Check to see if you 
can
at least pick up the model with this code:

http://code.google.com/p/odvr/issues/attachment?aid=7020002411370396341&name=odv
r-r411.tar.gz

Original comment by tristan....@gmail.com on 11 Dec 2007 at 12:15

GoogleCodeExporter commented 9 years ago
usb 1-1: new full speed USB device using uhci_hcd and address 2
usb 1-1: new device found, idVendor=07b4, idProduct=020d
usb 1-1: new device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1: Product: DIGITAL VOICE RECORDER
usb 1-1: Manufacturer: OLYMPUS OPTICAL CO.,LTD.
usb 1-1: configuration #1 chosen from 1 choice

e1505:/home/tj/odvr-r411 # ./odvr -l
Couldn't query model name: timed out writing to EP2 (device out of sync?)
e1505:/home/tj/odvr-r411 # ./odvr -r -l
Resetting...
Couldn't query model name: timed out writing to EP2 (device out of sync?)
e1505:/home/tj/odvr-r411 #

On a positive note, 10.3 is installed and I'll get around to checking to see if 
USB
works in the VM sometime...

Original comment by n66...@gmail.com on 15 Dec 2007 at 4:56

GoogleCodeExporter commented 9 years ago
Saw this (http://code.google.com/p/odvr/issues/detail?id=7#c22) post. Checked 
out the
snapshot and the code is now working with my device. :)

Original comment by n66...@gmail.com on 14 Jan 2008 at 12:39

GoogleCodeExporter commented 9 years ago
Oh, that's good news! I'll make an official release since that's two previously
broken, but now fixed devices.

Original comment by tristan....@gmail.com on 14 Jan 2008 at 12:54

GoogleCodeExporter commented 9 years ago

Original comment by tristan....@gmail.com on 14 Jan 2008 at 2:00