Skip to content

Commit ea167cf

Browse files
committed
fix(alsa): support hw:CARD= without DEV= suffix
1 parent 0efc950 commit ea167cf

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/host/alsa/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,10 +1670,12 @@ fn canonical_pcm_id(pcm_id: &str) -> String {
16701670
Some((c, d)) => (c.trim(), d.trim()),
16711671
None => (rest.trim(), "0"),
16721672
};
1673-
if !card_str.contains('=') {
1674-
if let Ok(device) = device_str.parse::<u32>() {
1675-
return format!("{prefix}:CARD={card_str},DEV={device}");
1673+
if card_str.contains('=') {
1674+
if !rest.contains(',') {
1675+
return format!("{prefix}:{rest},DEV=0");
16761676
}
1677+
} else if let Ok(device) = device_str.parse::<u32>() {
1678+
return format!("{prefix}:CARD={card_str},DEV={device}");
16771679
}
16781680
}
16791681
pcm_id.to_owned()

0 commit comments

Comments
 (0)