Skip to content

Potential issues with NetBSD uhid backend #797

Open

Description

@mcuee

From the testing results here NetBSD uhid example does not work for me with the FX2HID example even if I force it to full speed USB mode.

Activity

  1. added
    bsd
    on Apr 26, 2026
  2. mcuee commented on Apr 26, 2026

    @mcuee
    MemberAuthor
    1. Bulding hidapi under NetBSD with the uhid backend is okay
    netbsdvm$ cmake .. -D HIDAPI_BUILD_HIDTEST=1  -D CMAKE_C_FLAGS=-I/usr/pkg/include -D CMAKE_EXE_LINKER_FLAGS=-R/usr/pkg/lib -DCMAKE_INSTALL_PREFIX=/usr/pkg
    -- The C compiler identification is GNU 10.5.0
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: /usr/bin/cc - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- hidapi: v0.16.0
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Found Threads: TRUE
    -- Performing Test HIDAPI_ICONV_CONST
    -- Performing Test HIDAPI_ICONV_CONST - Failed
    -- Found PkgConfig: /usr/pkg/bin/pkg-config (found version "2.4.3")
    -- Checking for module 'libusb-1.0>=1.0.9'
    --   Found libusb-1.0, version 1.0.29
    -- Check for Iconv
    -- Performing Test Iconv_IS_BUILT_IN
    -- Performing Test Iconv_IS_BUILT_IN - Success
    -- Found Iconv: built in to C library
    -- Building hidtest
    -- Configuring done (5.3s)
    -- Generating done (0.3s)
    -- Build files have been written to: /home/mcuee/build/hidapi/build_cmake
    netbsdvm$ make
    [ 16%] Building C object src/netbsd/CMakeFiles/hidapi_netbsd.dir/hid.c.o
    [ 33%] Linking C shared library libhidapi-netbsd.so
    [ 33%] Built target hidapi_netbsd
    [ 50%] Building C object src/libusb/CMakeFiles/hidapi_libusb.dir/hid.c.o
    [ 66%] Linking C shared library libhidapi-libusb.so
    [ 66%] Built target hidapi_libusb
    [ 83%] Building C object hidtest/CMakeFiles/hidtest.dir/test.c.o
    [100%] Linking C executable hidtest
    [100%] Built target hidtest
    netbsdvm$ sudo make install
    Password:
    [ 33%] Built target hidapi_netbsd
    [ 66%] Built target hidapi_libusb
    [100%] Built target hidtest
    Install the project...
    -- Install configuration: "Release"
    -- Installing: /usr/pkg/lib/libhidapi-netbsd.so.0.16.0
    -- Up-to-date: /usr/pkg/lib/libhidapi-netbsd.so.0
    -- Up-to-date: /usr/pkg/lib/libhidapi-netbsd.so
    -- Up-to-date: /usr/pkg/include/hidapi/hidapi.h
    -- Installing: /usr/pkg/lib/pkgconfig/hidapi-netbsd.pc
    -- Installing: /usr/pkg/lib/libhidapi-libusb.so.0.16.0
    -- Up-to-date: /usr/pkg/lib/libhidapi-libusb.so.0
    -- Set non-toolchain portion of runtime path of "/usr/pkg/lib/libhidapi-libusb.so.0.16.0" to ""
    -- Up-to-date: /usr/pkg/lib/libhidapi-libusb.so
    -- Up-to-date: /usr/pkg/include/hidapi/hidapi.h
    -- Up-to-date: /usr/pkg/include/hidapi/hidapi_libusb.h
    -- Installing: /usr/pkg/lib/pkgconfig/hidapi-libusb.pc
    -- Installing: /usr/pkg/lib/cmake/hidapi/libhidapi.cmake
    -- Installing: /usr/pkg/lib/cmake/hidapi/libhidapi-release.cmake
    -- Installing: /usr/pkg/lib/cmake/hidapi/hidapi-config-version.cmake
    -- Installing: /usr/pkg/lib/cmake/hidapi/hidapi-config.cmake
    -- Installing: /usr/pkg/bin/hidtest
    -- Set non-toolchain portion of runtime path of "/usr/pkg/bin/hidtest" to ""
    
    netbsdvm$ sudo /usr/pkg/bin/hidtest
    hidapi test/example tool. Compiled with hidapi version 0.16.0, runtime version 0.16.0.
    Compile-time version matches runtime version of hidapi.
    
    Device Found
      type: 0925 1234
      path: uhidev1
      serial_number:
      Manufacturer: CYPRESS
      Product:      EZ-USB FX2 HID USBHIDIO
      Release:      0
      Interface:    -1
      Usage (page): 0x1 (0xffa0)
      Bus type: 1 (USB)
    
      Report Descriptor: (52 bytes)
    0x06, 0xa0, 0xff, 0x09, 0x01, 0xa1, 0x01, 0x09, 0x02, 0xa1,
    0x00, 0x06, 0xa1, 0xff, 0x09, 0x03, 0x09, 0x04, 0x15, 0x80,
    0x25, 0x7f, 0x35, 0x00, 0x45, 0xff, 0x75, 0x08, 0x95, 0x80,
    0x81, 0x02, 0x09, 0x05, 0x09, 0x06, 0x15, 0x80, 0x25, 0x7f,
    0x35, 0x00, 0x45, 0xff, 0x75, 0x08, 0x95, 0x80, 0x91, 0x02,
    0xc0, 0xc0,
    unable to open device
    
  3. mcuee commented on Apr 26, 2026

    @mcuee
    MemberAuthor
    1. building hidapitester using Makefile does not work, but using CMake works.
    netbsdvm$ mkdir build
    netbsdvm$ cd build/
    netbsdvm$ cmake ..
    -- The C compiler identification is GNU 10.5.0
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: /usr/bin/cc - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- hidapitester version: v0.5
    -- Using local HIDAPI from: /home/mcuee/build/hidapitester/../hidapi
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Found Threads: TRUE
    -- Performing Test HIDAPI_ICONV_CONST
    -- Performing Test HIDAPI_ICONV_CONST - Failed
    -- Found PkgConfig: /usr/pkg/bin/pkg-config (found version "2.4.3")
    -- Checking for module 'libusb-1.0>=1.0.9'
    --   Found libusb-1.0, version 1.0.29
    -- Check for Iconv
    -- Performing Test Iconv_IS_BUILT_IN
    -- Performing Test Iconv_IS_BUILT_IN - Success
    -- Found Iconv: built in to C library
    -- Configuring done (1.8s)
    -- Generating done (0.2s)
    -- Build files have been written to: /home/mcuee/build/hidapitester/build
    netbsdvm$ make
    [ 25%] Building C object hidapi/src/netbsd/CMakeFiles/hidapi_netbsd.dir/hid.c.o
    [ 50%] Linking C static library libhidapi-netbsd.a
    [ 50%] Built target hidapi_netbsd
    [ 75%] Building C object CMakeFiles/hidapitester.dir/hidapitester.c.o
    [100%] Linking C executable hidapitester
    [100%] Built target hidapitester
    
    
    
    
  4. mcuee commented on Apr 26, 2026

    @mcuee
    MemberAuthor

    However, it does not seem to work with the FX2HID example.

    Using the original FX2HID example from Jan Axelson.
    http://janaxelson.com/hidpage.htm

    1. Under Windows, it works fine.
    PS C:\work\libusb\hidapitester> .\hidapitester_git_winapi.exe --vidpid 0925:1234 --open --buflen 64 -l 3 --send-output 0,1,2  --read-input
    Opening device, vid/pid: 0x0925/0x1234
    Writing output report of 3-bytes...wrote 3 bytes:
     00 01 02
    Reading up to 3-byte input report, 250 msec timeout...read 2 bytes:
     01 02 00
    Closing device
    
    1. Under NetBSD, it does not seem to work.
    netbsdvm$ sudo ./hidapitester  --vidpid 0925:1234 --open --buflen 64 -l 3 --send-output 0,1,2  --read-input
    Opening device, vid/pid: 0x0925/0x1234
    Writing output report of 3-bytes...wrote -1 bytes:
     00 01 02
    Reading up to 3-byte input report, 250 msec timeout...read 0 bytes:
    Closing device
    
    netbsdvm$ sudo ./hidapitester  --vidpid 0925:1234 --open --buflen 64 -l 2 --send-output 1,2  --read-input
    Opening device, vid/pid: 0x0925/0x1234
    Writing output report of 2-bytes...wrote -1 bytes:
     01 02
    Reading up to 2-byte input report, 250 msec timeout...read 0 bytes:
    Closing device
    
    1. Unfortunately even forcing the device to enumerate as a full speed USB device does not work. That was the issues with PR Add hidraw backend for FreeBSD #730 under FreeBSD.
    PS C:\Program Files\Oracle\VirtualBox> .\VBoxManage modifyvm "netbsd101vm" --usb-ohci on --usb-ehci off --usb-xhci off
    

    Run log with the FX2HID default example with two bytes HID Input/Output report.

    [mcuee@netbsdvm hidapitester]$ uname -a
    NetBSD netbsdvm 10.1 NetBSD 10.1 (GENERIC) #0: Mon Dec 16 13:08:11 UTC 2024  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
    
    [mcuee@netbsdvm hidapitester]$ sudo ./hidapitester --list
    0925/1234: CYPRESS - EZ-USB FX2 HID USBHIDIO
    [mcuee@netbsdvm hidapitester]$ sudo ./hidapitester  --vidpid 0925:1234 --list-detail
    0925/1234: CYPRESS - EZ-USB FX2 HID USBHIDIO
      vendorId:      0x0925
      productId:     0x1234
      usagePage:     0xFFA0
      usage:         0x0001
      serial_number:
      interface:     -1
      path: uhidev1
    
    [mcuee@netbsdvm hidapitester]$ sudo ./hidapitester  --vidpid 0925:1234 --open --buflen 64 -l 3 --send-output 0,1,2  --read-input
    Opening device, vid/pid: 0x0925/0x1234
    Writing output report of 3-bytes...wrote -1 bytes:
     00 01 02
    Reading up to 3-byte input report, 250 msec timeout...read 0 bytes:
    Closing device
    
    [mcuee@netbsdvm hidapitester]$ sudo usbdevs
    addr 1: OHCI root hub, NetBSD
     addr 2: USB Tablet, VirtualBox
     addr 3: product 1234, vendor 0925
    
    [mcuee@netbsdvm hidapitester]$ sudo usbdevs -v
    Controller /dev/usb0:
    addr 1: full speed, self powered, config 1, OHCI root hub(0x0000), NetBSD(0x0000), rev 1.00(0x0100)
     port 1 addr 2: full speed, power 100 mA, config 1, USB Tablet(0x0021), VirtualBox(0x80ee), rev 1.00(0x0100)
     port 2 addr 3: full speed, power 80 mA, config 1, product 1234(0x1234), vendor 0925(0x0925), rev 0.00(0x0000)
     port 3 powered
     port 4 powered
     port 5 powered
     port 6 powered
     port 7 powered
     port 8 powered
     port 9 powered
     port 10 powered
     port 11 powered
     port 12 powered
    
  5. mcuee commented on Apr 26, 2026

    @mcuee
    MemberAuthor

    I will test with a physical machine and another generic USB HID device.

  6. mcuee commented on Apr 27, 2026

    @mcuee
    MemberAuthor

    Still using VM but changes to another Generic USB HID device mentioned here. The device works fine under FreeBSD 15 VM using PR #730.

    Feature Report loopback is working fine but Input/Output loopback does not work under NetBSD 10.1 VM.

    netbsdvm$ sudo ./hidapitester --vidpid 0925:7001 --open --buflen 64 -l 3 --send-output 2,5,6  --read-input
    Opening device, vid/pid: 0x0925/0x7001
    Writing output report of 3-bytes...wrote 3 bytes:
     02 05 06
    Reading up to 3-byte input report, 250 msec timeout...read 0 bytes:
    Closing device
    
    netbsdvm$ sudo ./hidapitester --vidpid 0925:7001 --open --buflen 64 -l 3 --send-output 2,5,6  --read-input
    Opening device, vid/pid: 0x0925/0x7001
    Writing output report of 3-bytes...wrote 3 bytes:
     02 05 06
    Reading up to 3-byte input report, 250 msec timeout...read 0 bytes:
    Closing device
    
    netbsdvm$ sudo ./hidapitester --vidpid 0925:7001 --open --buflen 64 -l 3 --send-feature 3,5,6  --read-feature 4
    Opening device, vid/pid: 0x0925/0x7001
    Writing 3-byte feature report...wrote 3 bytes:
     03 05 06
    Reading 3-byte feature report, report_id 4...read 3 bytes:
     04 05 06
    Closing device
    
    netbsdvm$ sudo ./hidapitester --vidpid 0925:7001 --open --buflen 64 -l 3 --send-feature 3,5,6  --read-feature 4
    Opening device, vid/pid: 0x0925/0x7001
    Writing 3-byte feature report...wrote 3 bytes:
     03 05 06
    Reading 3-byte feature report, report_id 4...read 3 bytes:
     04 05 06
    
  7. mcuee commented on May 1, 2026

    @mcuee
    MemberAuthor

    Still using VirtualBox VM.

    CircuitPython USB HID example from here, using Raspberry Pi Pico 2 (loop back the contents of Output Report 2 to Input Report 1, other than the first byte which is the Report ID).
    #590 (comment)

    It is mostly working except for the last case -- somehow Input Report ID 1 is missing.

    [mcuee@netbsdvm build]$ sudo ./hidapitester --usagePage 0xff00 --usage 1 --open -l 64 --send-output 2,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63 --timeout 2000 --read-input 1
    Opening device, vid/pid:0x0000/0x0000, usagePage/usage: FF00/1
    Device opened
    Writing output report of 64-bytes...wrote 64 bytes:
     02 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
     20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
    Reading up to 64-byte input report, 2000 msec timeout...read 63 bytes:
     01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20
     21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 00
    Closing device
    
    [mcuee@netbsdvm build]$ sudo ./hidapitester --usagePage 0xff00 --usage 1 --open -l 64 --send-output 2,1,2,3,4,5,6,7 --timeout 2000 --read-input 1
    Opening device, vid/pid:0x0000/0x0000, usagePage/usage: FF00/1
    Device opened
    Writing output report of 64-bytes...wrote 64 bytes:
     02 01 02 03 04 05 06 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    Reading up to 64-byte input report, 2000 msec timeout...read 63 bytes:
     01 02 03 04 05 06 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    Closing device
    
    [mcuee@netbsdvm build]$ sudo ./hidapitester  --usagePage 0xff00 --usage 1 --open -l 64 --send-output 2,3,4,5 --timeout 1000 --read-input 1
    Opening device, vid/pid:0x0000/0x0000, usagePage/usage: FF00/1
    Device opened
    Writing output report of 64-bytes...wrote 64 bytes:
     02 03 04 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    Reading up to 64-byte input report, 1000 msec timeout...read 63 bytes:
     03 04 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    Closing device
    
  8. mcuee commented on May 2, 2026

    @mcuee
    MemberAuthor

    Using a physical machine, Intel N4200 CPU based mini PC

    CircuitPython USB HID example from here, using Raspberry Pi Pico 2 (loop back the contents of Output Report 2 to Input Report 1, other than the first byte which is the Report ID).

    Interestingly it work for the odd time but failed for the even time.

    [mcuee@netbsd10n4200 build]$ uname -a
    NetBSD netbsd10n4200.localdomain 10.1 NetBSD 10.1 (GENERIC) #0: Mon Dec 16 13:08:11 UTC 2024  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
    
    [mcuee@netbsd10n4200 build]$ gcc -v
    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/libexec/lto-wrapper
    Target: x86_64--netbsd
    Configured with: /usr/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=x86_64--netbsd --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/support/send-pr.html --with-pkgversion='NetBSD nb2 20230710' --with-system-zlib --without-isl --enable-__cxa_atexit --enable-libstdcxx-time=rt --enable-libstdcxx-threads --with-diagnostics-color=auto-if-env --with-tune=nocona --with-default-libstdcxx-abi=new --with-mpc-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/amd64-x86_64/usr/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/src/external/lgpl3/gmp/lib/libgmp/arch/x86_64 --enable-tls --disable-multilib --disable-libstdcxx-pch --build=x86_64--netbsd --host=x86_64--netbsd --with-sysroot=/var/obj/mknative/amd64-x86_64/usr/src/destdir.amd64
    Thread model: posix
    Supported LTO compression algorithms: zlib
    gcc version 10.5.0 (nb3 20231008) 
    
    
    [mcuee@netbsd10n4200 build]$ sudo ./hidapitester --usagePage 0xff00 --usage 1 --open -l 64 --send-output 2,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63 --timeout 2000 --read-input 1
    Opening device, vid/pid:0x0000/0x0000, usagePage/usage: FF00/1
    Device opened
    Writing output report of 64-bytes...wrote 64 bytes:
     02 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
     20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
    Reading up to 64-byte input report, 2000 msec timeout...read 63 bytes:
     01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20
     21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 00
    Closing device
    
    [mcuee@netbsd10n4200 build]$ sudo ./hidapitester --usagePage 0xff00 --usage 1 --open -l 64 --send-output 2,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63 --timeout 2000 --read-input 1
    Opening device, vid/pid:0x0000/0x0000, usagePage/usage: FF00/1
    Device opened
    Writing output report of 64-bytes...wrote 64 bytes:
     02 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
     20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
    Reading up to 64-byte input report, 2000 msec timeout...read 0 bytes:
    Closing device
    
    [mcuee@netbsd10n4200 build]$ sudo ./hidapitester --usagePage 0xff00 --usage 1 --open -l 64 --send-output 2,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63 --timeout 2000 --read-input 1
    Opening device, vid/pid:0x0000/0x0000, usagePage/usage: FF00/1
    Device opened
    Writing output report of 64-bytes...wrote 64 bytes:
     02 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
     20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
    Reading up to 64-byte input report, 2000 msec timeout...read 63 bytes:
     01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20
     21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 00
    Closing device
    
    [mcuee@netbsd10n4200 build]$ sudo ./hidapitester --usagePage 0xff00 --usage 1 --open -l 64 --send-output 2,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63 --timeout 2000 --read-input 1
    Opening device, vid/pid:0x0000/0x0000, usagePage/usage: FF00/1
    Device opened
    Writing output report of 64-bytes...wrote 64 bytes:
     02 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
     20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
    Reading up to 64-byte input report, 2000 msec timeout...read 0 bytes:
    Closing device
    
    [mcuee@netbsd10n4200 build]$ sudo ./hidapitester --usagePage 0xff00 --usage 1 --open -l 64 --send-output 2,1,2,3,4,5,6,7 --timeout 2000 --read-input 1
    Opening device, vid/pid:0x0000/0x0000, usagePage/usage: FF00/1
    Device opened
    Writing output report of 64-bytes...wrote 64 bytes:
     02 01 02 03 04 05 06 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    Reading up to 64-byte input report, 2000 msec timeout...read 63 bytes:
     01 02 03 04 05 06 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    Closing device
    
    [mcuee@netbsd10n4200 build]$ sudo ./hidapitester --usagePage 0xff00 --usage 1 --open -l 64 --send-output 2,1,2,3,4,5,6,7 --timeout 2000 --read-input 1
    Opening device, vid/pid:0x0000/0x0000, usagePage/usage: FF00/1
    Device opened
    Writing output report of 64-bytes...wrote 64 bytes:
     02 01 02 03 04 05 06 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    Reading up to 64-byte input report, 2000 msec timeout...read 0 bytes:
    Closing device
    
    [mcuee@netbsd10n4200 build]$ sudo ./hidapitester --usagePage 0xff00 --usage 1 --open -l 64 --send-output 2,1,2,3,4,5,6,7 --timeout 2000 --read-input 1
    Opening device, vid/pid:0x0000/0x0000, usagePage/usage: FF00/1
    Device opened
    Writing output report of 64-bytes...wrote 64 bytes:
     02 01 02 03 04 05 06 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    Reading up to 64-byte input report, 2000 msec timeout...read 63 bytes:
     01 02 03 04 05 06 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    Closing device
    
    [mcuee@netbsd10n4200 build]$ sudo ./hidapitester --usagePage 0xff00 --usage 1 --open -l 64 --send-output 2,1,2,3,4,5,6,7 --timeout 2000 --read-input 1
    Opening device, vid/pid:0x0000/0x0000, usagePage/usage: FF00/1
    Device opened
    Writing output report of 64-bytes...wrote 64 bytes:
     02 01 02 03 04 05 06 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    Reading up to 64-byte input report, 2000 msec timeout...read 0 bytes:
    Closing device
    
  9. mcuee commented on May 2, 2026

    @mcuee
    MemberAuthor

    Still using VM but changes to another Generic USB HID device mentioned here. The device works fine under FreeBSD 15 VM using PR #730.

    * [Add hidraw backend for FreeBSD #730 (comment)](https://github.com/libusb/hidapi/pull/730#issuecomment-4327993991)
    

    Feature Report loopback is working fine but Input/Output loopback does not work under NetBSD 10.1 VM.

    Same for the physical machine.

    [mcuee@netbsd10n4200 build]$ sudo ./hidapitester --vidpid 0925:7001 --open --buflen 64 -l 3 --send-output 2,5,6  --read-input
    Opening device, vid/pid: 0x0925/0x7001
    Writing output report of 3-bytes...wrote 3 bytes:
     02 05 06
    Reading up to 3-byte input report, 250 msec timeout...read 0 bytes:
    Closing device
    
    [mcuee@netbsd10n4200 build]$ sudo ./hidapitester --vidpid 0925:7001 --open --buflen 64 -l 3 --send-output 2,5,6  --read-input
    Opening device, vid/pid: 0x0925/0x7001
    Writing output report of 3-bytes...wrote 3 bytes:
     02 05 06
    Reading up to 3-byte input report, 250 msec timeout...read 0 bytes:
    Closing device
    
    [mcuee@netbsd10n4200 build]$ sudo ./hidapitester --vidpid 0925:7001 --open --buflen 64 -l 3 --send-feature 3,5,6  --read-feature 4
    Opening device, vid/pid: 0x0925/0x7001
    Writing 3-byte feature report...wrote 3 bytes:
     03 05 06
    Reading 3-byte feature report, report_id 4...read 3 bytes:
     04 05 06
    Closing device
    
    [mcuee@netbsd10n4200 build]$ sudo ./hidapitester --vidpid 0925:7001 --open --buflen 64 -l 3 --send-feature 3,5,6  --read-feature 4
    Opening device, vid/pid: 0x0925/0x7001
    Writing 3-byte feature report...wrote 3 bytes:
     03 05 06
    Reading 3-byte feature report, report_id 4...read 3 bytes:
     04 05 06
    Closing device
    
    
  10. deleted a comment from on May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bsd

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions