RSDK-13833 Fix orin nano discovery spam#38
Conversation
seanavery
left a comment
There was a problem hiding this comment.
Looking good! Those builtins are super annoying...
Is it reasonable to add test coverage for the routing_filter.cpp helpers? Or would that require a lot of effort to mock?
| int count_output = 0; | ||
|
|
||
| auto is_unrouted = [&](const PaDeviceInfo& info, bool is_input, const char* dir) { | ||
| if (audio::routing::is_unrouted_admaif(info, is_input)) { |
There was a problem hiding this comment.
[question] how long does the is_unrouted_admaif walk over the sound cards take?
There was a problem hiding this comment.
dont have exact timing num, but now with refactor its one scan per discovery pass instead of one per PCM so will be way faster than before
| // actually use. | ||
| constexpr int kMaxSupportedChannels = 2; | ||
|
|
||
| if (info->maxInputChannels > 0 && !is_unrouted(*info, true, "input")) { |
There was a problem hiding this comment.
[question] Should the is_unrouted set be pulled first (just a single time) before the for loop here to avoid duplicating the lookup on each device?
There was a problem hiding this comment.
good call, refactored to scan the cards first, and now is_unrouted just looks up in map
added tests where reasonable |
seanavery
left a comment
There was a problem hiding this comment.
LGTM! Thanks for adding more test coverage
Filter unusable Tegra ADMAIFs in discovery; clamp channels to mono/stereo
On Jetson Orin Nano, discovery surfaced ~40 phantom devices because PortAudio enumerates all 20 ADMAIF DMA endpoints on the Tegra APE card as both speakers and mics, even though most aren't wired to any physical peripheral. They also report num_channels: 16, causing runtime errors bc the module's max is 2 channels.
Fix
Result on Jetson
40 ADMAIF enteries → 4
Reviews
1 reviewer