JOric

Comments, problems, suggestions about Oric emulators (Euphoric, Mess, Amoric, etc...) it's the right place to ask. And don't hesitate to give your tips and tricks that help using these emulations in the best possible way on your favorite operating system.
User avatar
ibisum
Wing Commander
Posts: 1912
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: JOric

Post by ibisum »

Please get this integrated in oric.org! It would be SO NICE!
User avatar
dreamseal
Pilot Officer
Posts: 104
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

Thank you to everyone for the positive feedback! :)

There is a feature that people might not be aware of. If you look at the browser location bar, you should see an "Install" icon at the end. I'm not sure if it appears for all browsers, but it did for Chrome on my Windows machine, and also in Chrome on my Android phone. I found it particularly useful on my phone. After installing it like that, it appears as an icon alongside all the other apps on my phone and is a quick way to launch the website. It looks and feels like it is a native app, because all the normal browser bits are removed when it is launched like that. Given it is so convenient, I'm inclined to scrap the old Android port I have of JOric, as there isn't really a need to build an android version when the web version is able to be installed like this.

I'm continuing to work through some of the suggestions that people made over the past few weeks and will update back here when there is something new to try out.

@ibisum, did you end up being able to see the console error related to the iPad issue? It would be great if I could get it working for people with iPads.
User avatar
ibisum
Wing Commander
Posts: 1912
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: JOric

Post by ibisum »

@dreamseal: sorry, I didn't get back to that yet, I got a bit distracted by Oscar64, and I'm pretty scattered after a week at my day job, preparing things for a release at NAMM this year - but I will dig deeper into this issue over the weekend for you, in between Oscar64 hacking. It's a bit of a runway, because I have to set up my dev environment to gain access to the webconsole and all that, which I haven't done in a while, but I'll post the details soon ..
User avatar
ibisum
Wing Commander
Posts: 1912
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: JOric

Post by ibisum »

Okay I've set up to get access to the Web Inspector on my iPads' Safari instance, but I don't have anything informative to report, alas. I go to https://oric.games/#/basic and I get to the Ready prompt. I enable sound by clicking the speaker icon in the upper left, but still no key-click. I type "PING", and get Ready, but still no sound.

In the Web Inspector, no obvious errors reported, no exceptions (caught or uncaught) - just the following log messages in the Console tab:

Code: Select all

[Log] Resuming PSGAudioWorker... (9B8C1DDD4577E46EC79B68135FA64CC7.cache.js, line 119883)
[Log] Adding AudioWorkletProcessor module... (9B8C1DDD4577E46EC79B68135FA64CC7.cache.js, line 120313)
[Log] Sending audio buffer SAB to AudioWorkletProcessor... (9B8C1DDD4577E46EC79B68135FA64CC7.cache.js, line 120322)
[Log] Connecting AudioWorklet to audio output destination... (9B8C1DDD4577E46EC79B68135FA64CC7.cache.js, line 120324)
[Log] Received ready message from AudioWorkletProcessor. (9B8C1DDD4577E46EC79B68135FA64CC7.cache.js, line 120317)
[Log] Sending AudioWorkletReady message to web worker... (9B8C1DDD4577E46EC79B68135FA64CC7.cache.js, line 120341)
[Log] Worker is running, so turning speaker on... (9B8C1DDD4577E46EC79B68135FA64CC7.cache.js, line 120344)
[Log] Enabling PSG sample writing... (7041BE83A3915C4D3D3BC846F2B59F33.cache.js, line 3732)
[Log] Enabling writing of samples... (7041BE83A3915C4D3D3BC846F2B59F33.cache.js, line 1775)
In the Network tab, sound-renderer.js reports "Scheduling: Queued", Response: "Waiting Download" statistics, in case that gives a clue:

Code: Select all

Scheduling:	
Queued		0.7ms
Response:	
Waiting		51.6ms
Download		1.9ms
Totals:	
Time to First Byte	53.5ms
Start to Finish	55.4ms
Server Timing:	
?proto=TCP&rtt=0&min_rtt=0&rtt_var=0&sent=0&recv=0&lost=0&retrans=0&sent_bytes=0&recv_bytes=0&delivery_rate=0&cwnd=0&unsent_bytes=0&cid=74d2e80fb1d6de2d&ts=30511&x=0
Graphics tab, overview, reports 63 Canvases, some with screenshots of popular Oric games .. not sure what that is all about .. screenshots?

