Skip to content
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

No option to use 'record' from pulseaudio monitor sources #2917

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

No option to use 'record' from pulseaudio monitor sources #2917

SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Assignees
Milestone

Comments

@SDLBugzilla
Copy link
Collaborator

SDLBugzilla commented Feb 11, 2021

This bug report was migrated from our old Bugzilla tracker.

Reported in version: 2.0.8
Reported for operating system, platform: Linux, x86_64

Comments on the original bug report:

On 2018-06-05 23:42:14 +0000, Matthew wrote:

I've been trying to figure out how get the projectm-sdl example to capture music output (not just microphones). Finally realized that SDL was explicitly dropping the monitor sources.

SDL/src/audio/pulseaudio/SDL_pulseaudio.c in SourceInfoCallback()

Would it be possible to either make new driver or use an env variable to enable these source? e.g.

+
+int include_monitor_sinks = -1;
+
 /* This is called when PulseAudio adds a capture ("source") device. */
 static void
 SourceInfoCallback(pa_context *c, const pa_source_info *i, int is_last, void *data)
 {
+    if (include_monitor_sinks == -1) {
+        const char *option = SDL_getenv("SDL_PULSEAUDIO_INCLUDE_MONITORS");    
+        include_monitor_sinks = (NULL != option && 0==strcmp(option,"true"));
+    }
+
     if (i) {
-        /* Skip "monitor" sources. These are just output from other sinks. */
-        if (i->monitor_of_sink == PA_INVALID_INDEX) {
+        if (include_monitor_sinks || i->monitor_of_sink == PA_INVALID_INDEX) {
             SDL_AddAudioDevice(SDL_TRUE, i->description, (void *) ((size_t) i->index+1));
         }
     }

On 2020-07-25 18:35:22 +0000, cyber wrote:

Upvoting! Need audio capture for music visualization software.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants