LatencyTimer / InBufferSize for OS X, new Info.plist

2»

Comments

  • wjcroftwjcroft Mount Shasta, CA
    Conor, I think if you use the latest April installer from FTDI, it does all of those steps. A kext I think needs to be unloaded before it can be removed or replaced. For example I think their installer also removes or disables the Apple FTDI driver before installing the one from FTDI. As we know the Apple driver is awful, no changes allowed to settings.

    The kext-dev-mode nvram patch must be done, then a reboot is needed for that to take effect. That nvram change I think will also be removed by any OS X updates / upgrades you do, so you may have to redo it later if your OpenBCI stops working. Upgrades may also try to reinstall the Apple version of FTDI. Sigh.

  • Hmmm. I don't fully understand. Just gave it another shot start to finish. No luck.

    Is this ( $ sudo nvram boot-args="kext-dev-mode=1") all that's needed to do the kext-dev-mode nvram patch? And if so, when is the ideal time to do that? Immediately after removing and reinstalling the FTDI drivers?
  • Also, by latest April installer, you are referring to 2.3 from FTDI's VCP Drivers page, correct? That must be installed after installing 2.2.18?


  • wjcroftwjcroft Mount Shasta, CA
    Conor, hi. Since you have Yosemite you should only install 2.3, not 2.2.18. If you've installed 2.2.18 previously, I'm not sure what to say in terms of backing that out. One would expect that the FTDI 2.3 driver would uninstall previous versions of itself. Hopefully. Marion's instruction page suggests removing the old kext by hand before installing the new.

    Yes, that sudo line you show could be done before or after the 2.3 installer is run. Then you have to reboot to have the kernel pick up the new nvram setting. At that point the FTDI driver should be loaded and ready to go.

    So it sounds like you've done all this and it's still not working? Dang.

    According to some users, the quotes can mess up the nvram command, see this previous post. Do an "nvram -p" to verify your change got in. What screws up the quotes is if you do a cut / paste operation from some instruction sheet. The quotes get escaped somehow when pasted into Terminal.

    You can also boot with the Command-V held down (until text starts showing). This will display all your kernel startup messages.

    Is the FTDI driver showing up after booting with the "kextstat | grep FTDI" ? If not look for error messages on the Console app log viewer.



  • wjcroftwjcroft Mount Shasta, CA
    Complete uninstall instructions for all FTDI driver versions is on page 15 of the App Note, Section 4.x.

    http://www.ftdichip.com/Support/Documents/AppNotes/AN_134_FTDI_Drivers_Installation_Guide_for_MAC_OSX.pdf

    If you have previous FTDI drivers installed, I'd suggest following all the steps there. Before installing 2.3.

  • edited May 2015
    Have we established when reboots are needed in this process?
  • Hey guys :) I've updated my blog post with the instructions (including the dev mode + right ftdi driver version) Conor has tried it today and it works for him. @Rceballo98 is right to say that you should remove all FTDI drivers before proceeding. Good luck!
  • For easy access here is the link to @marion 's blog again: http://ebrain.io/openbci-ftdi-driver/

    Marion, do you reboot your mac at any point during this process?
  • I reboot after installing the ftdi driver and enabling dev mode
  • FYI, I have updated the blog post (I included the "reboot" step) => http://ebrain.io/openbci-ftdi-driver/
  • biomurphbiomurph Brooklyn, NY
    This is great guys! It feels like it's getting close to something we can publish in the docs!
  • edited July 2015
    Hi everybody!

    It's official, the fix now works and has been verified for versions MAC OS X 10.9 (Mavericks) and MAC OS X 10.10 (Yosemite). Joel and I have now verified on 3 different machines, in addition to Marion's comp.

    Thanks a lot to @wjcroft@marion, and @Rceballo98 , for helping us figure this one out!

    I took Marion's really great tutorial and added some verbosity/images to it for additional clarification, then turned it into an official OpenBCI Doc. You can check it out here:


    Please let me know if you run into any trouble undergoing the kernal extension surgery. It's definitely a bit of a process, but the latency is significantly better after making the fix! 
  • edited October 2015
    I am trying to make this fix work for me. 

    Since i have osx 10.10.5 i had to use the FTDI 2.3 driver, I am following all the steps that you've posted,
     but when i try to load (with 'kextload')  the driver, after i've been altering the Info.plist file,  all i get is an error message like this:


    "*/FTDIUSBSerialDriver.kext failed to load - (libkern/kext) validation failure (plist/executable); check the system/kernel logs for errors or try kextutil(8)."

    But if i remove the added lines in the Info.plist file the kextload command works fine.

    Has anyone else had the same problem?

  • wjcroftwjcroft Mount Shasta, CA
    The error message implies that your nvram change did not go in. That nvram fix turns off the validation failure check.
  • edited October 2015
    Now i have the fix working on my computer, but as soon as i try to get the python code to work 
    all i get is these error messages:
    -------------BEGIN---------------

    setting up
    starting
    N=256 M=8
    Warning: Skipped 422 bytes before start found
    Warning: Warning: Unexpected END_BYTE found <167> instead of <192>,            discarted packet with id <8>
    Warning: Warning: Unexpected END_BYTE found <174> instead of <192>,            discarted packet with id <8

    And I also get random data displayed as a graph, as soon as I try to abort the program, my laptop freezes and I have to restart.Is there any good fixes for this? Or did the fix in the Info.plist not work for me?



  • wjcroftwjcroft Mount Shasta, CA
    edited October 2015
    Does the Python code work ok for you on Windows or Linux or another laptop? It sounds like you might have issues with your FTDI drivers. Is OpenBCI_GUI now running ok for you on the Mac?
  • I just tried the guide with 2.2.18 on OS X 10.11.1 and unfortunately it's refusing to work with the plist modifications. Checking Console reveals "Untrusted kexts are not allowed invalid signature for com.FTDI.driver.FTDIUSBSerialDriver". Modifying the Info.plist file with just <key>InBufferSize</key><integer>64</integer> causes the error as well.

    Hopefully the 2.3 release will get a bump to help resolve latency issues since that release seems to work okay on 10.11.

  • wjcroftwjcroft Mount Shasta, CA
    @coreygo are you saying that the nvram command to turn off signature checking -- no longer works? I'm still on Yosemite here, 10.10.5. In this area of FTDI driver compatibility and patching, it's usually not a good idea to be an early adopter. Particularly as FTDI support is lagging.

  • Yep, I believe so. I definitely ran sudo nvram boot-args="kext-dev-mode=1" and rebooted before proceeding. Also checked my settings to allow apps from anywhere.

    I've noticed the same regarding jumping to the latest and greatest. I guess I'm somewhat used to things being in constant beta mode ;)
  • wjcroftwjcroft Mount Shasta, CA
    edited December 2015
    raven:~ croft$ nvram boot-args
    boot-args kext-dev-mode=1
    raven:~ croft$ 

    Is that what you see in your Terminal window with "nvram boot-args" command?




  • Could it possibly be because of SIP? http://www.macworld.com/article/2948140/os-x/private-i-el-capitans-system-integrity-protection-will-shift-utilities-functions.html This was introduced on OSX El Capitan. There are ways to disable it.
  • wjcroftwjcroft Mount Shasta, CA
    From that document: "Kernel extensions (kexts) that modify
    the core of OS X—the part that handles input and output and launching
    background software and the like—will still be allowed. But they will
    have to be cryptographically signed by a developer with a valid
    certificate from Apple."

    Looks like the whole idea of FTDI providing Info.plist editing capability, just got nuked. They could get around this by checking for an override Info.plist OUTSIDE of the driver itself. For example in a public directory such as /usr/local.

    I'll look through my old emails for an FTDI contact person I talked with before, try to get their take.
  • @wjcroft Yep, so it's definitely enabled.

    @marion I think you're onto something. Found these two resources:
    http://osxdaily.com/2015/10/05/disable-rootless-system-integrity-protection-mac-os-x/
    and this http://apple.stackexchange.com/a/209530 thread mentions csrutil enable --without kext
    -Corey
  • wjcroftwjcroft Mount Shasta, CA
    Corey, great, please try those workarounds and let us know if that fixes it. FTDI is really slow moving.
  • Okay, just confirmed that on 10.11.1 if you're going to use FTDI driver v2.2.18 you'll have to boot to Recovery OS (CMD+R) bring up Terminal and run csrutil enable --without kext after rebooting installation and modification of the plist file will work.

    That being said I honestly saw a questionable improvement in latency between 2.2.18 and 2.3. I was getting 15fps (50000bps average [30-70Kbps]) from the OpenBCI GUI in Processing 2 and with NeuromoreStudio I actually saw worse performance. It would hang and delay then display after a second or two. My system is a Late 2013 MBP with the 2.4Ghz Intel i5 and 8GB RAM.

    So for those reasons I went back to 2.3. I'm not sure what others are seeing when it comes to data rate and frame rate goes with the OpenBCI GUI as well as Neuromore.
    -Corey
Sign In or Register to comment.