When I hit Reload, an interesting series of events are logged:

Code: Select all

[Log] Fetching program 'BASIC' (9B8C1DDD4577E46EC79B68135FA64CC7.cache.js, line 120290)
[Log] Sorry, the URL provided does not appear to be for a recognised Oric program file format. (9B8C1DDD4577E46EC79B68135FA64CC7.cache.js, line 120272)
[Log] Resuming PSGAudioWorker... (9B8C1DDD4577E46EC79B68135FA64CC7.cache.js, line 119883)
[Error] Unhandled Promise Rejection: NotSupportedError: Permissions::query does not support this API
I hit Reload again, just for grins, and get this message again:

Code: Select all

Unhandled Promise Rejection: NotSupportedError: Permissions::query does not support this API
Will try to drill into this and see what API this promise refers to ..

Maybe this gives you some clues?


EDIT:just saw this, in case its relevant: https://developer.apple.com/library/arc ... ounds.html
Note: On iOS, the Web Audio API requires sounds to be triggered from an explicit user action, such as a tap. Calling noteOn() from an onload event will not play sound.

So .. maybe when the Speaker icon is pressed, it should call noteOn() to start triggering...
User avatar
dreamseal
Pilot Officer
Posts: 104
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

ibisum wrote: Sat Jan 25, 2025 12:54 pm

Code: Select all

[Log] Resuming PSGAudioWorker... (9B8C1DDD4577E46EC79B68135FA64CC7.cache.js, line 119883)
[Log] Adding AudioWorkletProcessor module... (9B8C1DDD4577E46EC79B68135FA64CC7.cache.js, line 120313)
[Log] Sending audio buffer SAB to AudioWorkletProcessor... (9B8C1DDD4577E46EC79B68135FA64CC7.cache.js, line 120322)
[Log] Connecting AudioWorklet to audio output destination... (9B8C1DDD4577E46EC79B68135FA64CC7.cache.js, line 120324)
[Log] Received ready message from AudioWorkletProcessor. (9B8C1DDD4577E46EC79B68135FA64CC7.cache.js, line 120317)
[Log] Sending AudioWorkletReady message to web worker... (9B8C1DDD4577E46EC79B68135FA64CC7.cache.js, line 120341)
[Log] Worker is running, so turning speaker on... (9B8C1DDD4577E46EC79B68135FA64CC7.cache.js, line 120344)
[Log] Enabling PSG sample writing... (7041BE83A3915C4D3D3BC846F2B59F33.cache.js, line 3732)
[Log] Enabling writing of samples... (7041BE83A3915C4D3D3BC846F2B59F33.cache.js, line 1775)
Thanks for doing that. I also can't see anything obvious from the initial log output that you got, in fact all those log messages align with what is logged to the console when sound output works successfully on my Chrome browser. Most of those log messages wouldn't be logged if the action had not been done within a user interaction, so that part appears to be fine. It would refuse to create the AudioWorkletNode and AudioWorkletProcessor if it wasn't done within a user interaction.
ibisum wrote: Sat Jan 25, 2025 12:54 pm Graphics tab, overview, reports 63 Canvases, some with screenshots of popular Oric games .. not sure what that is all about .. screenshots?
Yeah, those are the thumbnail screenshots that are shown on the home screen, i.e. when you go to https://oric.games and scroll or click to the right. If you're not aware yet, the title page is only the first of multiple pages, and it works a bit like pages of apps on a mobile device. Currently, you either have to drag with the mouse, or with your finger (on a touch screen), or you can click on the arrow icon at the bottom of the screen to move one page to the right. Also currently, the keyboard arrow keys will navigate through the pages, but I'm in the process of changing that so that PGUP and PGDN are for moving through the pages when using the keyboard to navigate and the arrow keys will change to navigating through the individual games, which is to support selecting a game solely via keyboard.
ibisum wrote: Sat Jan 25, 2025 12:54 pm When I hit Reload, an interesting series of events are logged:
Not sure what that error on reload is yet but I don't think it is related to the sound issue, mainly because that isn't logged on the initial load. I don't see that error when I reload, so it might be an iPad/Safari only issue, but I suspect it is something different. I'll try to work out what that is as a separate problem.
ibisum wrote: Sat Jan 25, 2025 12:54 pm EDIT:just saw this, in case its relevant: https://developer.apple.com/library/arc ... ounds.html
Note: On iOS, the Web Audio API requires sounds to be triggered from an explicit user action, such as a tap. Calling noteOn() from an onload event will not play sound.
This requirement is mainly why the mute/unmute icon exists in JOric, due to the requirement for there to be an explicit user action. From looking at the initial set of console logs you showed at the top of your post, it wouldn't be logging most of that text if it hadn't considered the click on the unmute icon to be an adequate user interaction.

