Monday, January 14, 2008

Eye-Fi Manager Working in Linux!!!

First of all, this is perhaps the most significant progress I've made so far in unraveling this device. Getting it to work in Linux means that I have a very complete set of debugging tools to use on it to see how it works.

I'm running the "Eye-Fi Manager.exe" with wine. The issues that I was seeing with it were because Linux is not reading back the actual disk contents, but cached disk contents. I noticed this by enabling debugging on the usb_storage driver, then accessing the card multiple times with both O_SYNC and O_DIRECT set.

Those options should have caused Linux to do real reads from the card each time, but I didn't see the usb_storage debugging kicking in each time I did a read. See this post if you're curious why it's important to do real reads each time.

Anyway, I instructed wine to have the kernel throw away its cached copies just before each read() of the control files. I did it with this call:

posix_fadvise(unix_handle, 0, 0, POSIX_FADV_DONTNEED);

The result: a working Eye-Fi Manager in Linux. You need to hack and rebuild wine, but it is at least a proof of concept. It works!!

Now, I just need to go find out why the reads() aren't obeying O_DIRECT. It's probably either the usb_storage driver or the vfat filesystem code.


Anonymous said...

can you package it up? into something i can run?

Dave Hansen said...

Be patient. :)

I just figured this out a couple of hours ago. I'm working on finding the root cause, and I'll post here as soon as I have something workable. It'll probably involve applying a patch to wine, so it'd be good to practice building it for now.

Anonymous said...

That's AWESOME! I just bought an Eye-Fi card and was hoping the Eye-Fi manager would work in Wine. My last resort would have been a virtual machine but that's...less than optimal.

I'm assuming there are directions online somewhere that will help a n00b like me recompile Wine?

Sean said...

Hi All, just a note. I have been running the eye-fi manager under linux for over a year. The key? Use eye-fi manager version 1.7.2. It seems every version since that one fails in wine. So very curious to see your progress with the latest version.

Until then, if you want an easy working solution, I posted the 1.7.2 bin at

Sean said...

Oh and side note. To turn off the constant notifications about a new version being available you can add this to your /etc/hosts:

Geotagging and everything still works okay. I haven't noticed any other side effects it has on the manager software.