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

Add openal support for emscripten build target #15479

Merged
merged 4 commits into from
Jul 14, 2023

Conversation

ethanaobrien
Copy link
Contributor

@ethanaobrien ethanaobrien commented Jul 14, 2023

Guidelines

  1. Rebase before opening a pull request
  2. If you are sending several unrelated fixes or features, use a branch and a separate pull request for each
  3. If possible try squashing everything in a single commit. This is particularly beneficial in the case of feature merges since it allows easy bisecting when a problem arises

Description

Adds openal support for emscripten, and makes it the default emscripten audio driver, since rwebaudio doesn't understand the lack of threading in Javascript, and openal gives us a better audio quality and is more reliable.

The rwebaudio driver works in chrome, is very crackily in Firefox, and crashes on mobile ios webkit

The openal driver just doesn't work on beta ios, the reason is unknown but it's probably because of either Apple or emscripten. Thats an issue for later. It works perfectly on stable

EDIT: This issue was apparently just having the phone on silent mode. Works great on beta ios!

Related Issues

Related to EmulatorJS/EmulatorJS#416

@LibretroAdmin LibretroAdmin merged commit 71fe262 into libretro:master Jul 14, 2023
22 checks passed
@LibretroAdmin
Copy link
Contributor

BTW @ethanaobrien ,

what is the current state of the Emscripten port?

I've tried it now on web.libretro.com and I notice the following things:

  • It defaults to the rwebinput input driver (so far so good)
  • It only allows me to control the menu (Ozone) with the mouse. The keyboard doesn't seem to do anything.
  • The gamepad I have connected seems to be detected but it doesn't do anything. Upon disconnecting and connecting again, the autoconfig dialog pops up showing that it has detected the controller and configured it, but then control goes haywire and it sporadically goes up and down all over the place on its own.

I've been using the Gambatte core so far.

What is your experience with it so far and is this just something I'm experiencing on my end? In any case, it seems there is clear work still to be done here and I think at one point it used to work fine with keyboard at least.

I'm using Chrome 114.0.5735.199.

@ethanaobrien
Copy link
Contributor Author

Hello @LibretroAdmin!

The keyboard doesn't seem to do anything.

I've never seen this issue. Although now that I think about it, it makes sense. This could be caused by 2 things. With the way the rwebinput driver works, it listens on the canvas element for any keyboard events, but these events aren't on the canvas element unless the canvas is selected, which requires both selecting the canvas, and the canvas being the active document element (which requires the canvas tabindex to be set). It could also need the legacy canvas behavior, depending on the html canvas element.

Long story short, the javascript side for the website is likely using unsupported, legacy api's because it hasn't been updated in forever.

The gamepad I have connected seems to be detected but it doesn't do anything. Upon disconnecting and connecting again, the autoconfig dialog pops up showing that it has detected the controller and configured it, but then control goes haywire and it sporadically goes up and down all over the place on its own.

This is very possibly the rwebgamepad driver attempting to use outdated api's. I could look at this if you'd like, but not sure I could do anything depending on how emscripten handles it.

What is your experience with it so far

I actually took retroarch on the web a step further and built a frontend for the retroarch frontend. The project is EmulatorJS. I actually redid a lot of the input drivers, meaning I don't even use the rwebgamepad driver, and I modified the rwebinput driver to give me the ability to do control mapping, and input both javascript side. I even read the save states directly from the webassembly's emory to increase speed.

See here for the changes I've made, and https://emulatorjs.org/ is the projects website.

and is this just something I'm experiencing on my end?

I can't test right now, but it makes perfect since why it wouldn't work. I highly doubt it's just you

In any case, it seems there is clear work still to be done here and I think at one point it used to work fine with keyboard at least.

Which supports my legacy api handling theory

I can definitely look at these things if you'd like, most of this should be really easy to do

@BinBashBanana
Copy link

Native pointer/multitouch support for rwebinput coming very soon™

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

Successfully merging this pull request may close these issues.

3 participants