Skip to content

Opened HID headset cannot control macOS system speaker volume #438

Open

Description

@yuchunli

Hi, I am using node-hid in my Electron project for headset call control. If my device is not opened by node-hid, then I am able to use the volume up/down physical buttons on the headset to control macOS system output volume. But as my headset is opened by node-hid, the volume up/down buttons are not functioning.

Observations:

  1. The headset volume itself could still be tuned, but system volume cannot be.
  2. Noticed this issue for macOS only, Windows works fine.
  3. It can receive the data/events when volume up/down buttons are pressed

Code snippet I used to reproduce the issue:

const HID = require('node-hid');

const devices = HID.devices();

const supportedDeviceInfo = devices.find(d => {
  return d.usagePage === 0x0b; // Telephony usage page
});

const supportedDevice = new HID.HID(supportedDeviceInfo.path);

supportedDevice.on('data', (data) => {
  console.log(data.join());
});

....

Environments:

Electron: 14.0.0-beta.20
node-hid: 2.1.1
Node: 14.17.1

Activity

  1. todbot commented on Aug 12, 2021

    @todbot
    Contributor

    In general, only one program can access a USB device at a time. I believe hidapi (the C library node-hid is just a wrapper on) enforces this more on Mac than Windows.
    There is an issue on hidapi about this that you may want to weigh-in on: libusb/hidapi#27

  2. mcuee commented on May 6, 2023

    @mcuee
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions