Skip to content
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

[TESTERS NEEDED] cellMic: wait for registration before using secondary microphones #13484

Merged
merged 7 commits into from
Mar 28, 2023

Conversation

Megamouse
Copy link
Contributor

Apparently games have to register the second and subsequent microphones before they can use them.

@T3HM3T4L
Copy link

T3HM3T4L commented Mar 5, 2023

It took me a bit longer to test because I wasn't sure if I had built it correctly.

When I boot the game with a microphone selected in the GUI, RPCS3 crashes with
"F {PPU[0x1000018] Thread (ThePs3MicManager::RegisterMi) [HLE:0x011d02fc, LR:0x0087ca48]} SIG: Thread terminated due to fatal error: Verification failed
(in file /home/mooty/rpcs3_git/rpcs3/rpcs3/Emu/Cell/Modules/cellAvconfExt.cpp:144, in function copy_device_info)"

If I try to boot the game with no microphone selected in the GUI, the game will boot normally.

@Megamouse Megamouse force-pushed the audio2 branch 2 times, most recently from 18d03c5 to 2b8c884 Compare March 5, 2023 09:28
@Megamouse
Copy link
Contributor Author

Megamouse commented Mar 5, 2023

@T3HM3T4L try again please (you can just download the build, you don't have to build it yourself)

@T3HM3T4L
Copy link

T3HM3T4L commented Mar 5, 2023

@T3HM3T4L try again please (you can just download the build, you don't have to build it yourself)

I'm a total brainlet so I haven't figured this out yet. Logically there had to be an easier way but I didn't find it.

@T3HM3T4L
Copy link

T3HM3T4L commented Mar 5, 2023

Could you please explain how I would go about just downloading the build? I still can't manage it.
I tried downloading the audio2 branch zip but I don't think that's it either.

@Darkhost1999
Copy link
Contributor

Could you please explain how I would go about just downloading the build?

https://wiki.rpcs3.net/index.php?title=Help:Using_different_versions_of_RPCS3#How_to_download_builds_from_a_pull_request_on_GitHub?

@T3HM3T4L
Copy link

T3HM3T4L commented Mar 5, 2023

Could you please explain how I would go about just downloading the build?

https://wiki.rpcs3.net/index.php?title=Help:Using_different_versions_of_RPCS3#How_to_download_builds_from_a_pull_request_on_GitHub?

Thanks a bunch!
Now it was easy-peasy.

Great news: seems to absolutely work!
I used a Singstar mic combo (one plugged in through Singstar's usb, the other via front mic input) and the game correctly picks them up as mic1 and mic2.
Booted up a song and it works as it should!

Currently testing with 3 mic inputs.

@YuriNator557
Copy link

Which Singstar game was this with? There are a lot and some are already known to work even before this PR

@T3HM3T4L
Copy link

T3HM3T4L commented Mar 5, 2023

Which Singstar game was this with? There are a lot and some are already known to work even before this PR

This was Rock Band 3 actually. I know there's a Singstar and Singstar Real mode in the audio settings for those games, but these didn't work with Rock Band 3 at all.

2 mics seems to work very well and giving me the usual performance but although 3 mics works, there seems to be a huge performance hit (I'm running a Ryzen 7 3800x) from the moment the game boots to main screen and intermittently while the song is playing.

@T3HM3T4L
Copy link

T3HM3T4L commented Mar 5, 2023

Here are the facts I can line up:

2 mics in Rock Band 3: works as intended, no hit to performance (steady 30 FPS in menu, steady 60 FPS during song)
3 mics in Rock Band 3: does work as intended, but performance gets hit hard with intervals in the main menu (crashes down to as low 5 FPS, then recovers, audio stutters alongside these drops) and during song (even when I leave the game on pause, the FPS dips as low as 17 FPS at times, about 80% of the time it's at 60 FPS though).
This is with my CPU in performance mode and everything.

My total CPU utilization will be at 10-20% normally and whenever the FPS tanked the CPU utilization went up to anywhere between 20-40% total usage.

The only other thing that I can note is that the log usually spams
"U cellAvconfExt TODO: cellAudioInGetAvailableDeviceInfo(count=8, info=*0xd00bb830)
U cellAudio TODO: cellAudioSendAck(data3=0x0) x191"
during Rock Band 3, which I think is the game constantly pinging for new devices being hotplugged, which will very consistently have around x190 attempts per log entry line.
Any time the FPS dropped in the main menu, the attempts would drop to anywhere between x99-x170.

I'm trying to include a log but GitHub won't allow me as the text file is too big and it won't accept the log.gz.

There's a lot of
"{RSX [0x03b8cf8]} RSX: [Performance warning] CPU readback of swizzled data"
and
"RSX: Cache miss at address 0xC923AE00. This is gonna hurt..."

@Megamouse
Copy link
Contributor Author

Thanks. Please focus on the mic stuff. The RSX isn't relevant.
This also needs testing with all the other mic input games whether they already worked or not.
There seem to be multiple issues for different games already

@T3HM3T4L
Copy link

T3HM3T4L commented Mar 5, 2023

Thanks. Please focus on the mic stuff. The RSX isn't relevant. This also needs testing with all the other mic input games whether they already worked or not. There seem to be multiple issues for different games already

After retrying by closing RPCS3 sooner, I got a smaller log which I'm able to link here. The previous log had ballooned to 125MB (5 times the file size limit!) after about 30 seconds in the Rock Band 3 main menu, so something was spamming REALLY hard, which would explain the CPU having difficulties.

RPCS3.log

@Megamouse
Copy link
Contributor Author

@T3HM3T4L I added something that will reduce the log spam.

@T3HM3T4L
Copy link

T3HM3T4L commented Mar 6, 2023

@T3HM3T4L I added something that will reduce the log spam.

Here's the newest log from the newest build.
Still very strained 3 mic performance with a whole lot of "this is gonna hurt..." up to me closing the game.

RPCS3.log

@Megamouse Megamouse force-pushed the audio2 branch 2 times, most recently from c9499f7 to 1990cc5 Compare March 6, 2023 17:29
@Megamouse Megamouse marked this pull request as ready for review March 12, 2023 08:18
@qfoxb
Copy link

qfoxb commented Mar 12, 2023

Just tested this out with Rock Band 3, Multi mic input is working great for me now, performance seems the same
Also, the log spam fix reduced my log file size tenfold.
The only mic related issue with Rock Band that i still have is the microphone audio dropping out randomly while singing long notes.
Will this PR close issue #8209? Someone has a bounty on this issue - see here
RPCS3.log

@Megamouse
Copy link
Contributor Author

Thanks for testing so extensively.
I changed something, so now it needs to be tested again after the builds are finished :)

@Readek
Copy link

Readek commented Mar 25, 2023

Tested the new build, but it did sadly not fix the performance issues (unplayable with 3 mics, rare slowdowns with 2 mics).

I forgot to add that that last test (as well as this one) was done on Linux.

@Megamouse
Copy link
Contributor Author

The performance is irrelevant in this PR

@T3HM3T4L
Copy link

Tested the new build, but it did sadly not fix the performance issues (unplayable with 3 mics, rare slowdowns with 2 mics).

I forgot to add that that last test (as well as this one) was done on Linux.

These were exactly my findings on Linux as well as earlier reported in the thread.
New build indeed doesn't seem to change anything in that regard.
So far, it's looking like 100% performance issue rate on Linux and 0% on Windows, as far as I know.

I also tested with 1 mic which gave rocksteady performance on par with the main branch so if the only problem is performance issues on Linux specifically while using the optional 2 or 3 mic setting, this PR is still an easy net positive for Windows users and a status quo for Linux users.

rpcs3/Emu/Cell/Modules/cellMic.cpp Outdated Show resolved Hide resolved

auto& mic_thr = g_fxo->get<mic_thread>();
const std::lock_guard mic_lock(mic_thr.mutex);
const u32 device_number = mic_thr.register_device(info->name);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From doc I think the game can repeatedly call this function, it'll just return the same device number again.
We're missing a check to make sure not to register the same device twice, either here or in mic_context::register_device.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made it return the registered index (see register_device)

@qfoxb
Copy link

qfoxb commented Mar 25, 2023

Just tested this build with one mic with Rock Band 3. cellAudioInGetAvailableDeviceInfo is still printed a lot in the log. Not sure if it's in the scope of this PR but changing the microphone settings in custom configuration while the game is open will not actually change the microphones in game.
RPCS3.log

@Megamouse
Copy link
Contributor Author

Needs another test. Fixed some facepalm issues

@Kramerika
Copy link

I'm not sure how to get this to work with 3 microphones. I am on Windows 10 with 3 Wii U USB microphones on RPCS3 Version: 0.0.27-f912aa7a Alpha | pull/13484. They all show up as active microphones in Windows. I have them configured in the RPCS3 audio settings using the standard OpenAL options for the first 3 microphones assigned to each one. When I launch the game, two of them are active (separately) as mic 1 and mic 3, but one is not active for mic 2. The even stranger thing is if I have only 2 mics connected then only one of them works but as mic 1 and mic 3 simultaneously. Do I have something misconfigured?

RPCS3.log

@T3HM3T4L
Copy link

I'm not sure how to get this to work with 3 microphones. I am on Windows 10 with 3 Wii U USB microphones on RPCS3 Version: 0.0.27-f912aa7a Alpha | pull/13484. They all show up as active microphones in Windows. I have them configured in the RPCS3 audio settings using the standard OpenAL options for the first 3 microphones assigned to each one. When I launch the game, two of them are active (separately) as mic 1 and mic 3, but one is not active for mic 2. The even stranger thing is if I have only 2 mics connected then only one of them works but as mic 1 and mic 3 simultaneously. Do I have something misconfigured?

RPCS3.log

It isn't you, this is the way multiple mics are handled in the main branch and for some reason that behaviour returned in this latest audio2 build it seems.

I confirmed it by testing the new build (exactly the same behaviour as you describe) versus the previous audio2 build I had (rpcs3-v0.0.27-14832-8180d634_linux64) where the 2 mics still work as intended.

@Megamouse
Copy link
Contributor Author

Please try again

@T3HM3T4L
Copy link

2 mic and 3 mic work again after this latest fix, still has performance hits on Linux.

RPCS3.log

@Megamouse Megamouse merged commit a8ada49 into RPCS3:master Mar 28, 2023
@Kramerika
Copy link

I tested the new build with 1, 2, and 3 microphones, and it worked fine with any combination.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.