Comments (20)
Sweet! I got it to work!
In pavucontrol, after starting Bonzomatic, an entry showed up under the Recording
tab, and I was able to select Monuitor of Built-in Audio Analog Stereo
as the input device.
from bonzomatic.
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.
Unfortunately, miniaudio (the audio library Bonzomatic uses) only looks at the default devices
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.
from bonzomatic.
My end goal is to loop back my speaker output - my audio configuration does appear to have a monitor device already.
from bonzomatic.
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 dsnoop
(or dsnoop:0
or dsnoop:0,0
), and if that fails, miniaudio tries to open hw:0,0
.
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.
from bonzomatic.
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++.
from bonzomatic.
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 ma_context_get_devices
from bonzomatic.
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 devinfocnt
is zero.
EDIT: Yes the devcnt printf is missing it's integer argument.
from bonzomatic.
That's strange, on Windows that returns my correct number of devices.
from bonzomatic.
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.
from bonzomatic.
Did you try other backends? (First parameter of ma_context_init
)
from bonzomatic.
ma_backend backends[] = { ma_backend_pulseaudio, ma_backend_alsa };
ma_result result = ma_context_init( backends, 0, &context_config, &context );
gives [FFT] Failed to initialize context: -103
from bonzomatic.
I tried listing playback devices with the earlier snippet:
[FFT] MAL context initialized, backend is 'Null'
devcnt: 0
name:NULL Playback Device
Edit: devcnt says 0 but it should have said 1, see edit @ #104 (comment)
from bonzomatic.
miniaudio uses dlopen
so I'll try to check that it's loading the libraries successfully. Setting LD_DEBUG=all
in the env gives output that suggests it might not be finding libasound.so
and libpulse.so
.
from bonzomatic.
Ok, much better. I have devices now at least. Thanks for your patience.
Edit: (Temporarily fixed with LD_PRELOAD
)
from bonzomatic.
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 :)
from bonzomatic.
Ah yeah, I usually do that, thanks for the reminder.
I'm actually working on an updated package for NixOS. We basically have everything in a nonstandard location. I don't remember how dlopen searches for paths (something something RPATH
?) but after seeing no devices at all, I got suspicious that miniaudio wasn't seeing anything because it failed to load the audio libraries. So I threw LD_DEBUG=all
at it and looked for mentions of libasound.so
. I found some, and there weren't any log messages containing search paths that looked right, so I passed a path I knew was correct manually via LD_PRELOAD
.
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).
from bonzomatic.
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.
Yes, put this before #include <miniaudio.h>
:
#define MA_LOG_LEVEL <Level>
Sets the logging level. Set level to one of the following:
MA_LOG_LEVEL_VERBOSE
MA_LOG_LEVEL_INFO
MA_LOG_LEVEL_WARNING
MA_LOG_LEVEL_ERROR
from bonzomatic.
I put #define MA_LOG_LEVEL MA_LOG_LEVEL_VERBOSE
on the first line of FFT.cpp but it doesn't seem to leave any more messages than before.
from bonzomatic.
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.
from bonzomatic.
I think I'll open an issue requesting more logging then.
By the way, here's an example of the output of my printf:
devinfocnt: 2
name:Discard all samples (playback) or generate zero samples (capture)
name:Default Audio Device (via PulseAudio)
from bonzomatic.
Related Issues (20)
- GLX: Failed to create context: GLXBadFBConfig HOT 1
- Unable to get FFT working on windows (GLFW) HOT 3
- Sync Mode for online only events HOT 4
- [ubuntu] alsa sound dependency HOT 2
- Download and install HOT 8
- File access issues on macOS HOT 7
- cursor keys "Top" and "Right" move the cursor in the opposite direction under Linux HOT 7
- MacOS build fails HOT 3
- Bonzomatic doesn't restore resolution upon exit on linux (kwin/kde) HOT 3
- Build failure on macOS 10.13 HOT 3
- postExit command not executed on Linux HOT 3
- Segfault if load shader.glsl with national symbols in commentaries (UTF-8 trouble?) HOT 14
- Can't open Bonzomatic to fullscreen in Windows 10 Pro HOT 1
- How to forward user data between frames in Bonzomatic? HOT 5
- Too darkness texture HOT 4
- Quick reference or Documentation? HOT 5
- Unicode crash on FreeBSD
- Build failure on armv7 FreeBSD 13.1 HOT 1
- Low res text and ignored config.json on macOS Ventura 13.4 HOT 3
- macOS: Bonzomatic.app requires Rosetta (2) to be installed? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bonzomatic.