Tips for using Pipewire and Wine

Moderator: Forum moderators

Post Reply
mistfire
Posts: 650
Joined: Thu Jul 16, 2020 2:16 am
Location: CALABARZON, PH
Has thanked: 3 times
Been thanked: 143 times

Tips for using Pipewire and Wine

Post 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

jamesbond
Posts: 540
Joined: Tue Aug 11, 2020 3:02 pm
Location: The Pale Blue Dot
Has thanked: 73 times
Been thanked: 292 times

Re: Tips for using Pipewire and Wine

Post 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.

dimkr
Posts: 1907
Joined: Wed Dec 30, 2020 6:14 pm
Has thanked: 36 times
Been thanked: 827 times

Re: Tips for using Pipewire and Wine

Post 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.

jamesbond
Posts: 540
Joined: Tue Aug 11, 2020 3:02 pm
Location: The Pale Blue Dot
Has thanked: 73 times
Been thanked: 292 times

Re: Tips for using Pipewire and Wine

Post 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.

dimkr
Posts: 1907
Joined: Wed Dec 30, 2020 6:14 pm
Has thanked: 36 times
Been thanked: 827 times

Re: Tips for using Pipewire and Wine

Post 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.

Post Reply

Return to “Graphics/Video”