Skip to content

Commit 4dd0a5d

Browse files
committed
Add a note regarding plughw
1 parent fc1549f commit 4dd0a5d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/host/alsa/enumerate.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,14 @@ impl Iterator for Devices {
5858
continue;
5959
};
6060

61-
let pcm_id = format!("plughw:{}", card.get_index());
61+
// Using plughw adds the ALSA plug layer, which can do sample type conversion,
62+
// sample rate convertion, ...
63+
// It is convenient, but at the same time not suitable for pro-audio as it hides
64+
// the actual device capabilities and perform audio manipulation under your feet,
65+
// for example sample rate conversion, sample format conversion, adds dummy channels,
66+
// ...
67+
const USE_PLUGHW : bool = false;
68+
let pcm_id = if USE_PLUGHW { format!("plughw:{}", card.get_index()) } else { ctl_id };
6269
if let Ok(handles) = DeviceHandles::open(&pcm_id) {
6370
return Some(Device {
6471
name: card_name.to_string(),

0 commit comments

Comments
 (0)