Can't route audio of wine-preloader into a virtual sink

Questions about Wine on Linux
Locked
Unicorn
Newbie
Newbie
Posts: 2
Joined: Fri Mar 27, 2020 7:50 am

Can't route audio of wine-preloader into a virtual sink

Post by Unicorn »

Hey, I am currently struggling to get wine to send audio into a virtual sink in PulseAudio.

Before I start: It is possible to do if I disable every audio interface and set the virtual sink as default before starting the application in question, but that's a pretty bad hack that gets very tedious very quickly. This shows though that it is not completely technically impossible, it just seems to have issues.

Now for a more detailed problem description:
`pactl` and the GUI application `pavucontrol` enable a user to set up virtual sinks and route audio through them. This allows me to capture just the audio that passes through the sink, which I need for my purposes. Wine seems to have partial issues attaching to the sink though:
When I set the audio output to the sink in the wine config and use the test functionality, it does not output to the sink. The Origin client (running in wine) can be bound to the sink through `pavucontrol` and `pactl`. In the game Mass Effect however, the audio comes from two different playback streams, one of them called Mass Effect, the other called "wine-preloader". The audio coming through Mass Effect can be configured to go to the sink, the audio from "wine-preloader" cannot be bound to a sink through `pavucontrol` or `pactl`.

If you want to reproduce this behavior simply without installing Mass Effect, do the following:
  • 1. create a virtual sink in PulseAudio: `pactl load-module module-virtual-sink sink_name=sink1`
  • 2. install and open `pavucontrol` (it's easier, but if you want me to tell you how to do it with `pactl` then tell me and I'll describe in an answer)
    In the "Playback" section, make sure at the bottom it says "Show: All Streams" and you will see your virtual sink stream there. You can select the output you want the virtual sink to output to.
  • 3. open the wine configuration side by side next to the `pavucontrol` window
  • 4. In the "Audio" tab of the Wine configuration, select the Virtual Sink as your output device, hit Apply and Test Sound
You will see the audio stream flashing up in `pavucontrol`, notably you will see on the right that it is not outputting to the Virtual Sink, even though we clearly configured it to do so.

Does anybody know what is going on there or how to possibly fix it? Help would be greatly appreciated!
Unicorn
Newbie
Newbie
Posts: 2
Joined: Fri Mar 27, 2020 7:50 am

Re: Can't route audio of wine-preloader into a virtual sink

Post by Unicorn »

Okay, this is very inconsistent and magical, I am sometimes able to get it to just use the sink by default, though I do not understand what changed. I also figured out that Mass Effect has a configuration utility (in the Binaries folder) that also allows me to specifically set the virtual sink as the output, but it already miraculously worked before I did this. And of course, it also miraculously stopped working at some points. I just have no clue honestly, I will just see if it sticks now.
Locked