+ Reply to Thread
Page 1 of 4 1 2 3 ... LastLast
Results 1 to 15 of 58

Thread: nia is only a HID device, no drivers needed

  1. #1
    OCZ User Flag of United States
    Join Date
    Sep 2008
    Posts
    21
    Mobo: EVGA 122-CK-NF68 680i
    BIOS: PT 6.00 PG
    CPU: C2D E600
    RAM: Corsair PC206400 4Gig
    Vid: BFG 8800GTX W/C edtion
    PSU: BFG
    HDD: Raptors etc

    Default nia is only a HID device, no drivers needed

    Hey Guys I just got my nia yesterday and I love it so far. I have been able to get 30 kills to 1 death in UT99 using the UT3 easy profile with the bots on easy in one day of playing with it. From reading what everyone on the board said I was thinking it was going to be a long time before I would be able to do anything.

    First I would like to mention that i had a problem with high calibration once but I just unplugged the nia and plugged it back in and it was fine. So that might help some people.

    Secondly I noticed that the nia is a smiple HID device, or Human Interface Device. Just like a mouse or keyboard, or the WiiMote if you connect it through bluetooth, or an even better example would be a USB joystick. What that boils down to is that anyone that knows how to program can pull reports from the nia and as long as they know how to decode the report packet they can use it in their program however they want.

    This is how HID works:
    Every HID device has a report structure for input, output, and feature.
    You can send it a output report, receive an input report, or set a feature.
    All you have to do to get the values of that report is request it, its part of the HID standard.

    So the nia is this:
    VID: 1234
    PID: 0000
    REV: 0001
    Report size (including report id)
    Input: 56 bytes
    Output: 9 bytes
    Feature: 2 bytes
    24-bit biometric sample data array (min-8388608, max:8388607)

    So as you can see you can send it a report request of 9 bytes or feature request of 2. Likewise your report will be 56 bytes. I fired up my handy dandy USB HID IO program and viewed the IO of the nia.

    As soon as you plug in the nia, it starts streaming data to the PC without even having been sent an output report. Just like a USB joystick. Here are some examples of output:
    Code:
    RD 00  88 05 84 87 05 84 AF 03 84 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 38 BD FD FF 69 0C 03 
    RD 00  9E 02 84 3E 03 84 EE 01 84 1E 03 84 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 38 BD FD FF 79 0C 04 
    RD 00  15 FF 83 35 01 84 1D FD 83 3D 01 84 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 38 BD FD FF 89 0C 04 
    RD 00  AC FE 83 04 FF 83 EC FD 83 6D FE 83 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 38 BD FD FF A0 0C 04 
    RD 00  C5 FB 83 B6 FA 83 EE FA 83 D6 FB 83 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 38 BD FD FF B4 0C 04
    If you count it out you will see 56 bytes in each line. RD 00 is the report ID "00". Then there are 12 bytes of data that are constantly changing (likely the data we want) then there are another 29 bytes of data that rarely change then 14 bytes that seem to be timing.

    So what does all this mean you might ask. First you don't need a driver for 64 bit systems or Linux, HID is a standard it doesn't need a driver! I even tested it out I plugged it into my Vista 64bit laptop and fired up USBHIDIO and was able to stream data from the nia just like a 32 bit OS it will be the same for Linux. What we need is the field data for the input stream. If OCZ or whoever would release that then anyone could start to develop stuff for this just like the WiiMote

    I haven't really tried to decode the first 24 bytes into fields yet but I might if I get a chance. So check out this page for more HID info - http://www.lvr.com/hidpage.htm this guy already has the framework for VB.net C# VB6 and C++6. Check out SimpleHIDwrite program that will allow you to stream the data and save it as a text file. As well as lots of info on HID stuff.

    Also does anyone know what the button on the nia is next to the USB connector?

    DG
    Last edited by D3adg0d; 09-22-2008 at 04:32 PM.

  2. #2

    Default

    This may be quite revolutionary stuff you say but I think if that would be so easy to make 64bit drivers that way they'd be already done, hm? But maybe that's the way to make some ind of a temporary drivers that would work with NIA on 64bit OS... I'm gonna try thing with unplugging and plugging NIA to deal with high signal on my laptop (i have 64bit Vista on PC...). And I think there was already something about button on the box on this forum (I'm not sure...) but you have to dig a bit :P

  3. #3
    OCZ User Flag of United States
    Join Date
    Sep 2008
    Posts
    21
    Mobo: EVGA 122-CK-NF68 680i
    BIOS: PT 6.00 PG
    CPU: C2D E600
    RAM: Corsair PC206400 4Gig
    Vid: BFG 8800GTX W/C edtion
    PSU: BFG
    HDD: Raptors etc

    Default

    Ok I went ahead and recorded some output, no specific goal in mind. I think I that the first 12 bytes are divided into 4 groups. I combined the groups and converted it from hex to dec. Then plotted the point in a graph in excel. It seems right but how to read it I still don't know.
    Last edited by D3adg0d; 09-22-2008 at 04:03 PM.

  4. #4

    Default

    Also does anyone know what the button on the nia is next to the USB connector?
    Currently, there is no functionality in that button

  5. #5
    OCZ Convert half-dead's Avatar Flag of France
    Join Date
    Jun 2008
    Posts
    104
    Mobo: Asus P5E @ FSB 1600Mhz
    CPU: e6420 @ 3.2Ghz
    RAM: 4GB OCZ Reaper
    Vid: Ati 3870HD
    PSU: Seasonic M12 500W
    HDD: Window XP Pro SP3

    Default

    Quote Originally Posted by GodGift View Post
    This may be quite revolutionary stuff you say but I think if that would be so easy to make 64bit drivers that way they'd be already done, hm?

    The problems as far as i see it, is that the library the nia currently uses to "bridge" the data coming from the usb and going into the nia.exe, is an old library made with VB.NET 1.0 which isn't compatible with 64bits:

    USB -> hid library (converts all that usb data into usable numbers) -> nia.exe (interprets & uses those numbers to trigger keyboard actions)

    ...so now they have to ditch that hid library in favor of another one (or fix it & make it work in 64bit), & then recode all the bridging (glue) code all over again (hid library <--> nia.exe). Plus any eventual 64bit problems relative to the nia.exe itself ..if there are any.

  6. #6
    OCZ User Flag of United States
    Join Date
    Sep 2008
    Posts
    21
    Mobo: EVGA 122-CK-NF68 680i
    BIOS: PT 6.00 PG
    CPU: C2D E600
    RAM: Corsair PC206400 4Gig
    Vid: BFG 8800GTX W/C edtion
    PSU: BFG
    HDD: Raptors etc

    Default

    half-dead I see what your saying, if that where the case though why can I run SimpleHIDWrite to steam data from the nia in Vista64 just as easy as I can in Vista32? I don't know why they are using HIDlibary.dll that resides in the nia directory instead of the built in windows HID library.

  7. #7
    OCZ Convert half-dead's Avatar Flag of France
    Join Date
    Jun 2008
    Posts
    104
    Mobo: Asus P5E @ FSB 1600Mhz
    CPU: e6420 @ 3.2Ghz
    RAM: 4GB OCZ Reaper
    Vid: Ati 3870HD
    PSU: Seasonic M12 500W
    HDD: Window XP Pro SP3

    Default

    Quote Originally Posted by D3adg0d View Post
    half-dead I see what your saying, if that where the case though why can I run SimpleHIDWrite to steam data from the nia in Vista64 just as easy as I can in Vista32? I don't know why they are using HIDlibary.dll that resides in the nia directory instead of the built in windows HID library.

    Like you said, nia doesn't use drivers properly speaking, since it's just a plain usb device. However just like the site you mentioned provides wrapper libraries (like hidclass) around windows "raw" usb stuff, hidlibrary is also just a wrapper dll around windows usb stuff (to make coding easier) ....unfortunately hidlibrary probably goes boom on 64bit, so ..back to the drawing board!

    In other terms ..the software for the nia is not compatible with 64bit, not really a driver question (but still something that needs time to be fixed).

  8. #8
    OCZ User Flag of United States
    Join Date
    Sep 2008
    Posts
    21
    Mobo: EVGA 122-CK-NF68 680i
    BIOS: PT 6.00 PG
    CPU: C2D E600
    RAM: Corsair PC206400 4Gig
    Vid: BFG 8800GTX W/C edtion
    PSU: BFG
    HDD: Raptors etc

    Default

    Ok I had some spare time at work and wipped up a nia output viewer. I am reading the output of the nia as it is streaming from the nia. I am only reading 4 inputs from the nia because those seem to be the ones that are used for controlling the device. But really I could do all of them.

    If you click the Continuous read check it will stream the data from the nia and display it on the graph, and also display it in the fields below. The steaming can be paused at any point but once unclicked it will jump to the current streaming data from the nia. It doesn't buffer the data. I am working on a discrete fourier transform(DFT/FFT) of the output and see if that helps. Currently have that disabled cause it will cause overflow error every once in a while. Also the big problem is that I don't know how to mix the signals to get a good resolution on my graph. So I am just displaying each signal separately. You guys can play with what I currently have though.

    By the way this worked fine on my two XP machines, but wouldn't work on my Vista32 bit version, I think there is a problem with the timer function in the program or something because it works for about 3 seconds. This did work just fine on my Vista64 system though.


    Click here to download the latest version of the nia reader.
    Last edited by D3adg0d; 09-25-2008 at 04:32 AM.

  9. #9
    OCZ Convert half-dead's Avatar Flag of France
    Join Date
    Jun 2008
    Posts
    104
    Mobo: Asus P5E @ FSB 1600Mhz
    CPU: e6420 @ 3.2Ghz
    RAM: 4GB OCZ Reaper
    Vid: Ati 3870HD
    PSU: Seasonic M12 500W
    HDD: Window XP Pro SP3

    Default

    WTG man

    I hope you manage to make some sense of the nia's output, as id really love to see some ppl making some cute hacks ..like openEEG support


    In this article:
    http://www.lostcircuits.com/advice/ocz_nia/5.shtml
    Unregistered mentions how the original brainfinger device supported decoding 11 channels (alpha/beta/muscle..etc) and how the new hardware (nia) is capable of doing 22. But he also says the feature set was cut back.

    See here for the list of the 11 channels:
    http://www.brainfingers.com/cyberlink.htm

    And currently the nia has:
    Alpha1/2/3, Beta1/2/3 muscle/glance
    ..which kinda looks like 8 channels (maybe 1st 24 bits paired by 3 ..3*8)


    Anyways thanks for taking some time poking around and keeping us informed of your advances

  10. #10
    OCZ Convert half-dead's Avatar Flag of France
    Join Date
    Jun 2008
    Posts
    104
    Mobo: Asus P5E @ FSB 1600Mhz
    CPU: e6420 @ 3.2Ghz
    RAM: 4GB OCZ Reaper
    Vid: Ati 3870HD
    PSU: Seasonic M12 500W
    HDD: Window XP Pro SP3

    Default

    Also with the simplehidwrite program i was able to capture this:

    Code:
    RD 00  69 FA 7F D1 FA 7F 69 FA 7F D1 FA 7F 6A FA 7F D2 FA 7F 6A FA 7F D2 FA 7F 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 38 BD FA FF 22 54 08 
    RD 00  A2 FA 7F BA FA 7F 92 FA 7F C2 FA 7F 72 FA 7F DB FA 7F 73 FA 7F DB FA 7F 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 38 BD FA FF 51 54 08 
    RD 00  73 FA 7F DB FA 7F 73 FA 7F DC FA 7F 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 38 BD FA FF 55 54 04 
    RD 00  74 FA 7F C4 FA 7F 94 FA 7F BC FA 7F A5 FA 7F A5 FA 7F BD FA 7F 95 FA 7F 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 38 BD FA FF 5D 54 08 
    RD 00  C5 FA 7F 76 FA 7F DE FA 7F 76 FA 7F 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 38 BD FA FF 61 54 04 
    RD 00  DE FA 7F 76 FA 7F DE FA 7F 77 FA 7F 97 FA 7F 77 FA 7F C7 FA 7F 97 FA 7F 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 38 BD FA FF 69 54 08 
    RD 00  C0 FA 7F A8 FA 7F A8 FA 7F 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 38 BD FA FF 6C 54 03 
    RD 00  C0 FA 7F 98 FA 7F C9 FA 7F 79 FA 7F E1 FA 7F 79 FA 7F E1 FA 7F 79 FA 7F 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 38 BD FA FF 74 54 08
    This was without the headband (most likely getting a pretty flat signal)

    To me this looks like there are continual suites of:
    XX (some value) FA (barely fluctuates without headband) 7F (barely fluctuates without headband)
    XX (some value) FA (barely fluctuates without headband) 7F (barely fluctuates without headband)
    XX (some value) FA (barely fluctuates without headband) 7F (barely fluctuates without headband)

    like if they where grouped by three into 8 groups.

  11. #11
    OCZ User Flag of United States
    Join Date
    Sep 2008
    Posts
    21
    Mobo: EVGA 122-CK-NF68 680i
    BIOS: PT 6.00 PG
    CPU: C2D E600
    RAM: Corsair PC206400 4Gig
    Vid: BFG 8800GTX W/C edtion
    PSU: BFG
    HDD: Raptors etc

    Default

    Yea I started to figure out some more things last night after I read this post AiboPet talks about breaking down the packet more.

    The "inputs/channels" are broke into 3 parts. Where you see 00 12 7A that really means 0x7A1200 it is little indian style. 0x7A1200 = 8000000 in decimal. So my guess is that is the baseline number for all channels. As you can see from the output packet there are 16 channels 4 or 5 of them are actually used then the rest are timing. That means that you could potentially have 12 more channels into the nia. I need to get a copy of VB for home then I will work on my program some more this weekend see if I can get DFT working good enough. And fix the graph height so that it goes above 10000000.

  12. #12
    OCZ Convert half-dead's Avatar Flag of France
    Join Date
    Jun 2008
    Posts
    104
    Mobo: Asus P5E @ FSB 1600Mhz
    CPU: e6420 @ 3.2Ghz
    RAM: 4GB OCZ Reaper
    Vid: Ati 3870HD
    PSU: Seasonic M12 500W
    HDD: Window XP Pro SP3

    Default

    Grab a copy of VB express
    http://www.microsoft.com/Express/VB/

    Not quite as cool as the full blown TS 2008 version, but still pretty neat for free treats


    The tread you talk about also has a link here:
    http://www.neuroupdate.com/nia/

    which has some excel sheets and screenshots of extrapolating the data acquired using AiboPet's method.
    Last edited by half-dead; 09-19-2008 at 03:48 PM.

  13. #13
    OCZ Convert half-dead's Avatar Flag of France
    Join Date
    Jun 2008
    Posts
    104
    Mobo: Asus P5E @ FSB 1600Mhz
    CPU: e6420 @ 3.2Ghz
    RAM: 4GB OCZ Reaper
    Vid: Ati 3870HD
    PSU: Seasonic M12 500W
    HDD: Window XP Pro SP3

    Default

    Another thing i noticed:

    Code:
    RD 00  A2 FA 7F BA FA 7F 92 FA 7F C2 FA 7F 72 FA 7F DB FA 7F 73 FA 7F DB FA 7F 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 38 BD FA FF 51 54 08 
    RD 00  73 FA 7F DB FA 7F 73 FA 7F DC FA 7F 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 38 BD FA FF 55 54 04 
    RD 00  74 FA 7F C4 FA 7F 94 FA 7F BC FA 7F A5 FA 7F A5 FA 7F BD FA 7F 95 FA 7F 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 38 BD FA FF 5D 54 08 
    RD 00  C5 FA 7F 76 FA 7F DE FA 7F 76 FA 7F 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 38 BD FA FF 61 54 04 
    RD 00  DE FA 7F 76 FA 7F DE FA 7F 77 FA 7F 97 FA 7F 77 FA 7F C7 FA 7F 97 FA 7F 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 38 BD FA FF 69 54 08 
    RD 00  C0 FA 7F A8 FA 7F A8 FA 7F 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 38 BD FA FF 6C 54 03 
    RD 00  C0 FA 7F 98 FA 7F C9 FA 7F 79 FA 7F E1 FA 7F 79 FA 7F E1 FA 7F 79 FA 7F 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 38 BD FA FF 74 54 08 
    RD 00  E2 FA 7F 7A FA 7F E2 FA 7F 7A FA 7F 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 00 12 7A 38 BD FA FF 78 54 04
    is that the data kinda looks interlaced (notice how each other line resembles itself:you ca see it better by looking at the FA/12 suites. 14th byte), and in the screenshot (tho maybe it's just how usblyzer captures data) is that for each (time interval) we have 10 packets for a same timestamp.
    Last edited by half-dead; 09-21-2008 at 04:00 AM.

  14. #14
    OCZ User Flag of United States
    Join Date
    Sep 2008
    Posts
    21
    Mobo: EVGA 122-CK-NF68 680i
    BIOS: PT 6.00 PG
    CPU: C2D E600
    RAM: Corsair PC206400 4Gig
    Vid: BFG 8800GTX W/C edtion
    PSU: BFG
    HDD: Raptors etc

    Default

    Hmm.. Normally I didn't see any data on inputs 4 - 7, but now that I know that they are used I will have to turn them on in my nia output reader.

  15. #15
    OCZ Convert half-dead's Avatar Flag of France
    Join Date
    Jun 2008
    Posts
    104
    Mobo: Asus P5E @ FSB 1600Mhz
    CPU: e6420 @ 3.2Ghz
    RAM: 4GB OCZ Reaper
    Vid: Ati 3870HD
    PSU: Seasonic M12 500W
    HDD: Window XP Pro SP3

    Default

    Did some playing around with excel...

    I think the interlaced packets might be the left/right sensor data. And it seems like the before last 2 bytes are a counters like you stated, where the 1st of the 2 is incremented for every packet, and the 2nd is incremented every 44th packet.

    The very last byte does seem to be a counter to say how many of the bytes actually contain data.

    ..back to digging


    ---
    Maybe they aren't interlaced after all ...it seems that the last byte tell us how much usable data is in the packet, and it continually goes (on average) 8/4 8/4 .. so maybe 2 packets make up 1 full data package, where there are 12 usable data pairs (12*3bytes)

    In any case don't take what i say too by heart, as i know zip about usb or data stuff like this ..i'm just looking at a bunch of stupid numbers and making suppositions


    Whatever the case ..the data in the excel files here:
    http://www.neuroupdate.com/nia/
    look pretty much smack on as far as interpretation of the data goes
    Attached Files
    Last edited by half-dead; 10-02-2008 at 07:57 AM.

+ Reply to Thread
Page 1 of 4 1 2 3 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts