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
IOS/USB: Emulate Wii Speak using cubeb #12769
base: master
Are you sure you want to change the base?
Conversation
388c11c
to
e8ce010
Compare
Credits to @degasus and @shuffle2 (godisgovernment): https://github.com/degasus/dolphin/tree/wiispeak
932e093
to
cf3916c
Compare
Based on @noahpistilli (Sketch) PR: dolphin-emu#12567 Fixed the Windows support and the heisenbug caused by uninitialized members. Config system integration finalized.
The register should be 12 (i.e. 0x0c) instead of 0xc0
It seems to fix random echoes and reduce noises when nobody is speaking
I fixed a few more things. The Wii Speak Channel appears to work properly now (its initial test won't work though, as we don't emulate the echo reduction). I also added the Android support. To test this PR, you'll need to enable the emulated Wii Speak under The Wii Speak Channel can be tested using a regular one (but by redirecting Nintendo domains to nothing like localhost, resulting in a skippable 20100 error) or via a Riiconnect24 patched version (AFAICT, WiiLink24 patcher doesn't seem to offer it currently, Wiimmfi WAD Patcher does). A Wii friend is required in order to be able to record Wii messages like this: https://www.youtube.com/watch?v=4kpNID36pW0 This PR can be tested on Monster Hunter 3 as well. You will need to patch the game to go online using alternative servers. You will need a friend in-game also using a Wii Speak (Dolphin or a real Wii) to be able to speak in a city. I haven't checked this PR with other games yet, such as Animal Crossing. I'll when I'll get the time to do so. Otherwise, this PR is still ready to be reviewed & tested. |
97daea9
to
3693fe5
Compare
bool m_device_attached = false; | ||
bool init = false; | ||
std::unique_ptr<Microphone> m_microphone{}; | ||
const DeviceDescriptor m_device_descriptor{0x12, 0x1, 0x200, 0, 0, 0, 0x10, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const DeviceDescriptor m_device_descriptor{0x12, 0x1, 0x200, 0, 0, 0, 0x10, | |
const DeviceDescriptor m_device_descriptor{ | |
.bLength = 0x12, | |
.bDescriptorType = 0x01, | |
.bcdUSB = 0x0200, | |
.bDeviceClass = 0x00, | |
... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT, this syntax isn't used in the current codebase for similar device classes. I wouldn't mind changing it in a follow up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does the permission prompt work on Android? Does cubeb automagically make the permission prompt show up?
@@ -28,6 +28,7 @@ | |||
<uses-permission | |||
android:name="android.permission.VIBRATE" | |||
android:required="false"/> | |||
<uses-permission android:name="android.permission.RECORD_AUDIO"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<uses-permission android:name="android.permission.RECORD_AUDIO"/> | |
<uses-permission | |
android:name="android.permission.RECORD_AUDIO" | |
android:required="false"/> |
Otherwise Google Play can prevent Dolphin from being installed on devices with no microphone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT, cubeb doesn't prompt anything and just fails to initialise.
Should we check this permission and ask the user the appropriate permission? If so, should it be done in the C++ code before the initialisation or in the Android code when using the settings toggle?
@@ -923,4 +923,6 @@ It can efficiently compress both junk data and encrypted Wii data. | |||
<string name="incompatible_figure_selected">Incompatible Figure Selected</string> | |||
<string name="select_compatible_figure">Please select a compatible figure file</string> | |||
|
|||
<string name="emulate_wii_speak">Wii Speak</string> | |||
<string name="disconnect_wii_speak">Mute Wii Speak</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Mute" doesn't match what the setting is called in the code or in DolphinQt. Is this something that was overlooked, or is it intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is intended since it is presented differently on PC and Android. On PC it has its own dedicated window (similar to the emulated Infinity base):
Whereas on Android, it's only a toggle settings below the one enabling the Wii Speak. So to make it clearer for the end-user I decided to rename it (as the effect and purpose of disconnecting it is not to record audio). I feel that having a "Wii Speak" toggle, plus a "Disconnect Wii Speak" toggle right under it sounds strange from a UI point of view.
I'm open to better ways of presenting this option to the user.
This PR is based on #12567.
I don't have much knowledge regarding the technical details of the implementation. I mainly fixed the Windows support, the heisenbug due to uninitialised members and finalised the config integration.
Ready to be reviewed and tested.