New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wasapi + wine/alsa + surround51rear -> no sound from the rear speakers #924
Comments
It's a combination of issues. Ultimately the problem is various software disagree on what "5.1" is. In particular, the non-front/lfe channels are labelled "surround" in the actual specifications, and on PCs, they were originally given the labels "back" or "rear" in various APIs. But at some point, people realized the "back"/"rear" naming was improper and "side" was more appropriate (which also offered better compatibility, since if you're playing 5.1 content on a 7.1 system, you want the 5.1 "surround" signals to go to the 7.1 side speakers). Windows added a second 5.1 mode that used the side labels instead of the back labels, and started updating their APIs and stuff to prefer using them when possible. ALSA, however, uses raw channel numbers that are assumed to be in a particular order for particular modes, with stereo, quad, 5.1, and 7.1 building off of each other, so can't just change the order of the 5.1 channels when setting the device to "6 channels". OpenAL Soft used to have an explicit For its part, native WASAPI is pretty strict with playback streams matching the device format. Without any APOs installed to work differently, a WASAPI playback stream has to have the same channel configuration as the device, so 5.1 output will only be used with a device configured for 5.1 or better, where OpenAL Soft is able to detect if it's using the side or rear channels and behave appropriately. Wine, however, will allow streams with other channel configurations that it maps directly to ALSA channels, causing the app to be at the mercy of ALSA behavior. Given the circumstances, ideally winealsa would detect if a 5.1side stream is being requested and transparently behave as if it was 5.1rear (the actual channel order from the app is the same), since it's more inline with how Windows behaves. It might also be possible to explicitly set the device to 5.1 Surround in winecfg's Audio tab, which would make WASAPI report the expected channel configuration. Though I'm not sure if that option is available or would be honored with winealsa.drv. |
I already did that, but no effect (though I'm practically stuck at wine 6.19, since with newer versions the app I want to use doesn't work...) Even though my rear speakers is at the rear, not at the side. Should I instead switch to 7.1 and simply ignore the side channels? |
Depending on how far back you mean by "rear" (the specification for the surround speakers is between +/-90 and +/-110 degrees), if they're farther back with the lefts and rights creating more of a square shape, you could instead use |
It's more like +-150 degrees honestly, making it more of a rectangle than a square. Anyway, in the meantime I played around with that adt tool mentioned in the ambdec documentation (man, I really hoped that after finishing uni I'll never have to touch that matlab crap again, sigh) and generated something that may or may not match my speaker layout. Combined with an alsa workaround, it works now, even if not exactly ideal:
I'm not sure how common this layout is, if it's some rare one we can probably leave it like this (even though I don't think I've ever seen a 5.1 layout in real life matching that spec...) |
You could use the
One of these days, I'd like to make a simpler tool for generating decoders from a user-specified layout. I actually have the basis for such a tool, but it has a dependency on the lapack library (in particular, |
I don't have audio in the back channels when trying to use openal-soft under wine. (The native linux version with alsa works fine). I'm trying this example: https://github.com/aib/openal-surround-test/ (originally I tried NFS3 with dsoal, but then I realized the problem is with openal-soft).
Possibly relevant part of the log (
WINEDEBUG=trace+alsa ALSOFT_LOGLEVEL=3
)Openal-soft request channel-format 0x60f (which has
SPEAKER_SIDE_LEFT/RIGHT
instead ofSPEAKER_BACK_LEFT/RIGHT
) which wine maps to channel 6-7 https://github.com/wine-mirror/wine/blob/3f4f116dc52c2d37b98e62c3d9bdd8a79e44ccc1/dlls/winealsa.drv/alsa.c#L686 which makes sense with 7.1 audio, but I only have 6 channels...If I'm right, this
isRear51
variable gets initialized based on theDevice mix format
part in the above dump, but that only reports a stereo device (not sure whether this is a wine bug, or it's a feature).openal-soft/alc/backends/wasapi.cpp
Line 1700 in 23cc00e
Anyway, later it looks like it determines the channel mask based on this, and completely ignores whether I have
channels = surround51
orchannels = surround51rear
in the config.As a workaround I can set
channels = surround71
in the config, then I get audio from the back speakers, but that also means the audio for the side speakers go into/dev/null
...The text was updated successfully, but these errors were encountered: