rpcs3 icon indicating copy to clipboard operation
rpcs3 copied to clipboard

Mic not working | Socom Confrontation

Open Awatatah opened this issue 1 year ago • 10 comments

Quick summary

For Socom: US Navy SEALs Confrontation (BCUS98152) the mic does not work. Confirmed mic is working and input is detected in windows.

RPCS3 Version: 0.0.30-15996-93f51544 Alpha | master

Details

Mic not working. Attempted mic input in game right before closing application to get logs. RCPS3 detects device for Mic 1 The game shows a headset is detected I can hear others talking (must be on actual PS3 console)

Attach a log file

RPCS3.log.gz

Attach capture files for visual issues

No response

System configuration

OS: Windows 10 Pro 64bit (build 19045) System model: Z590 AORUS Master Processor: i7-10700K RAM: 32GB GPU: NVIDIA GeForce RTX 4070

Other details

Tried both bluetooth and wired headsets

Awatatah avatar Jan 23 '24 03:01 Awatatah

Socom Confrontation is an online-only game. Mic isn't implemented for online content at all. I believe it's a low priority because how would any type of online vocals be moderated? It can be moderated by people having the sense to choose whether or not to play online with certain people. But beyond that, if implemented will not feasibly be maintained by anyone. Shouting at clerks in GTAV is something strongly desired rather than shooting all the merchandise. But because shooting the merchandise is an alternative this doesn't raise any priority on the demand. I'm just saying a feature request like this might get a longterm label.

Darkhost1999 avatar Jan 23 '24 04:01 Darkhost1999

That game actually uses cellMic and I assume does its own capture and sends the data to the private server/other players. cellMic should work, the issue may be with the private server?

RipleyTom avatar Jan 23 '24 04:01 RipleyTom

That game actually uses cellMic and I assume does its own capture and sends the data to the private server/other players. cellMic should work, the issue may be with the private server?

Metal Gear Online's mic functionality also doesn't work in RPCS3. This has nothing to do with our server either, as the mic works for PS3 players.

cipherxof avatar Jan 23 '24 04:01 cipherxof

That game actually uses cellMic and I assume does its own capture and sends the data to the private server/other players. cellMic should work, the issue may be with the private server?

Metal Gear Online's mic functionality also doesn't work in RPCS3. This has nothing to do with our server either, as the mic works for PS3 players.

Yes. Same for SOCOM Confrontation. Mic works for PS3 players but not RPSC3

Awatatah avatar Jan 23 '24 04:01 Awatatah

That game actually uses cellMic and I assume does its own capture and sends the data to the private server/other players. cellMic should work, the issue may be with the private server?

That's correct. It uses cellMic, the client send the data to the server which will broadcast it to the clients.

cellMicRead warning log can be seen in the logs: W cellMic: cellMicRead(dev_num=0, data=0xd011cb18, maxBytes=0x400) x5

The issue cannot be with the server, PS3 players are not experiencing this issue and the server properly relays the audio stream data to other clients.

snnaakee avatar Jan 23 '24 11:01 snnaakee

That game actually uses cellMic and I assume does its own capture and sends the data to the private server/other players. cellMic should work, the issue may be with the private server?

Any ideas on this? The servers seem to be fine.

Awatatah avatar Jan 27 '24 04:01 Awatatah

Adding more info: Windows shows the emulator is using my microphone

image

image

Awatatah avatar Feb 03 '24 02:02 Awatatah

Adding a little more info: I spoke to about 10 other players using the emulator also are not able to use mic. It seems for this title, the mic doesn't work for anyone using the emulator.

Awatatah avatar Feb 06 '24 01:02 Awatatah

I am experiencing the same problem.

shankly1985 avatar Feb 09 '24 17:02 shankly1985

Any update? :eyes:

Awatatah avatar Mar 09 '24 04:03 Awatatah

I did some digging into Metal Gear Online and there seems to be multiple issues.

First of all, MGO's mic handling code looks something like this:

cellMicGetSignalState(0, CELLMIC_SIGSTATE_MICENG, &result);

if (result > micThreshold) {
    playerIsTalking = true;
}

size_t len = cellMicRead(0, buffer, 0x4000);
memcpy(dest, buffer, len); // dest is read from elsewhere, checking playerIsTalking

The first issue is that the game expects CELLMIC_SIGSTATE_MICENG's value to be anywhere from 45.0f and 72.0f, depending on the user's settings. In order for this functionality to properly work, the actual value will likely need to be determined from the latest samples in update_audio.

The second issue is that even when hardcoding the decibels to a value within that range, you still can't hear the mic from PC players, despite the in-game notification popping up that the player is speaking.

cipherxof avatar Mar 25 '24 21:03 cipherxof

@Megamouse

I spent the week debugging the PS3 and RPCS3 to determine why the microphone isn't working in SOCOM on RPCS3.

I finally discovered all the issues :

ISSUES

  1. Audio Format:

    • Socom is using cellMicRead and gets audio data from the DSP stream
    • On rpcs3, the DSP stream is the same as the RAW stream (Digital signal processing isn't implemented, no surprise)
    • DSP stream : 32-bit
    • RAW stream : 16-bit
  2. Audio Data Polling Frequency:

    • On the PS3, cellMicRead is called every 16ms, whereas on RPCS3, it's called every 5ms (hardcoded in cellMic.cpp)

FIXES

  1. Audio Format:

    • RPCS3 currently records microphone audio data in 16-bit using OpenAL. We need to support 32-bit float as required for the DSP stream.
  2. Audio Data Polling Frequency:

    • Regarding syncing cellMicRead calls, this is beyond my skills

CONCLUSION

Now, on RPCS3 I can read WAV files and inject the audio data to be processed by cellMicRead, hardcoding a 16ms timestep. This approach allows me to hear the audio correctly on RPCS3, but it won't work if the audio is in 16-bit format as it expect DSP format (32-bit float).

Since socom sends the audio data over the network in chunks of 512 bytes (1024 bytes max), with a sample rate of 8000 Hz and 32 bits per sample : 512/4 = 128 samples 128/8000 = 16 ms (bufferSizeMS)

I'm unable to contribute at this level as my C++ skills are too weak. However, I will do my best to answer any questions and hope to eventually resolve this issue, allowing players to use their microphones.

edit: I tried messing with cellMic myself, no luck with openAL, AL_FORMAT_MONO_FLOAT32 doesn't work. But I had better luck using portaudio. I'm able to make the microphone "half working". I can ear myself, but high pitched sound due to my poor knowledge of the stuff. I'm pretty sure it's a piece of cake for megamouse

Default: https://streamable.com/8r99ga After a week of nightmare : https://streamable.com/of4so7

DETAILS

Audio tests I have done using the sdk sample project "capture". Which record and save microphone audio data from DSP/RAW/AUX stream in wav format. cellMicRead must be polled every 16ms and a sample rate of 8000 (like socom), in order for this to work

  • Playing DSP audio from PS3 on RPCS3 : it works
  • Playing the same audio on rpcs3, but from RAW stream : doesn't work
  • Playing any audio on rpcs3 that have the same format as a DSP stream would have on PS3 : it works

I can provide the WAV files used for the test or assist anyone in reproducing my steps.

EDIT

Microphone working on RPCS3 : https://streamable.com/pq7ang Couldn’t get AL_FORMAT_MONO_FLOAT32 working, so I used PortAudio. The code isn’t great, but it’s a POC that it can work with minor adjustments.

snnaakee avatar Aug 30 '24 22:08 snnaakee

@Megamouse when will the official release of this be? Or is it already out since it was merged?

Awatatah avatar Sep 03 '24 21:09 Awatatah

give it about an hour

Megamouse avatar Sep 03 '24 21:09 Megamouse