-
Notifications
You must be signed in to change notification settings - Fork 114
-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Audio configuration for Linux #104
Comments
My end goal is to loop back my speaker output - my audio configuration does appear to have a monitor device already. |
Unfortunately, miniaudio (the audio library Bonzomatic uses) only looks at the default devices, and there's no environment variable to override it (unlike with, say, SDL). On ALSA (when NOT using PulseAudio), the default is On PulseAudio and JACK, it simply uses whatever the default device is the APIs are giving it. You could try modifying this code if you want it to force-select a certain backend or device. |
I tried poking around there yesterday but I couldn't really find a way to enumerate devices with miniaudio. I tried changing the backends away from NULL but that always failed. I'm also not too great with C++. |
Look for |
The snippet I used was ma_device_info* devinfoarr;
ma_uint32 devinfocnt;
ma_context_get_devices(&context, NULL, NULL, &devinfoarr, &devinfocnt);
printf("devcnt: %i\n");
for(int i = 0; i < devinfocnt; i++) {
printf("name:%s\n", (devinfoarr[i]).name);
}` but EDIT: Yes the devcnt printf is missing it's integer argument. |
That's strange, on Windows that returns my correct number of devices. |
I guess there could be any number of reasons this goes wrong. The problem then is I'm not sure how to debug it and constrain the possibilities. |
Did you try other backends? (First parameter of |
ma_backend backends[] = { ma_backend_pulseaudio, ma_backend_alsa };
ma_result result = ma_context_init( backends, 0, &context_config, &context ); gives |
I tried listing playback devices with the earlier snippet:
Edit: devcnt says 0 but it should have said 1, see edit @ #104 (comment) |
miniaudio uses |
Ok, much better. I have devices now at least. Thanks for your patience. |
Can you go into a bit more detail? I don't want this to be one of those threads where years down the line someone else has the same problem and then the final post is "k fixed" with no indication of what was wrong and how it got fixed :) |
Ah yeah, I usually do that, thanks for the reminder. Does miniaudio have some kind of "enable debug messages" mode? It would have been nice to see something like a list of loaded / not loaded backends. I still have to figure out how to get the right device though. I'm hoping I can just set the default input device in pavucontrol or something. (technically that's pulseaudio, not alsa, but it doesn't make a difference to me). |
Yes, put this before
|
I put |
There's not a lot of logging going on in MA; if you feel there's an issue on their side, you could probably head over to https://github.com/dr-soft/miniaudio and see if you can suggest something on their end. |
I think I'll open an issue requesting more logging then. By the way, here's an example of the output of my printf:
|
I've gone ahead and added some logging to dlopen/dlsym upstream. It's in the dev branch at the moment, but I'll merge it to master soonish.
This isn't exactly true. This is only on select backends where it's either not possible or not practical. The ALSA and PulseAudio backends have full support for device enumeration and selection. |
What is the correct configuration for audio input to work for the FFT on Linux?
I don't see a way to configure the input device.
Edit: summary:
The text was updated successfully, but these errors were encountered: