| Summary: | Make pulseaudio stream description configurable | ||
|---|---|---|---|
| Product: | SDL | Reporter: | bugzilla.libsdl.org |
| Component: | audio | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | enhancement | ||
| Priority: | P2 | Keywords: | target-2.0.14 |
| Version: | HG 2.1 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
I've wanted to do this for awhile! I'll try to plug this in for 2.0.14. --ryan. As of https://hg.libsdl.org/SDL/rev/4d04f91e1776, you can set hints before opening the audio device to pass this info to PulseAudio... SDL_SetHint(SDL_HINT_AUDIO_DEVICE_APP_NAME, "My Game 2: The Revenge"); // Set up the thing that plays all the game's sounds... SDL_SetHint(SDL_HINT_AUDIO_DEVICE_STREAM_NAME, "Game audio"); dev = SDL_OpenAudioDevice(...); // We also open a USB headset that is only used for multiplayer chat. SDL_SetHint(SDL_HINT_AUDIO_DEVICE_STREAM_NAME, "Team VoIP chat"); dev2 = SDL_OpenAudioDevice(...); ...this can also be used from the command line for apps that don't supply this information... SDL_AUDIO_DEVICE_STREAM_NAME="My Music Track" SDL_AUDIO_DEVICE_APP_NAME="My Media Player" ./playsound abc.mp3 ...in SDL 2.1, we'll likely make this part of the formal API, but I think this as far as it will got for 2.0. --ryan. Awesome, thanks for this! |
Currently, SDL has a hard-coded description for its PulseAudio stream: h->stream = PULSEAUDIO_pa_stream_new( h->context, "Simple DirectMedia Layer", /* stream description */ &paspec, /* sample format spec */ &pacmap /* channel map */ ); (from src/audio/pulseaudio/SDL_pulseaudio.c) This stream description is user-visible. For example, it is how streams are identified in pavucontrol's "Playback" tab. So if a user currently wishes to adjust the playback volume of an SDL-based application using pavucontrol, then they need to know that the application's audio stream will be identified as "Simple DirectMedia Layer". This is not a great user experience. It would be better if the application could tell SDL to use a specific name for the audio stream, one that has more meaning to the user than "Simple DirectMedia Layer".