Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **Linux/BSD**: Default host in order from first to last available now is: PipeWire, PulseAudio,
ALSA.
- **WASAPI**: Timestamps now include hardware pipeline latency.
- **WASAPI**: `FriendlyName` is now preferred as device name over `DeviceDesc`.
- **WebAudio**: Bump MSRV to 1.85.
- **WebAudio**: Timestamps now include base and output latency.
- **WebAudio**: Initial buffer scheduling offset now scales with buffer duration.
Expand Down
25 changes: 9 additions & 16 deletions src/host/wasapi/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,15 +371,15 @@ impl Device {
&PKEY_AUDIOENDPOINT_JACKSUBTYPE as *const _ as *const _,
);

// Prefer DeviceDesc for name, fall back to FriendlyName
let name = device_desc
.clone()
.or(friendly_name.clone())
.ok_or_else(|| DeviceNameError::BackendSpecific {
err: BackendSpecificError {
description: "failed to retrieve device name".to_string(),
},
})?;
// Prefer FriendlyName for name (e.g., "Speakers (XYZ Audio Adapter)"), fall back to DeviceDesc
let name =
friendly_name
.or(device_desc)
.ok_or_else(|| DeviceNameError::BackendSpecific {
err: BackendSpecificError {
description: "failed to retrieve device name".to_string(),
},
})?;

// Get direction from data flow (eCapture = Input, eRender = Output)
let direction = self.data_flow().into();
Expand Down Expand Up @@ -416,13 +416,6 @@ impl Device {
builder = builder.driver(iface_name);
}

// Add FriendlyName to extended if different from the name we used
if let Some(fname) = friendly_name {
if device_desc.is_some() && Some(&fname) != device_desc.as_ref() {
builder = builder.add_extended_line(fname);
}
}

Ok(builder.build())
}
}
Expand Down
Loading