| Summary: | No option to use 'record' from pulseaudio monitor sources | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Matthew <matthew> |
| Component: | audio | Assignee: | Ryan C. Gordon <icculus> |
| Status: | NEW --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | mischa |
| Version: | 2.0.8 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
Upvoting! Need audio capture for music visualization software. |
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)); } }