Rockbox Technical Forums
Rockbox General => Rockbox General Discussion => Topic started by: sdhoigt on July 28, 2008, 11:33:47 PM
-
First of all love the project! Excellent work in bringing out the untapped potential hidden in these devices! ( btw the $22.77 donation is from me :)
Ok, I got everything installed on my new Sansa c250 under Windows via the installer. I then added a few music files (MP3s), boot up the device and all works well. Then I popped over to Linux, mount the device and add some more music files (E.g., the 'Melt Banana' directory/MP3s in the example below). I unmount and boot the device; the new files show up under 'Files', but they're not playable.
So I remount to see what happened and I see the files/directory I just added are corrupted. I can't enter the directory nor delete it.
$ ls -al
drwxr-xr-x 3 dit dit 32768 2008-07-27 23:50 Black Francis
d????????? ? ? ? ? ? Melt Banana
drwxr-xr-x 2 dit dit 32768 2008-07-27 23:31 MUSIC
drwxr-xr-x 3 dit dit 32768 2008-07-28 00:10 Phish
drwxr-xr-x 2 dit dit 32768 2008-07-27 23:31 PHOTO
...
Here's the relevant mount line in my fstab.
/dev/sdc1 /media/sdc1 vfat rw,user,noauto 0 0
FYI. I use this same fstab entry for mounting flash drives that I use back and forth on Linux and Windows w/o any problems.
I've been able to reproduce this file system corruption problem 3-4 times now with different assortments of files and have it narrowed down to file manipulation when mounted in Linux. No problems when moving files around in Windows.
Here's some dmesg output trying to mount the device after the file system has some corrupted data. The following section repeats a few times before I'm actually able to mount it.
[ 2948.897875] usb 4-4: new high speed USB device using ehci_hcd and address 33
[ 2949.030843] usb 4-4: config 128 interface 0 altsetting 0 endpoint 0x81 has an invalid bInterval 100, changing to 10
[ 2949.032752] usb 4-4: configuration #128 chosen from 1 choice
[ 2949.102746] scsi26 : SCSI emulation for USB Mass Storage devices
[ 2949.109796] usb-storage: device found at 33
[ 2949.109805] usb-storage: waiting for device to settle before scanning
[ 2954.115165] usb-storage: device scan complete
[ 2959.717549] usb 4-4: reset high speed USB device using ehci_hcd and address 33
[ 2964.841945] usb 4-4: failed to restore interface 0 altsetting 0 (error=-110)
[ 2964.842200] usb 4-4: USB disconnect, address 33
[ 2964.842476] scsi 26:0:0:0: Device offlined - not ready after error recovery
After last section repeats 3-4 times my system finally recognizes the device and I can mount it.
[ 2965.081460] usb 4-4: new high speed USB device using ehci_hcd and address 34
[ 2965.214641] usb 4-4: config 128 interface 0 altsetting 0 endpoint 0x81 has an invalid bInterval 100, changing to 10
[ 2970.207208] usb 4-4: configuration #128 chosen from 1 choice
[ 2970.264104] scsi27 : SCSI emulation for USB Mass Storage devices
[ 2970.274366] usb-storage: device found at 34
[ 2970.274375] usb-storage: waiting for device to settle before scanning
[ 2975.266634] usb-storage: device scan complete
[ 2980.869646] usb 4-4: reset high speed USB device using ehci_hcd and address 34
[ 2983.017784] scsi 27:0:0:0: Direct-Access SanDisk Sansa c250 Sans PQ: 0 ANSI: 0
[ 2985.015263] scsi 27:0:0:1: Direct-Access SanDisk Sansa c250 Sans PQ: 0 ANSI: 0
And here's the badness that is thrown while trying to access corrupt directories/files.
[ 2610.831125] FAT: Filesystem panic (dev sdc1)
[ 2610.831138] fat_get_cluster: invalid cluster chain (i_pos 0)
[ 2610.831143] File system has been set read-only
One final note. When I was trying to reproduce this problem just now I couldn't get it happen when I just copied over 2-3 files at a time (I.e., the songs played fine). But once I copied over a directory with >10 files the corruption happened.
Some info:
Original Firmware: 01.01.05P
Rockbox version: r18134-080727
Any ideas? Thanks a lot for reading,
SD
-
Did you use the original firmware for file transfers, or did you use a Rockbox build with a USB patch? Last I heard, the PortalPlayer USB driver is technically operational (though not enabled in the normal builds), but it induces corruption.
Someone correct me if I'm wrong (and I feel certain I am).
-
There are a couple of kinks in the driver, so until we sort them out, we're keeping the USB driver disabled in the normal builds for now.
You can, however, enable it when you compile by by defining the USB driver in the Makefile. Look for a line that reads EXTRA_DEFINES= and change it to:
EXTRA_DEFINES=DUSE_ROCKBOX_USB
This will enable the driver.
-
you probably actually want:
EXTRA_DEFINES=-DUSE_ROCKBOX_USB -DUSE_HIGH_SPEED
as otherwise you won't get the highest speed possible with the Rockbox USB stack.
-
Did you use the original firmware for file transfers, or did you use a Rockbox build with a USB patch? Last I heard, the PortalPlayer USB driver is technically operational (though not enabled in the normal builds), but it induces corruption.
Someone correct me if I'm wrong (and I feel certain I am).
I did use the original Sansa firmware for file transfers. Plugging in USB under Windows or Linux essentially boots into the original Sansa firmware. But I never (at least so far haven't) had any corruption moving files under Windows.
There are a couple of kinks in the driver, so until we sort them out, we're keeping the USB driver disabled in the normal builds for now.
You can, however, enable it when you compile by by defining the USB driver in the Makefile. Look for a line that reads EXTRA_DEFINES= and change it to:
EXTRA_DEFINES=DUSE_ROCKBOX_USB
This will enable the driver.
So are these "kinks" an improvement over the Sandisk USB implementation?
Thanks,
SD
-
I did use the original Sansa firmware for file transfers. Plugging in USB under Windows or Linux essentially boots into the original Sansa firmware. But I never (at least so far haven't) had any corruption moving files under Windows.
I'm really not sure what to tell you, then. :( I've been using my Sansa on a Linux machine since the day I got it, occasionally plugging it into my Windows laptop without problems.
So are these "kinks" an improvement over the Sandisk USB implementation?
I was on the IRC channel earlier today, and someone discovered that the biggest problem with the USB stack (data corruption) may have been sorted out recently.
As for whether it's an improvement, well, anything's an improvement over waiting on the Sansa's database to be refreshed. ;)
-
you probably actually want:
EXTRA_DEFINES=-DUSE_ROCKBOX_USB -DUSE_HIGH_SPEED
as otherwise you won't get the highest speed possible with the Rockbox USB stack.
Done. Hey, great job on the devs part; that was dead simple to get the Rockbox environment set-up (thanks to rockboxdev.sh!) and compiled.
I did notice that the Rockbox USB stack was quite a bit slower (yep, even with EXTRA_DEFINES=-DUSE_ROCKBOX_USB -DUSE_HIGH_SPEED) than the native SanDisk USB. I timed the transfer of 19 files at 98.5 MB. Rockbox USB took 3 min. 15 seconds; SanDisk USB took 25 seconds.
Anyway, I still experienced file corruption when setting everything up again (Rockbox bootloader/firmware) from scratch under Linux with the Rockbox I compiled from SVN. I had to pop onto Windows, go to recovery mode and to restore (via Sansa c200 wiki). Also, just to make sure file corruption isn't possibly happening on Windows too (in case I had missed it somehow before) I put Rockbox back on under Windows using the one I compiled under Linux and filled the c250 till the disk was full of music. No problems.
Since it's apparently not my computer (Windows and Linux are the same box) I'm starting to question the USB stack on my Linux distro (Xubuntu 8.04). I'll try another Linux distro and see what happens.
Thanks and I'm open to try other ideas.
SD
-
Since it's apparently not my computer (Windows and Linux are the same box) I'm starting to question the USB stack on my Linux distro (Xubuntu 8.04). I'll try another Linux distro and see what happens.
I'll go ahead and tell you that Ubuntu 7.10 has given me no problems at all with USB. (although I haven't updated to 8.04 yet because of wireless glitches (I have attempted to update once already, but with wireless gone I had no connection, so I reinstalled 7.10 cleanly)).
-
Since it's apparently not my computer (Windows and Linux are the same box) I'm starting to question the USB stack on my Linux distro (Xubuntu 8.04). I'll try another Linux distro and see what happens.
I'm running the same distro (and version), and I have no problems with the usb stack in general, or with filesystem corruption on my USB devices specifically.
-
Kubuntu 8.04 here, no problems either.
-
Can either of you post me the appropriate line from your /etc/fstab?
Another random thing I noticed is that when I mount under Windows using the SanDisk USB and move some files around I always get the 'Refresh Database' dialog after unmounting. Under Linux this never happens; it just goes right back to the menu (the original Sansa one). Not sure if that is an indication of anything.
Thanks,
SD
-
I don't have an fstab entry for any of my devices, I let HAL take care of mounting.