So it's still a mystery why it isn't working on the iPad. The log messages you show indicate that the emulation has started writing samples to the SharedArrayBuffer (something it wouldn't do unless it had been notified that the audio context in the browser was happy to start playing sound) and the AudioWorkletProcessor should see those and copy the samples to the audio output.

All I can think of is that the AudioWorkletProcessor stopped for some reason, or isn't working correctly. I am going to add some more logging to the "process()" method in the AudioWorkletProcessor (sound-renderer.js), which should reveal a bit more about what is going on. We'll know at least whether it is seeing the samples that have been generated and that it is being called at the expected rate.

I have a few unrelated changes (mainly to do with the keyboard navigation for game selection on the JOric home screen) that are mid-flight at the moment, so I'll try to finish that before I add the extra logging to the AudioWorkletProcessor.

I'll let you know when that extra logging is in place. Hopefully some time tomorrow.
User avatar
ibisum
Wing Commander
Posts: 1912
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: JOric

Post by ibisum »

I am going to add some more logging to the "process()" method in the AudioWorkletProcessor (sound-renderer.js), which should reveal a bit more about what is going on.
Roger that, ready to test at your discretion. Will be really fun to have Oric on iPad. :)
User avatar
dreamseal
Pilot Officer
Posts: 104
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

ibisum wrote: Sat Jan 25, 2025 11:31 pm Roger that, ready to test at your discretion. Will be really fun to have Oric on iPad. :)
The new version with the extra logging is now deployed. Can you try again, wait for maybe a minute after clicking on the unmute icon, and then copy and paste what you see in the console?

I'm expecting that there would be some lines starting with "Available to read" from the sound-renderer.js. It is now logging such a line every 5 seconds. If those lines are not being logged, then that would certainly indicate it isn't copying the samples out, and if it is logging those lines, then the values logged might give some clues as to what is happening.
User avatar
dreamseal
Pilot Officer
Posts: 104
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

Dbug wrote: Mon Jan 06, 2025 10:38 am - Would be nice on PC to be able to use keyboard to select the game in addition to the existing "click and pane"
@Dbug, can you give this another try? I have now implemented keyboard navigation on the "home screen", i.e. the default screen when first going to https://oric.games. The controls are as follows:

- Right arrow: Moves one program to the right.
- Left arrow: Moves one program to the left.
- Up arrow: Moves up one row within the program list.
- Down arrow: Moves down one row within the program list.
- Page Up: Moves up one page of programs.
- Page Down: Moves down one page of programs.
- Home: Goes to the JOric title screen.
- End: Goes to the last page of programs.
- Space/Enter: Run the selected game.

There should be a light grey box around the currently selected program.
User avatar
ibisum
Wing Commander
Posts: 1912
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: JOric

Post by ibisum »

Okay, I'm wired up and I hit reload .. but now all I see is the JORIC screen, with the PCB background and lens flare, and this message in the Web Inspector console:

Code: Select all

Unhandled Promise Rejection: NotSupportedError: Permissions::query does not support this API
JORIC does not proceed beyond the PCB background screen, and I get no further UI.

Tried reload a couple times, same results. URL is https://oric.games/#/basic

Staying tuned in case you've got some quick fixes ..
User avatar
Dbug
Site Admin
Posts: 4935
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: JOric

Post by Dbug »

Works nicely, thanks :)

Probably need to have something more visible than the 1 pixel thin gray outline, can barely see it on my 4K screen, but I guess that's just a minor CSS change?

