0x8310 · equalizer
HID++ 耳机的逐频段音频均衡器与麦克风降噪——查询频段数量和增益范围、按可配置的持久化策略读写各频段增益,并切换降噪开关。
HID++ 耳机的逐频段音频均衡器与麦克风降噪功能。getEqInfo(function 0)返回均衡器表的维度信息——band_count(频段数)、增益范围(dB)以及 EqCapabilities 标志位(指示数值以增益还是 DSP 系数形式存储)。getFrequencies(function 1)分页读取每个频段的固定中心频率(Hz),每次响应最多返回七个。getFrequencyGains / setFrequencyGains(function 2–3)读写各频段的有符号增益(dB);setFrequencyGains 接受 GainPersistence 参数,控制新值写入 RAM、EEPROM 或两者。另有两个独立函数(4–5)以单个布尔值读写硬件麦克风降噪开关。
EqInfo——band_count(最多 15 个频段)、db_range/db_min/db_max(增益限制,dB;effective_range()会将"两者均为零则隐含±db_range"的简写解析为具体范围)、capabilities。GainLocation——Eeprom(持久化的自定义均衡器)或Ram(当前生效的均衡器)。GainPersistence——Volatile(仅写 RAM)、VolatileAndNonVolatile(同时写 RAM 与 EEPROM)或NonVolatileOnly(仅写 EEPROM)。
规格: Logitech HID++ 2.0 —— x8310 equalizer。用于:
openlogi-hidpp中的类型化封装。
Function reference
The EqualizerFeature wrapper (0x8310) exposes:
Methods
| Function | HID++ fn | Signature | Returns |
|---|---|---|---|
get_eq_info | 0 | () | EqInfo |
get_frequencies | 1 | (band_count: u8) | Vec<u16> |
get_frequency_gains | 2 | (location: GainLocation, band_count: u8) | Vec<i8> |
set_frequency_gains | 3 | (persistence: GainPersistence, gains: &[i8]) | Vec<i8> |
get_mic_noise_reduction | 4 | () | bool |
set_mic_noise_reduction | 5 | (enabled: bool) | () |
All methods are async and return Result<…, Hidpp20Error>.
Types
EqInfo
EQ table information returned by get_eq_info.
| Field | Type | Description |
|---|---|---|
band_count | u8 | Number of frequency bands. |
db_range | u8 | Gain range in dB; used as ±db_range when db_min/db_max are both 0. |
capabilities | EqCapabilities | How EQ values are stored. |
db_min | i8 | Minimum gain in dB, or 0 to imply -db_range. |
db_max | i8 | Maximum gain in dB, or 0 to imply +db_range. |
Method: effective_range(&self) -> (i8, i8) — resolves the "both-zero implies ±db_range" shorthand into concrete (min, max) bounds.
EqCapabilities
Bitflags indicating how a device stores its EQ values, from get_eq_info.
| Flag | Bit/Value | Description |
|---|---|---|
STORED_AS_GAINS | 0x01 | EQ values are stored as gains. |
STORED_AS_COEFFICIENTS | 0x02 | EQ values are stored as coefficients. |
GainLocation
Selects which copy of the EQ gains get_frequency_gains reads from.
| Variant | Value | Description |
|---|---|---|
Eeprom | 0 | The custom EQ stored in EEPROM (the version-0 default). |
Ram | 1 | The active EQ in RAM. |
GainPersistence
Controls how set_frequency_gains persists the new gains.
| Variant | Value | Description |
|---|---|---|
Volatile | 0 | Applied to RAM only. |
VolatileAndNonVolatile | 1 | Applied to RAM and stored in EEPROM. |
NonVolatileOnly | 2 | Stored in EEPROM only. |
Wire format
Simple getters carry a 3-byte request payload (all zeroes except where noted); set_frequency_gains uses a 16-byte long request. All responses are read from the 16-byte extended payload.
get_eq_info (fn 0)
Request: [0x00, 0x00, 0x00]
Response (byte → field):
| Byte | Field | Notes |
|---|---|---|
| 0 | band_count | Number of frequency bands. |
| 1 | db_range | Symmetric gain range in dB when db_min/db_max are both 0. |
| 2 | capabilities | EqCapabilities bitflags: bit 0 = STORED_AS_GAINS, bit 1 = STORED_AS_COEFFICIENTS. |
| 3 | db_min | Minimum gain (signed i8), or 0 to imply -db_range. |
| 4 | db_max | Maximum gain (signed i8), or 0 to imply +db_range. |
get_frequencies (fn 1)
Paged: the wrapper issues one request per page of up to 7 bands until all band_count frequencies are collected.
Request: [start_index, 0x00, 0x00]
| Byte | Field | Notes |
|---|---|---|
| 0 | start_index | Index of the first band on this page. |
Response (byte → field):
| Byte | Field | Notes |
|---|---|---|
| 0 | echoed start_index | Validated by the wrapper; returns UnsupportedResponse on mismatch. |
| 1–2 | frequency[0] | Big-endian u16, Hz. |
| 3–4 | frequency[1] | Big-endian u16, Hz. |
| … | … | Up to 7 frequencies per page (bytes 1–14). |
get_frequency_gains (fn 2)
Request: [location, 0x00, 0x00]
| Byte | Field | Notes |
|---|---|---|
| 0 | location | GainLocation as u8: 0 = Eeprom, 1 = Ram. |
Response (byte → field):
| Byte | Field | Notes |
|---|---|---|
| 0–N | gains | One signed i8 per band (cast from raw byte), up to band_count bytes. |
set_frequency_gains (fn 3)
Uses call_long — a 16-byte request payload.
Request: [persistence, gain[0], gain[1], …, gain[14]]
| Byte | Field | Notes |
|---|---|---|
| 0 | persistence | GainPersistence as u8: 0=Volatile, 1=VolatileAndNonVolatile, 2=NonVolatileOnly. |
| 1–15 | gains | Each gain cast from i8 to u8; up to 15 bands. |
Response (byte → field):
| Byte | Field | Notes |
|---|---|---|
| 0 | echoed persistence | Skipped by the wrapper. |
| 1–N | echoed gains | Parsed as signed i8; returned as Vec<i8>. |
get_mic_noise_reduction (fn 4)
Request: [0x00, 0x00, 0x00]
Response (byte → field):
| Byte | Field | Notes |
|---|---|---|
| 0 | enabled | Non-zero = enabled; zero = disabled. Returned as bool. |
set_mic_noise_reduction (fn 5)
Request: [enabled, 0x00, 0x00]
| Byte | Field | Notes |
|---|---|---|
| 0 | enabled | 1 = enable, 0 = disable. |
Response is ignored.
Usage (Rust)
use hidpp::{device::Device, feature::equalizer::{EqualizerFeature, GainLocation, GainPersistence}};
// device: &mut Device, already created via Device::new(channel, index)
device.enumerate_features().await?;
if let Some(feat) = device.get_feature::<EqualizerFeature>() {
// Query EQ table dimensions.
let info = feat.get_eq_info().await?;
let (min_db, max_db) = info.effective_range();
// Read centre frequencies of all bands.
let freqs = feat.get_frequencies(info.band_count).await?;
// Read the currently active gains from RAM.
let gains = feat.get_frequency_gains(GainLocation::Ram, info.band_count).await?;
// Apply a flat EQ to RAM (volatile, no EEPROM write).
let flat: Vec<i8> = vec![0i8; usize::from(info.band_count)];
let echoed = feat.set_frequency_gains(GainPersistence::Volatile, &flat).await?;
// Toggle microphone noise reduction.
let nr_on = feat.get_mic_noise_reduction().await?;
feat.set_mic_noise_reduction(!nr_on).await?;
}