alsa-project / alsa-lib

The Advanced Linux Sound Architecture (ALSA) - library
GNU Lesser General Public License v2.1
345 stars 176 forks source link

how to query the hw_params of an ALSA device opened by a different process ? #302

Closed flatmax closed 1 year ago

flatmax commented 1 year ago

I have the situation where one program has hw:0,0 open. I have a different program (executable) which wants to know the hw_params of hw:0,0 from C/C++.

I can't open the same device a second time to be able to query the hw_param. I am aware I can query the /proc filesysetm, however I would prefer a method for doing that in an executable using alsa-lib.

Is it possible to query the hw_params of a device opened by a different program ?

perexg commented 1 year ago

Unfortunately, it's not possible. You can only check, if a device is busy. There are other methods to share this information between tasks (shared buffer, sockets etc.).