By the way, are you doing anything weird regarding the fonts, it looks like it's a low resolution font that gets upscaled to native resolution, that looks very weird on my screen:
image_2025-01-26_111210820.png
User avatar
ibisum
Wing Commander
Posts: 1912
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: JOric

Post by ibisum »

Tested on Safari on MacOS as well, same results as on iPad - JORIC doesn't get past the JORIC/PCB/lens-flare startup image.

Code: Select all

[Log] Attempting to load program from URL: null (24BBCC9434D99DE83351F174A42913D2.cache.js, line 120230)
[Error] Unhandled Promise Rejection: NotSupportedError: Permissions::query does not support this API
Note: the above log is from the Safari/MacOS instance - the [Log] message only appears on this instance, it does not show up on the iPad test rig. EDIT: Oh, just noticed that on my test of Safari/MacOS, the URL is https://oric.games/ and on iPad, its https://oric.games/#/basic - so maybe that's another clue.
User avatar
dreamseal
Pilot Officer
Posts: 104
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

ibisum wrote: Sun Jan 26, 2025 11:18 am Tested on Safari on MacOS as well, same results as on iPad - JORIC doesn't get past the JORIC/PCB/lens-flare startup image.

Code: Select all

[Log] Attempting to load program from URL: null (24BBCC9434D99DE83351F174A42913D2.cache.js, line 120230)
[Error] Unhandled Promise Rejection: NotSupportedError: Permissions::query does not support this API
Note: the above log is from the Safari/MacOS instance - the [Log] message only appears on this instance, it does not show up on the iPad test rig.
Was that happening in Safari in the previous release when you went to the home screen?
ibisum wrote: Sun Jan 26, 2025 11:10 am Tried reload a couple times, same results. URL is https://oric.games/#/basic
What happens if you go directly to that URL without reloading? e.g. copy and page that URL into another window and hit enter? I'm trying to work out how you were able to see the audio worklet logging previously. Perhaps it was due to following a link directly from one of my earlier posts rather than reloading within the browser.

Clearly that NotSupportedError is causing issues though, to more than just the sound. I'll see if I can work out what that might be.
User avatar
ibisum
Wing Commander
Posts: 1912
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: JOric

Post by ibisum »

Was that happening in Safari in the previous release when you went to the home screen?
Yes, it has been happening consistently since I started testing for you.

I have https://oric.games/#/basic bookmarked, and hit the bookmark - I only hit reload after going to the bookmark anew.

During a test a moment ago on Safari/MacOS, I saw messages related to being unable to start the Audio thread, but I was not fast enough to capture them in the log (which refreshed itself automatically for some reason), and I have not been able to reproduce the conditions that produced those messages. I will keep poking. EDIT: maybe the messages were coming from LibGDX initialization routines, which might have been replaced contextually with JORIC almost immediately ..
User avatar
ibisum
Wing Commander
Posts: 1912
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: JOric

Post by ibisum »

Please note: Safari/MacOS was working great yesterday, so whatever changed meanwhile, broke it.
User avatar
dreamseal
Pilot Officer
Posts: 104
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

Dbug wrote: Sun Jan 26, 2025 11:13 am Works nicely, thanks :)

Probably need to have something more visible than the 1 pixel thin gray outline, can barely see it on my 4K screen, but I guess that's just a minor CSS change?
None of that is CSS actually. It is all rendered with pixels so uses canvas under the hood. But yeah, it should be easy to make it more visible. For some reason it looks a lot less visible for you. I gave it an opacity of 50% to make it less obvious but perhaps I should remove that for starters, as it is even less obvious for you that it is for me. I'll play around with making it thicker as well.
Dbug wrote: Sun Jan 26, 2025 11:13 am By the way, are you doing anything weird regarding the fonts, it looks like it's a low resolution font that gets upscaled to native resolution, that looks very weird on my screen:
The whole screen is effectively a single lower than 4K resolution image, so the upscaling would be happening for the screenshots as well. In that landscape mode, it would be using 1920x1080. I'll take a closer look at where I'm using the font to see if something else is going on in that case. It looks like I used a font scale of 2, so maybe that is why. I'll see if I can change that.
Post Reply