Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Hardware Hacking Build Hardware

Most CF Cards Fail DMA Transfers 140

Anomalyst writes "In his quest to create an open source video camera, Andrey Filippov of elphel.com has determined that most Compact Flash devices, although claiming to be DMA capable, do not perform Direct Memory Access transfers correctly. This means successful movement of data to and from the device takes much more time with DMA disabled." The culprit appears to be the controller chip packaged with most of the CF cards Filippov tried. We last visited Elphel and their work on open source digital cameras in 2002. Filippov gave a Tech Talk at Google last year.
This discussion has been archived. No new comments can be posted.

Most CF Cards Fail DMA Transfers

Comments Filter:
  • Creative (Score:4, Insightful)

    by negRo_slim ( 636783 ) <mils_orgen@hotmail.com> on Saturday July 12, 2008 @03:36PM (#24165937) Homepage
    Reminds me of the infamous Soundblaster crackle... Which in this thread [creative.com] is being discussed around X-Fi hardware. Even though I can remember the very first Live!'s giving me and my friends the problem years ago. I don't recall the exact details of the situation but I believe it was an improper PCI implementation.
    • Re:Creative (Score:4, Informative)

      by 77Punker ( 673758 ) <(ude.tniophgih) (ta) (40rcneps)> on Saturday July 12, 2008 @03:48PM (#24165995)

      It's pretty fascinating how the company that appears to be the market leader is also the worst in terms of actually delivering a good sound card. Then again, maybe it shouldn't surprise me since they're also the biggest liars. I got bitten twice.

      NEVER AGAIN

      • Well like I said we had problems with the cards, but as components changed the problem would fade away. Right now I run an el cheapo Audigy SE and couldn't be happier with it. When it was a problem it was a big problem, but when it's gone... at the end of the day I'm glad to have an SB in my rig.
        • You wouldn't have been happy if you bought the Audigy LS when it was new and then Creative didn't make drivers that worked with XP SP2 until Vista was released. Not to mention the fact that after those drivers came out, it wasn't compatible with 2.1 speakers in hardware mode; it would only do surround sound.

          Repeated contact with Creative changed nothing; their only answer was reseat the card, reinstall drivers and so forth. I did all of that many times, and they never cared to do anything about it.

          Now I hav

          • You wouldn't have been happy if you bought the Audigy LS when it was new and then Creative didn't make drivers that worked with XP SP2

            That's why I bought the Audigy SE for $30, I noticed it was more akin to the Live! series then anything else. So I knew what to expect and I really couldn't justify spending any more on features I wouldn't use or a handful of frames per second I won't notice.

      • Re: (Score:3, Informative)

        by makomk ( 752139 )
        Of course, the only reason Creative are the market leader is because they bought out and killed off anyone who looked like they might actually be a viable competitor...
      • Wait a minute ... there's still a market for sound cards? I am perplexed. Last I checked, there wasn't a motherboard made that didn't have onboard SPDIF, not to mention plugs for 5.1 speakers. Who are these people who buy sound cards?
        • Re: (Score:3, Interesting)

          by 77Punker ( 673758 )

          It's like the difference between an onboard video setup and a "real" one. People who need more features always have to pay a little more for them.

          • by nfgaida ( 68606 )

            No.. there is a difference. Onboard video isn't powerful enough to play most new games at any decent frame rate. My onboard sound doesn't prevent me from playing any games.

            I think it is more for audiophiles now.

            • by 0xygen ( 595606 )

              For gamers, there is a massive difference.

              DICE's Battlefield 2 uses EAX to provide detailed positional audio on X-Fi cards.

              I have played a fair amount of Battlefield 2, around 400 hours. About half way through this, I upgraded from onboard audio to an X-Fi Fatal1ty. My Kill to Death ratio went up by about 25% within a few days.

              For me, the stats speak for themselves. Same applies to Race Driver GRID currently... there is no need to use the mirrors if you have reasonable hearing.

              I understand this can be done

              • by djdavetrouble ( 442175 ) on Saturday July 12, 2008 @07:41PM (#24167653) Homepage

                I upgraded from onboard audio to an X-Fi Fatal1ty. My Kill to Death ratio went up by about 25% within a few days.

                NEVER underestimate the power of.... Celebrity Endorsement !

                Get the Fatal1ty mousepad to go up another percent.

                • by 0xygen ( 595606 )

                  Yeah, the celebrity endorsement nearly put me off.
                  I was looking at the lower end cards, but discovered the lowest two X-Fi card do NOT have the real X-Fi chipset, so do not support the hardware acceleration for gaming!

                  Personally I do not like glass-style mousemats, I prefer the old fabric ones, so use an Everglide Titan with a Logitech G5 mouse set to a LOWER DPI. I find this is actually more accurate than a smaller surface with high DPI.

                  Funnily enough, in actual gaming, I seem to recall Fatal1ty actually p

              • Personally, I find my hearing gets a lot better just putting on a good set of headphones. It really helps to pin down exactly where the sound is coming from. It's a lot easier than trying to get perfect placement on your 5.1 setup.
                • by 0xygen ( 595606 )

                  Yep, I agree - I use the cheaper stereo version of the Medusa headset with the X-Fi card set to headphone mode. I have tried the 5.1 version of the Medusa headset, and do not find it that much better for the money.

                  This does actually provide excellent virtual surround, which is why I think I need the X-Fi.

                  I had to go back to my onboard Realtek HD-Audio, and tried it in AC97 mode too a few weeks ago. It was not a nice experience.

              • The only difference I've noticed on BF2 with extreme sound quality (or whatever it's called) is that you get more channels. I don't hear much or any difference in positional and ambient audio. That audio could even cause a 25% upshot in KDR is so unlikely I don't buy it. It means that 25% of your deaths was from an enemy not in front of you and in audible range. I don't buy it.
                • by 0xygen ( 595606 )

                  Part of the serious difference is related to the fact I mainly play Infantry Only these days.

                  The downside to IO is that often you are getting sniped without being able to see where from. In this situation, being able to hear whether the sniper is above you and often exactly where they are is a massive advantage. It's enough that I have been accused of cheating a lot more since getting X-Fi.

                  The other main situation where it helps which I can tell the difference between software and EAX is you hear boats and

            • Or if you want to do any recording. Try playing with Audacity - motherboard sound frequently isn't up to letting you record a track while playing back another.

              It's more than a little annoying that a 1998 PCI sound card beats 2008 motherboard sound hardware.

        • The same people who also buy 1kW power supplies
        • >>Who are these people who buy sound cards?

          Offloading the sound processing to the SB X-Fi bought me about 10-20 fps in games when I benchmarked it immediately before and after installation. On-board sound requires your CPU to do math, and if you have a lot of stuff going on, with various filters being applied to them, it makes a noticeable difference. More importantly, it stopped the occasional hitches and slowdowns I'd get, especially with winamp running in the background.

          Plus, the sound that comes o

          • So if you offload the sound processing to the sound card, and the graphics processing to the graphics card, what exactly is left for your CPU to do?
            • >>So if you offload the sound processing to the sound card, and the graphics processing to the graphics card, what exactly is left for your CPU to do?

              Stuff.

              But no, seriously, whatever it is that pegs my CPU when running Crysis or Age of Conan.

              Offloading the sound processing to the card makes a very noticeable difference.

            • DRM!

        • Well, some people like myself have a speaker set up that doesn't have digital inputs, and the analog outputs on the motherboard are noticably noiser. And besides, few onboard sound cards have powerful enough amps to drive a good set of headphones at a decent volume.

          Of course, you are probably right about the market. My sound card is an Aureal Vortex that I bought for my K6 system back in the days before onboard sound became ubiquitous. Quite possibly the oldest component in my computer, and I don't remem

      • Why is that surprising? The same is true in printers, and probably a whole slew of other products.

    • "Which in this thread [creative.com] is being discussed around X-Fi hardware."

      I have an X-fi (the full version with the faceplate) and I had the 'crackle', but you assume end users know what their 'crackle' causes actually IS, most users I imagine are quite doltish, although some might genuinely have problems but I imagine it's a small group. For me and I found out the crackle was actually because of the soundblaster faceplate 'IDE cable' that connects the card to the faceplate for audio out.

      Once I moved i

  • by AaronW ( 33736 ) on Saturday July 12, 2008 @03:41PM (#24165957) Homepage
    I have been using a Lexar 300x UDMA CF card for a while in my camera (which supports UDMA) without any problems. I also know many people are using the Sandisk UDMA cards without problems as well. Both were also certified to work with my camera (Nikon D300) by Nikon.
    • by LanceUppercut ( 766964 ) on Saturday July 12, 2008 @03:49PM (#24166003)

      How do you know that it indeed works in a full-fledged UDMA mode and not in some half-assed workaround mode, used specifically because of the problems in question existing in the cards' controllers. Did you reverse engineer the camera's firmware?

      • by AaronW ( 33736 ) on Saturday July 12, 2008 @03:59PM (#24166063) Homepage
        It would not be possible to get the performance the camera gets if it did not use DMA mode. It may be that it uses 1K blocks like the article says they used for a workaround. The cards also work fine in UDMA capable external readers, otherwise I would be seeing a ton of messages in the camera forums I frequent. Sandisk and Lexar UDMA CF cards are frequently used with the new cameras that can support it and are widely used by professional photographers.

        Also, the article said that the Sandisk card they tried worked. They did not mention anything about Lexar but did mention problems with Transcend, which is not certified for my camera.
        • To see if you get real UDMA, put the card in a ATA->CF adapter and see if you can use UDMA.
          Since you then are using it as a regular IDE-device, you can easily verify it.

      • Re: (Score:3, Informative)

        I can't vouch for cameras, but I created a CF-based hard drive to boot my Windows XP tablet PC using one of these [addonics.com]. It has two CF slots, and my tablet's IDE controller supports UDMA. In Windows, you can check what UDMA/PIO mode your disks are in by clicking the Advanced Settings tab on the IDE adapter's property page in Device Manager.

        The first device I tried was the cheapest UDMA CF card I could get my hands on (233x 16gb Ritek), and after a few disk driver errors, it dropped out of UDMA mode and the laptop

        • I wonder how often voltage (5V vs. 3.3V) is a factor in UDMA problems...
          Like the previous poster, I use a Transcend CF card to run XP and Ubuntu on a laptop. I recently "upgraded" to the 16GB 300x version, since it was supposed to run at UDMA5. I wrote the review here [newegg.com].

          Short story: According to Transcend, the card has to run at 3.3V in order to run in UDMA5 mode. I'm also using that Addonics 2-card CF-to-IDE adapter, and it doesn't offer voltage choices, so I'm stuck at 5V and the slower speeds -- au
          • I wonder how often voltage (5V vs. 3.3V) is a factor in UDMA problems...

            A lot less often than you think, probably ;) TFA is about UDMA failing altogether, not a failure in differentiating between 4 and 5. My tablet only supports UDMA4 to begin with, so I didn't experience the issue you described with the Transcend card. I'd be extremely interested to know if you see any speed difference whatsoever between 4 and 5 though, as the physical specs of the card seem to max out at the speeds allowed by UMDA4.

            Also, I found the connector of the Addonics card to be so extremely tight-fitt

        • Re: (Score:1, Interesting)

          by Anonymous Coward

          Something interesting to note is that I can't get anything approaching the speed of the Addonics IDE-CF apapter out of any USB CF adapter I could find. They generally run fast, just not as fast.

          Strangely Hard drives connected through a USB adapter run slower than those connected through the IDE interface. Hmm, this couldn't have anything to do with USB, could it? </sarcasm>

          Basically what I'm saying this isn't really interesting if you know USB is crap for data transfer, which I thought most people here knew. Though if you didn't already know this, I can see why you thought it interesting.

      • Easy !

        Compact Flash form factor is really a down-sized PC-Card 16bits / PCMCIA form factor.
        And PC-Card 16bits is nothing more than cousin of ATAPI which is external and supports hot swapping.
        (Just as PC-Card 32bits is a PCI cousin with hotswapping, and Card-Express has both PCIe and USB2.0 pins).

        There are CF IDE adapters which are mostly passive pin-adapter without any logic, that let you access a CF card using an IDE bus (minus the hot plugging).

        So just plug your compact flash into one of such card adapter

    • Many of times the problem is not in the CF card, but instead in the system adapter. I originally tried to use the Lexar 300x using the commonly sold SD-CF-IDE-A and the Linux kernel will hang even when specifying ide=nodma and it spits out some error codes. I then purchased a CF to SATA adapter from Addonics [addonics.com] and everything works like a charm.
  • by Gothmolly ( 148874 ) on Saturday July 12, 2008 @03:48PM (#24165991)

    What's next, some USB mice fail at implementing the USB 2.0 standard? Or some random printer which claims to support PCL really doesn't?

    Geesh, talk about a slow news day.

    • by maxume ( 22995 )

      On a slow news day, the oddest stories get posted and people often get interpreted in an excessively literal fashion.

    • by karnal ( 22275 )

      This news is actually extremely important to me; I bought a CF to IDE adapter to mess with and am thinking of converting two of my machines to use compactflash cards:

      1. Laptop
      2. PC in garage

      The PC will probably get the first set-up; no need to run the aging 80 gig hard drive into the ground. Especially in the harsh conditions there. The laptop will be a project "if I get around to it" but would be cool to do, what with all of the SSD talk nowadays.

      Anyone have any ideas on Linux on CF (limiting writes et

      • Anyone have any ideas on Linux on CF (limiting writes etc?)

        Here are some links:

        Also most other eee laptop configuration guides you can find.

      • Re: (Score:1, Informative)

        by Anonymous Coward

        Try this for tips:
        http://www.cyrius.com/debian/nslu2/linux-on-flash.html

      • by tepples ( 727027 )

        Anyone have any ideas on Linux on CF (limiting writes etc?)

        Look at what Puppy Linux does: Don't use a swap file. Mount your temporary file systems in RAM.

        As for the commonly expressed fear of hitting some claimed limit of 10,000 writes per sector, that fear is overblown. The controller chips in modern CF and SD cards should be able to use the 7.4 percent difference between 2 GB and 2 GiB to spread the writes around the physical sectors [wikipedia.org]. And if you can find SLC (single level cell) flash, its speed and durability might be worth it.

    • Well, it is important to point out that there are differences in memory cards people might want to consider. Most people I know consider all memory cards to be functionally equilivent and just buy the cheapest one they can find at the size they want.

    • by DAldredge ( 2353 )
      It's almost like this is a site for nerds or something.
  • by kennyj449 ( 151268 ) on Saturday July 12, 2008 @03:49PM (#24165997)

    I can vouch from personal experience with their engineers that their cards rated for 30MB/s or higher all support UDMA 4 or higher, and I've done tests of my own to verify this. Not all ExtremeIII cards support UDMA though; the ones that don't specify a speed of 30MB/s are instead rated for 20MB/s, which can be quite easily achieved using PIO6 (although less efficiently.) These cards might support UDMA, but since there's no *need* for it, there are no guarantees.

    Also, I'm pretty sure Lexar cards rated for UDMA do perform as advertised. I can't vouch for other manufacturers. Additionally, be wary of fake cards (ebay is especially prone to fake card sales) as they're never going to perform to your expectations.

    • Re: (Score:3, Informative)

      by AaronW ( 33736 )
      I can at least vouch that the Lexar UDMA card works as advertised in my UDMA capable camera. Fake CF cards are a big problem. Avoid buying CF cards on Ebay and only buy from reputable dealers or you might get a fake Chinese card and have nothing but trouble.
  • In his quest to create an open source video camera...

    What the hell is an open source video camera? I've heard of open source software, but what the hell is open source hardware??

    • Re: (Score:2, Informative)

      by edlinfan ( 1131341 )

      Perhaps hardware which is extensively documented, with all documentations/plans/schematics licensed under the GFDL or similar?

      Just my $0.02

      • by BhaKi ( 1316335 )

        You could just call it "Programmable Hardware" or "Documented Hardware".

        IMHO, "Open Source Hardware" is just a clever phrase used by many hardware people to leverage advantage of the well-marketed "Open Source" phrase.

        • by Mr Z ( 6791 )

          If the schematic files are available in source format, and possibly the CAM information (Gerber files, drill files, etc), I'd call that open source, since that's the material used to generate the boards. It's one thing to print a schematic. It's quite another to publish the board layout in an editable form.

          I haven't looked at what this project is doing, but it sounds like the latter.

          --Joe

          • Re: (Score:2, Informative)

            Yes, we do have it all posted, but unfortunately we can not post the PCB layout "source" - this is the last part of the camera design were I use some proprietary software running on top of the proprietary OS and saving data in proprietary format. It is a shame, I agree - but I could not find a good FOSS substitute. I would definitely pay twice (or more) for the same functionality GPL-ed software, maybe it is possible to to make a pool to buy some software to be free?
            • by Ig0r ( 154739 )

              FWIW, Cadsoft Eagle [cadsoft.de] is a proprietary schematic capture/layout program that has a free version that anybody can use to view or print (but not edit) design files written by the full versions.
              Also, Cadsoft has a much lower price (around $150) if you're using the full version for non-commercial activites. Eagle seems to be quite popular for the hobbiest market because of this.

              • Re: (Score:3, Interesting)

                Yes, I know Eagle. But it can not handle the the designs we have, and it is still not a free software. So - we'll have to wait.
                Elphel would put some $50K in the pool (if there was one) to buy a serious PCB CAD software no make it GPL-ed.
    • What the hell is an open source video camera? I've heard of open source software, but what the hell is open source hardware??

      Um, if I were to guess, this would be a hardware video camera with open source firmware, or a reference platform for building a functional video camera like a PC, where you'd plug together lenses, buttons and sensors in a case. It probably would look like RED [red.com].

    • Re: (Score:1, Funny)

      by Anonymous Coward

      I asked the same question, and was able to educate myself in about 30 seconds with Google. Try that next time...

  • Why do they want to use Compact Flash cards? I think SD cards are more common, at least in the cameras I had so far, correct me if I'm wrong. And maybe SD and SDHC cards don't have those problems?
    • Re: (Score:2, Informative)

      by stevo3232 ( 794498 )

      Compactflash cards are available in larger sizes, work as IDE devices (which SD cards do not afaik) and are faster.

    • Re: (Score:3, Informative)

      by maxume ( 22995 )

      Compact flash is/was the standard on the high end. SD is making some inroads, but for a long time, fancy cameras had CF slots and that was your choice.

    • Re:Compact Flash (Score:5, Informative)

      by Sen.NullProcPntr ( 855073 ) on Saturday July 12, 2008 @04:34PM (#24166273)
      I'm guessing size is the main factor, according to Wiki [wikipedia.org] SD has already maxed out at 32GB while CF has a theoretical max of 137GB. You need a lot of storage space for video.
      • Re: (Score:2, Informative)

        by minhmeoke ( 1156389 )
        What about MMC [wikipedia.org]? According to Wikipedia, they have a theoretical maximum capacity of 128 GB, and MMCs can be used in most devices which support SD cards. Also note that

        As of February 2008, the specifications version 4.3 (dated nov 2007) can be requested from the MMCA, and after registering downloaded free-of-charge.

      • Physical size might be another reason why CF is seen on higher end cameras. Microdrives used to be a lot more popular back before flash became so cheap, and for Microdrives you need a CF slot as the SD form factor is way too small.

    • Re:Compact Flash (Score:5, Informative)

      by AndreyFilippov ( 550131 ) on Saturday July 12, 2008 @04:57PM (#24166433) Homepage
      Two of the reasons wewrw already mentioned: 1 - I've got IDE interface "for free" in from the processor chip, just needed connector. 2 - CF cards are higher capacity. 3 - I can download CF and ATA specs from the Internet, while SD (when I checked it) was much more difficult to get.
      • You can get the Simplified SD spec [sdcard.org], which is basically the normal spec minus the DRM and some other unimportant details.

      • While the primary SD interface is kinda complex, SD cards are required to support an SPI interface, which is pretty much the most brain-dead simple interface imaginable.

        Most microcontrollers will support it natively, and it's incredibly simple to implement in hardware and software. It's what I usually use when I need to back a PIC with lots of storage.

  • I run an 8 GB Transcend 133x [transcendusa.com] in my Alix board as a router/firewall on FreeBSD, and the BIOS and OS pick it up as UDMA33 without a problem. I get sustained reads of 33 MB/s and writes of about 9.5 MB/s.

  • God damn it, why can't I have that last name?

  • by Migraineman ( 632203 ) on Saturday July 12, 2008 @04:46PM (#24166365)
    I've been struggling with CF cards in embedded applications, and I can verify that they don't always comply with the interface specs. I've gone through at least a half-dozen different CF card brands, and all display some form of misbehavior if they're put on an IDE chain with another device. By themselves they work fine, but add a CD-ROM or a hard drive, and the system will fail with either bus timeouts or stalled transfers. My suspicion is that the CF card vendors are playing games with performance metrics in photography apps, and in those environments they can bend the spec because there's exactly zero chance of another device being installed on the interface.

    As far as I can tell (without a bus analyzer,) there's something hinky happening during device auto-detection and initialization. Many times, the CF card will be detected as the Master device, but no Slave device will be detected. Swap to a different brand CF card, and the symptom will change - both devices will auto-detect, but the IDE bus will throw timeout errors during boot. Swapping in just about any not-a-CF-card device, and everything is fine.
    • I agree, they probably assume that it's going to be used in a single drive bus. I think I have IDE to CF adapters that allow the user to set which is master and which is slave. I haven't tried to use a non-CF device with a CF device on the same bus.

      I doubt they consider embedded use at all. Digital cameras are probably still the leading use of CF cards by far, but that's being pushed out a bit as no point and shoot seems to use it, and even low end dSLRs are switching over to SD.

    • by riflemann ( 190895 ) <riflemann@@@bb...cactii...net> on Saturday July 12, 2008 @09:49PM (#24168681)

      A while ago I built my mythtv frontend, (based off a T-Online vision s100 box) and elected to use a CF card for storage within the unit - the box is entirely free of moving parts, so CF made sense.

      I bought one of those IDE to CF adapters off ebay, and found that when I turned on DMA, the IDE bus would basically lock up, and pretty much end up useless.

      After a lot of fiddling and digging around, I discovered that the adapter did not connect the required pins for DMA transfers to work. Old-skool CF never had DMA, so this extra pin is only a recent addition to the standard.
      Anyway, I soldered in a short wire to hook up this pin, and now I get respectable dma transfers.

      The moral of the story - it might not be the CF card that is causing DMA failure, but the adapter it's hooked into.

      • I've gone through the gamut of permutations - the task is one for work. Our CF-to-IDE adapters have been buzzed-out to make sure the DMA lines weren't pegged. There are several on the market that have the DMA signals tied high or low, though I can't comprehend why. We've also made sure the DASP and PDIAG signals are connected (those are necessary during the auto-detect phase.) We have fielded products that have a custom PCB connected to a Cirrus EP9312 Arm9 CPU. The CF adapter in that app works fine, i
      • by adolf ( 21054 )

        I also have a few no-moving-parts machines running with various cheap Chinese CF-to-IDE adapters, some of which are a few years old. They are all, unilaterally, quite slow. For what they're doing (a web browser for Thottbot, a processor for audio, and an antique 386 laptop running antique Slackware), speed isn't important -- and the 386 will obviously not work with DMA anyway -- but it'd be nice if they booted faster.

        Which pin should I be investigating at to see if this might be part of the problem? Look

    • I've also seen this behaviour.
      One or two CF-cards on one IDE-bus: No problems
      One CF-card and anything else on the same bus: The CF-card fails to enter ATA-mode, which means that it tries to talk to the IDE-bus as if it's a CF or PCMCIA-port.

      Haven't seen any card that doesn't show this problem, but I've only tried about 8 - 10 different cards.

  • by AndreyFilippov ( 550131 ) on Saturday July 12, 2008 @04:50PM (#24166393) Homepage
    In the article I was only describing CF working in "true IDE" mode, inside the cameras thy usually do not use it, so do not care much about the problem I've got. But it is important if you try to connect the camera with a simple adapter instead of the HDD
  • > We last visited Elphel and their work on open source digital cameras in 2002...
    Are you sure? Wasn't it just a week ago?
    http://mobile.slashdot.org/article.pl?sid=08/07/05/1711221 [slashdot.org]
    • > We last visited Elphel and their work on open source digital cameras in 2002...

      Are you sure? Wasn't it just a week ago?a

      Give the editors a break, will you? They don't remember what stories they posted yesterday. They can't spell, they have no grammar skills and now you want them to understand time?

      This is sure a tough place...

  • What happened to the good old days when chip vendors would fall over themselves to give you data sheets, application notes, and anything else you might need to use their products in your design? NDAs were for things like information on unannounced products.

The Tao is like a glob pattern: used but never used up. It is like the extern void: filled with infinite possibilities.

Working...