On Fri, 8 Sep 2006, Peter Rasmussen wrote:

> I mounted it 'ro' as vfat and got this:
> 
> [EMAIL PROTECTED]:/home/plr# mount -t vfat -o ro /dev/sda1 /mnt/mp3
> [EMAIL PROTECTED]:/home/plr# ls -l /mnt/mp3
> total 16
> drwxr-xr-x 2 root root 4096 2000-10-30 14:45 fm
> drwxr-xr-x 7 root root 4096 2004-12-13 05:43 music
> -r-xr-xr-x 1 root root  438 2000-10-30 14:45 settings.dat
> drwxr-xr-x 2 root root 4096 2000-10-30 14:45 voice
> [EMAIL PROTECTED]:/home/plr# ls -l /mnt/mp3/music/
> total 20
> drwxr-xr-x 2 root root 4096 2006-01-11 09:52 AmandaMarshall
> drwxr-xr-x 2 root root 4096 2004-12-13 05:47 AmiStewart
> drwxr-xr-x 2 root root 4096 2006-01-11 09:56 LisaStansfield
> drwxr-xr-x 2 root root 4096 2006-01-11 10:09 PaulaAbdul
> drwxr-xr-x 2 root root 4096 2004-11-27 18:35 Santana
> [EMAIL PROTECTED]:/home/plr# cp -a /mnt/mp3/music/AmandaMarshall/audio_* .
> cp: reading `/mnt/mp3/music/AmandaMarshall/audio_01.mp3': Input/output error
> 
> So, it didn't seem to make much of a difference, as I by this only got:
> 
> -rwxr-xr-x  1 root root     16384 2006-09-08 18:56 audio_01.mp3*
> -rwxr-xr-x  1 root root         0 2006-09-08 18:57 audio_02.mp3*
> 
> Attempting to mount it as 'msdos' instead of 'vfat' didn't seem to make 
> much of a difference:
> 
> -rwxr-xr-x  1 root root    114688 2006-09-08 19:19 audio_01.mp3*
> -rwxr-xr-x  1 root root         0 2006-09-08 19:24 audio_02.mp3*
> 
> [EMAIL PROTECTED]:/home/plr# mount -t msdos -o ro /dev/sdb1 /mnt/mp3
> [EMAIL PROTECTED]:/home/plr# cp -a /mnt/mp3/music/amanda~1/* .
> cp: reading `/mnt/mp3/music/amanda~1/audio_01.mp3': Input/output error

Okay.  It was just a wild guess, anyway.  I thought that perhaps the FOXDA 
doesn't like writes but can tolerate reads.  Evidently not.

> The debug /var/log/debug file is filled up with attempts and reattempts 
> to access the device. If you would like to have a look I'll post them.

No thanks; they're probably just like the ones from before.

> I don't think we should make Linux behave like XP, but perhaps if XP has 
> a way to deal with this device so it works, we might also be able to 
> make it?
> 
> Any ideas or suggestions are welcome, and I'll see what I can do.

As I see it, the only things that can affect the device's behavior are the 
contents and the timing of the packets it receives from the computer.  The 
contents aren't going to be exactly the same for Windows and Linux, but to 
some extent that shouldn't matter.  For instance, we know that Linux sends 
a READ CAPACITY command exactly twice while Windows sends it many more 
times.  It's hard to believe this could make a difference, especially 
since your failure occurred during the middle of the copy, when the only 
commands being sent should have been READ_10's.  It could be that the 
sequence of reads of data sectors vs. FAT sectors could make a difference, 
but it's not under easy control.

That leaves only the timing.  Unfortunately it's rather difficult to
measure the normal timings well without expensive hardware.  But if you
want, you can experiment with trying to slow down Linux.

You'll have to edit drivers/usb/storage/transport.c in the Linux source.  
The function in question is usb_stor_Bulk_transport().  If you read 
through it you'll see 3 major subroutine calls, corresponding to the 3 
phases of a SCSI command (the command phase, the data phase, and the 
status phase):

        usb_stor_bulk_transfer_buf(),
        usb_stor_bulk_transfer_sg(), and
        usb_stor_bulk_transfer_buf().

Actually that last call occurs more than once because the protocol allows
for certain types of errors/retries during the status phase.  Anyway, feel
free to try putting various delays in amongst those calls.  Wherever you
put a call to

        msleep(N);

it will cause a delay of at least N milliseconds.  For shorter periods,

        udelay(N);

will cause a delay of N microseconds.  (There already is such a delay in 
the code, although it doesn't get used for the FOXDA.)

Alan Stern


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to