Page 1 of 1

Tips for using Pipewire and Wine

Posted: Sun Feb 11, 2024 11:18 pm
by mistfire

The problem with wine was when you are using multimedia windows program the requires soundcard access such as sound editor (e.g. wavepad) and dj software (e.g. virtual dj). It wanted to took over the control of soundcard however it was already occupied by pipewire ended up the software doesn't work.

The solution was plug the pipewire in ALSA dmix instead of the soundcard directly.

  • Save this content to /etc/pipewire/pipewire.conf.d/<any filename you want>.conf

Code: Select all


context.objects = [

# We do not start with dmix, but with an input device.
# Do not forget to add an input device.
# On a friend's Laptop, I saw Zoom having a nervous
# breakdown and endlessly crying because no input device
# was configured! You have been warned.

{ factory = adapter
    args = {
        factory.name           = api.alsa.pcm.source
        node.name              = "alsa-mic-internal" # name of pulse device (mpv)
        node.description       = "Mic Internal" # name of pulse device (pavucontrol)
        media.class            = "Audio/Source"
        api.alsa.path          = "hw"
    }
}

# Okay, now we add our dmix PCMs

{ factory = adapter
    args = {
        factory.name           = api.alsa.pcm.sink # sink for dmix
        node.name              = "alsa-dmix-internal" # name of pulse device (mpv)
        node.description       = "PCM Internal" # name of pulse device (pavucontrol)
        media.class            = "Audio/Sink" # Sink for dmix
        api.alsa.path          = "dmix"
    }
}

]

The pipewire will disguise as a soundcard device named "PCM Internal"

  • Save this content to /etc/asound.conf

Code: Select all

ctl.!default {
  type hw
  card PCH
}

pcm.!default {
  type plug
  slave.pcm "dmix"
}
  • Restart the pipewire, pipewire-pulse, and wireplumber

Now, wine can now access the soundcard directly while pipewire was running at the same time


Re: Tips for using Pipewire and Wine

Posted: Mon Feb 12, 2024 5:46 am
by jamesbond

Or you can route all ALSA output (including wine's) through pipewire without having to change anything on the pipewire's side.

Code: Select all

ctl.!default {
	type pipewire
}
pcm.!default {
	type plug
	slave.pcm.type pipewire
}

There are pros and cons whichever method you choose to use.


Re: Tips for using Pipewire and Wine

Posted: Mon Feb 12, 2024 6:16 am
by dimkr

PipeWire ships with /etc/alsa/conf.d/99-pipewire-default.conf but some distros move it to a separate package: pipewire-alsa in the case of Debian. Once you install this one, applications that use ALSA only see PipeWire and use it without knowing.


Re: Tips for using Pipewire and Wine

Posted: Mon Feb 12, 2024 6:47 am
by jamesbond
dimkr wrote: Mon Feb 12, 2024 6:16 am

PipeWire ships with /etc/alsa/conf.d/99-pipewire-default.conf but some distros move it to a separate package: pipewire-alsa in the case of Debian. Once you install this one, applications that use ALSA only see PipeWire and use it without knowing.

That's true but with MSCW and other configuration tools that creates /etc/asound.conf, it will most probably set a new pcm.!default, so the default pipewire ALSA setting will most likely be never seen. The snippets I put above simply re-exposes it.


Re: Tips for using Pipewire and Wine

Posted: Mon Feb 12, 2024 7:19 am
by dimkr
jamesbond wrote: Mon Feb 12, 2024 6:47 am

That's true but with MSCW and other configuration tools that creates /etc/asound.conf, it will most probably set a new pcm.!default, so the default pipewire ALSA setting will most likely be never seen. The snippets I put above simply re-exposes it.

This is probably why @mistfire added this block: MSCW (at least, the way it is now) shouldn't be used together with PulseAudio or PipeWire.