Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The definition of "monitor" is a very big variable here. Monitor could mean "record to disk", "detect volume levels above a particular threshold" or "perform higher level analysis in the frequency domain (i.e. conventional signal processing)." These three have very different implications for CPU usage and the feasibility of Python. Python may not be the best fit depending on what you want to do.</p> <p>If you go with Python, I'll note the following:</p> <ul> <li>Python's audio support is very weak</li> <li>The python ALSA bindings (pyalsa) are for sequencer, mixer and hardware control, not reading PCM samples (though the bindings might be helpful for managing the devices)</li> <li>Python has issues in certain multi-threaded conditions (cf. the GIL — the Global Interpreter Lock) which can be avoided entirely by having separate Python processes but this is not desirable in all cases either (I'm presuming that you are running on a multi-core/processor system and want to divide the load of monitoring the 20 audio inputs across the CPUs).</li> <li>CPU and memory intense operations such as one would expect in audio analysis is not Python's strong suit. Having said that, PCM data could be unpacked via struct.unpack() and signal analysis could be done with routines found in NumPy and SciPy.</li> </ul> <p>Each line input and mic should be stereoscopic, effectively providing two mic inputs each, that's four mic's per sound card. Assuming just 20 inputs that means five USB audio adapters. BTW, to use line-in you'll need some sort of mic pre-amp which might be more pricey than you'd want. In that case, you would need 10 USB audio adapters for 20 inputs.</p> <p>I would caution that most low-end hubs will probably not be able to handle the traffic for 5-10 audio adapters. For that matter, I'd be sure that you had a USB 2.0 Highspeed hub (even if the actual audio devices are USB 1.1 full-speed or slower) to be sure you have enough upstream bandwidth. If you have the option, it is not hard to get PCI USB adapter cards with 4 or 5 external USB ports. BTW, the USB device you show only has stereo-out and mic-in (no line-in).</p> <p>BTW, ideally you'd use USB isochronous transfer mode to have low latency and consistent delivery but I doubt that the ALSA drivers support it.</p> <p>Regarding the logical to physical mapping of USB sound cards, a set of udev rules would allow you to give a useful and consistent device naming scheme based on the USB heirarchy or, if you wanted, serial numbers (if the devices have them) or other attributes. In any case, you should be able to use udev rules to stabilize the mapping of audio devices by their identity or their physical location (as you choose).</p> <p>I know nothing about pyUSB but do see that it supports isochronous transfer mode. At a glance pyUSB would allow for very precise control but I suspect you'll do way more coding that you set out to do (you'd basically need to implement the better parts of a USB audio class driver in Python).</p> <p>Hope that helps!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload