Pcsx2: SPU2-X Portaudio error: Invalid device on some machines

Created on 12 Dec 2014  路  22Comments  路  Source: PCSX2/pcsx2

It seems the default device selection can fail / choose an unfit device on some configurations, like my Windows 8 laptop with some HD Audio device.

Bug Windows SPU2

All 22 comments

Using 2 december build.
Tested with Xonar DX and Realtek ALC887 on W7x64. Portaudio actually works _sometimes_.

In DirectSound mode only when latency is 19ms or higher.
With WASAPI when exclusive mode is selected.

I also have this issue with PortAudio on my Windows 8.1 machine. I have more than one valid audio output device and I suspect this has something to do with it. Here's the info I've gathered so far, using PCSX2 v1.3.1 #116 (2015/04/15) and Final Fantasy XII IZJS (English patch v0.22):

With Host Api set to Unspecified, I get sound on my speakers. But if I change my Default Device via Windows to my monitor's speakers (since I'm not given any other choice for devices in the SPU2-X GUI), I get an error: * SPU2-X: PortAudio error: Invalid device. UPDATE: When I changed back my default device to my speakers (via Windows), Unspecified was no longer providing me with sound. Weird.

With Host Api set to DirectSound I get some weird buzzing sound after a couple of seconds. Doesn't matter what device I choose.

With Host Api set to WASAPI and Device Name set to my speakers (Realtek High Definition Audio) it won't work; I get the "* SPU2-X: PortAudio error: Invalid device" error. But if I select 'WASAPI Exclusive Mode' without changing any other setting, I get no such error and I do in fact get sound from my speakers. Strange.

With Host Api set to WASAPI and Device Name set to my monitor's speakers (AMD High Definition Audio Device), I do get sound.

With Host Api set to WDM-KS I get sound, doesn't matter which of the two devices I pick. Weirdly enough though (and quite possibly unrelated), if I leave Device Name on 'Default Device', it outputs sound from my monitor, not my speakers. Strange. I guess Windows must have a setting somewhere other than the Control Panel's Sound window that stores a different value for Default Device. KS stands for Kernel Streaming so maybe it's a kernel setting? Who knows.

In conclusion, I cannot get sound to my speakers via any other Host API that's not WDM-KS or WASAPI Exclusive Mode, which I don't want to use. This is why I use XAudio 2 instead of PortAudio.

P.S. I'm not sure why SPU2-X's author decided to go with 'Host Api' instead of 'Host API' in the GUI. Same thing with why he chose to go with Portaudio instead of the correctly-cased PortAudio. Even the log prints it as PortAudio...you can see in the error I included above.

I encountered this issue when using WASAPI (non-exclusive). (despite a device being explicitly selected).

I discovered that the audio format for the device was set to was "24bit 192000 Hz (Studio Quality)". Setting this to "24bit 4800 Hz (Studio Quality)" allowed SPU2-X to use the device with WASAPI (non-exclusive).

might this hint at what the issue is on other systems?

Did some testing on this, the only mode that works for me is WDM-KS. DirectSound gives me computer noise, and I can't get any output from WASAPI (console reports invalid device)

The invalid device error message seems to be related to exclusive mode somehow. This ticket was opened in PortAudio back in 2011, but closed because it couldn't be reproduced apparently. Whatever this issue is, it's a problem with PortAudio.

Portaudio works for me.
The only new thing I have to report is that WASAPI works too now (guess like that might have been fixed by upgrade to svn1954). Both exclusive and non exclusive.
Oh, and asio. ^^

p.s. of course I'm still on windows 7

@mirh So everything works fine for you on a newer build of PortAudio? (I didn't upgrade anything for my tests)

An update has been pushed since my last report above dated 2014, that's what I meant.
Atm everything works fine for me, but directsound with latencies under 19ms (including default "smallest")

@mirh and anybody else. Try this SPU2-X build with the newest version of PortAudio.

I can't get audio unless I set Host Api to "Unspecified" - DSound is still computer noise; WASAPI and WDM-KS give me invalid device

See if any behavior has changed for you guys.

Rename to .dll Spu2-X.pdf

Very, very funny, since for me this plugin seemed to have broken "Unspecified", which isn't working anymore.

In other news, I just realized I had never reported about WDM-KS, which is not working in both normal dll and yours.

I never bothered to re-test PortAudio since I got a dedicated soundcard a few weeks ago. Basically, the "Invalid Device" error and the associated regressions (in the newer version of PortAudio)are specific to integrated audio.

My SoundBlaster X-Fi Titanium works in all modes with the current SPU2-X dll and the new version from #1912, with no errors shown in the console. The only module I had issues with was DirectSound - which produces robotic noise.

Yes, I tested SPU2-x on a realtek and a IDT audio device, booth fail to load it, but a dedicated audio device (like the terratec aureon 7.1 usb) or the newer version work as @MrCK1 say.

Note: I have the same robotic noise under DirectSound in Portaudio.

looks at my results nobody seems to have noticed
Had no problems with both Realtek and Xonar (also, mandatory fuck you creative)

This revison
https://app.assembla.com/spaces/portaudio/git/commits/bc40f42cba713db3349bb1120b5d3475dd45e37e

states

wasapi: use IAudioClient3 for Windows 10 for best compatibility

Maybe it can help

Unfortunately, we don't use development builds.of PortAudio in PCSX2 and I have a PR to merge the next stable version in anyways.

The remaining issues are down to integrated audio and crappy drivers - IIRC it has nothing to do with PortAudio either. There's not really much we can do about it on our side.

Unfortunately, we don't use development builds.of PortAudio in PCSX2 and I have a PR to merge the next stable version in anyways.

I only mentioned that revision because the ticket to merge the dev build of PortAudio already has 2 extra revisions

2 commits that were pushed after release have been included here as well. (A typo fix for CMakeLists.txt and another small patch).

The remaining issues are down to integrated audio and crappy drivers

I don't know, what you say seems kinda sound - but then I wonder why I, for one, am doing totally fine with my realtek. On W7.

Hmm, I guess you're right. Everything works on my laptop's Realtek chip - only caveat is that WASAPI requires exclusive mode enabled. The new plugin from #1912 behaves the same as well, so I guess Windows 10's issues may have been ironed out?

Can I have some others do re-tests on their systems with the current and new plugin from #1912/ report back with any issues? If not, hopefully we can get it merged soon. ;)

No issues with using the #1912 linked .dll. Thorough testing is difficult, of course.
I tend to hope that newer versions of libraries iron out bugs, so if they build and pass some tests, I'd merge the updates.

only caveat is that WASAPI requires exclusive mode enabled

That ain't even required.
The only thing, again, I have to report (aside of WDM-KS) is that direcstound requires a latency higher than a certain X

So I guess this issue is resolved then? Any objections on closing this?

TBH, considering all the variety of our findings, I think this has always been more about individual hw/sw configs than an actual problem with pcsx2.

Said this, I wonder why latest portaudio still hasn't been merged.

Unfortunately, we don't use development builds.of PortAudio in PCSX2

Current version in master is a dev build...

Was this page helpful?
0 / 5 - 0 ratings