Is there a way to set audio stream metadata, in Linux?

On Linux under Pulse Audio or Pipewire, audio streams are identified by metadata which specify their name and icon, rather than by the name of the executable (as typically happens on Windows).

Is there a way we can set the stream metadata that FMOD uses for the audio it outputs? I haven’t been able to find anything in the documentation either for FMOD directly or FMOD Studio; it seems to just use a static string of “FMOD Audio: Mixer Stream”.

The net result is that if you’re running two or more native Linux programs which use FMOD at the same time, you can’t tell which one is which in the OS’s volume control; they all look exactly the same.

In the screenshot below, for example, I’m running my own game as well as Return to Monkey Island at the same time, but you can’t tell which is which, since they’re both being identified as “FMOD Audio: Mixer Stream”

For comparison, in SDL3, they provide a pair of hints that programs can use to provide the string and icon that should be given to the OS to identify the audio stream: SDL_HINT_AUDIO_DEVICE_STREAM_NAME and SDL_HINT_AUDIO_DEVICE_APP_ICON_NAME. Is there maybe something like this we can do in FMOD as well? It’d be a handy quality of life feature for Linux users!

Hi,

Yes, this can be done for PulseAudio only: “FMOD_OUTPUTTYPE_PULSEAUDIO - const char* application name to display in OS audio mixer.” (FMOD Engine | Core Api System - Fmod::Outputtype) by passing in the name as the Extra Driver Data:

FMOD_RESULT result = StudioSystem->initialize(NumChannels, studioFlags, coreFlags, (void*)"Application Name");

Hope this helps.

Thanks!

So the general plan (pseudocode skipping error checking and etc) is going to flow something like this:

StudioSystem->Create()
StudioSystem->GetCoreSystem(&CoreSystem)
CoreSystem->GetOutput(&outputType)
void* extraDriverData = null;
if ( outputType == FMOD_OUTPUTTYPE_PULSEAUDIO )
  extraDriverData = ApplicationNameString;
StudioSystem->Initialise( ..., extraDriverData);

Does that look like the general idea? (I’ve tried this and confirmed that it does seem to work for me! Just wanted confirmation that I’m not missing anything important. :slight_smile: )

Looks good!