Prevent the audio of an application to be turned off by other applications

Hi, looks to my earlier bug report Playing audio file with QMediaPlayer pause Media player - #5 by karry . This behaviour is intentional as it expect that all applications are media players by default. But it is not true in many cases. You may override application “audio resource class” by setup NEMO_RESOURCE_CLASS_OVERRIDE environment variable. I believe that for your usecase, when you want to play sound from two applications simultaneously, you should setup this variable to “game” for one of these applications.

Take a look to my findings here: osmscout-sailfish/OSMScout.cpp at master · Karry/osmscout-sailfish · GitHub

    // pre-defined classes: navigator, call, camera, game, player, event ( https://github.com/qt/qtmultimedia/commit/1c5ea95 )
    // pulseaudio behaviour is configured in /etc/pulse/xpolicy.conf
    // best class should be *navigator*, but this class is routed to device speaker even when bluetooth headset is connected
    // *player* class is routed (pulse route_audio flag), but system player is paused and not resumed after voice message
    // *game* class seems to be best for car navigation
2 Likes