Closed abique closed 1 month ago
Apparently this flag is call SND_PCM_APPEND in alsa-lib. Never heard of it before.
Could you either ask the ALSA people to document it, or maybe give an explanation of how it works and what you can and can't do if this flag is enabled? I'd rather support it properly than just allow undocumented flags.
This is useful for scanning device capabilities even if the devices is busy.
Even if you don't document it, you could allow an arbitrary int for the flags.
This is useful for scanning device capabilities even if the devices is busy.
So what things can you not do if this flag is set? Can you still set hwparams? Start a direct mmap transfer? Start/stop the stream? Etc etc.
Being able to open more than one PCM object to the same device could cause unsafety or undefined behaviour if not done correctly.
Even if you don't document it, you could allow an arbitrary int for the flags.
As some kind of fallback I could potentially allow unsafe fn PCM::from_handle(*mut snd_pcm_t)
, I guess, then you could call snd_pcm_open
yourself and then use alsa-rs for the rest, but as I said, one of the main things these bindings provide is safety, and I'm hesitant to risk that.
You can have a method 'open_forscanning()' which will prevent starting and stopping the stream and every `set*()`.
You could also have a method that just collects the PCM capabilities.
You can have a method 'open_forscanning()' which will prevent starting and stopping the stream and every set*(). You could also have a method that just collects the PCM capabilities.
And you could do some research and come back with answers to my questions ;-)
I'm quite hesitant to just add support for undocumented features that could potentially make the library unsafe.
Sorry I can't do research I've no time for it. I told already everything I know.
We'd need to be able to pass additionnal flags for scanning pcm. There's an undocumented ALSA flag: 256 that will allow to open the pcm for scanning info (ignore
EBUSY
).