Wine in chroot fails to play sound if host does. alsa

Questions about Wine on Linux
Locked
Eichhorn
Newbie
Newbie
Posts: 3
Joined: Wed May 17, 2017 9:13 am

Wine in chroot fails to play sound if host does. alsa

Post by Eichhorn »

Good day!

I run wine inside the chroot, because my main distro is musl-based.

The problem is that whenever I have sound activated in my main system, wine stops seeing my audio device.
Alsa can still play sounds in chroot and

Code: Select all

speaker-test -c2
works as intended, the problem is only with wine.

Here's what wine outputs when I open 'audio' tab and try the test sound button:

Code: Select all

ALSA lib pcm_dmix.c:1077:(snd_pcm_dmix_open) unable to create IPC shm instance
err:ole:CoInitializeEx Attempt to change threading model of this apartment
from multi-threaded to apartment threaded
No output devices are being detected.
with mpv on the host system on
with mpv on the host system on
no_cound.png (6.73 KiB) Viewed 1967 times
If I close everything that plays sound (say, mpv) and try again, sound devices are displayed correctly and test sound works with the following output to the console:

Code: Select all

err:ole:CoInitializeEx Attempt to change threading model of this apartment
from multi-threaded to apartment threaded
with mpv on the host system off
with mpv on the host system off
yes_sound.png (7.89 KiB) Viewed 1967 times
What can be the problem?

I mount chroot with the following script

Code: Select all

#!/bin/bash
xhost +local:
mount -t proc proc /chroot/64/void/proc
mount -t sysfs sys /chroot/64/void/sys
mount -o bind /dev /chroot/64/void/dev
mount -t devpts pts /chroot/64/void/dev/pts
mount -o bind /tmp /chroot/64/void/tmp
chroot /chroot/64/void /bin/bash
export XBPS_ARCH=x86_64
and then run

Code: Select all

chmod 1777 /dev/shm
Eichhorn
Newbie
Newbie
Posts: 3
Joined: Wed May 17, 2017 9:13 am

Re: Wine in chroot fails to play sound if host does. alsa

Post by Eichhorn »

Actually, the problem is the same with 'native' steam games, so it does not look like the wine-exclusive problem.

Still, if you can help, I would be grateful.
Eichhorn
Newbie
Newbie
Posts: 3
Joined: Wed May 17, 2017 9:13 am

Re: Wine in chroot fails to play sound if host does. alsa

Post by Eichhorn »

Ok, I have tried different solutions and it looks like the problem is wine (and steam) exclusive in the end.

The problem seems to be that Wine does not use dmix, because all other apps (mpv, dosbox and so on) do work with sound as expected.

I was pointed to the following theme on the https://ubuntuforums.org/showthread.php?t=700231#2, but it didn't work for me.
attempt to force dmix
attempt to force dmix
Is there a way to force wine to use dmix?
Locked