Lime-3DS-Emulator
Lime-3DS-Emulator copied to clipboard
Second screen android support
Enable support for a second screen on android, either through a physical connection or using screen mirroring through Chromecast or Miracast.
What Currently Works
- A "Secondary Screen Layout" option has been added to the Settings menu on Android where user can choose between (1) System Default (mirroring) (2) Top Screen Only (3) Bottom Screen Only (4) Side by Side.
- A secondary window is always enabled at emulation start - either on an invisible virtual display or a physical display if it exists. If the setting is "System Default (mirroring)" the virtual display is used instead
- It is possible to switch back and forth between the virtual display and physical display using the settings above
Issues and changes yet to be done
- [ ] Test test test
Addresses #351
I'd be interested in seeing what the lag might be while casting. Might not matter much if the second screen is mostly static or not used often.
I'd be interested in seeing what the lag might be while casting. Might not matter much if the second screen is mostly static or not used often.
The issue is that the most clear use-case involves casting the top screen while keeping the bottom touchscreen on the phone so touch input works as normal. So it would usually be the more active screen getting cast. It works pretty okay in my wifi environment - I wouldn't want to play, like, shovel knight on it, but it's okay for link between worlds type stuff where a little lag is unlikely to result in death.
that said, I think the most likely long-term use for this will be a two-screen android handheld, if such a thing ever comes to be. The DNA Duo on an Ayn Odin 2 basically makes one, but I expect a retroid pocket flip 3 with a smaller bottom screen between the controller parts in a few years.
I am pretty sure this is ready for review or at least significant additional testing.
I have tested with vulkan pretty extensively - i have had a couple of crashes here and there but they are not consistently reproducible and I'm not even certain they can be linked to this code. That said there are almost certainly things that can be improved in the programming flow.
I'd be interested in seeing what the lag might be while casting. Might not matter much if the second screen is mostly static or not used often.
Citra MMJ has the Media Projection library already integrated into it, and it's amazing to play on a secondary USB C display!!!! Even DNA Mobile Gaming has been developing/designing a detachable portable OLED display to use this!!!
Feedback from testing. Both environments were cleaned up to remove settings from previous apps.
1) Android 15, OnePlus 13 (Snap 8 Elite)
- Managed to get secondary screen working on multiple displays, and XR glasses. Played for a few hours at 3x resolution with no bugs whatsoever.
- Works properly both on normal and (forced) desktop modes.
- Worth noting that the second screen doesn't immediately show up when disconnecting then reconnecting a screen while a game is running. Probably a minor issue, and going to home or switching apps forces the screen to display again when going back to Azahar
2) Android 13, Ayn Odin 2 (Snap 8 Gen 2)
- Couldn't get the second screen to display. Content is only mirrored.
- Tried on normal and desktop modes without success
- Drastic working properly as a comparison
3) Additional feedback
- While niche, for use with XR glasses (or any other display that supports side by side), an option to only enable stereoscopy for only one of the two screens would be welcomed. Currently, the bottom screen is also displayed twice, which is not ideal and probably consume unnecessary ressources.
Thanks for the hard work on this PR !
Feedback from testing. Both environments were cleaned up to remove settings from previous apps.
1) Android 15, OnePlus 13 (Snap 8 Elite)
- Managed to get secondary screen working on multiple displays, and XR glasses. Played for a few hours at 3x resolution with no bugs whatsoever.
- Works properly both on normal and (forced) desktop modes.
- Worth noting that the second screen doesn't immediately show up when disconnecting then reconnecting a screen while a game is running. Probably a minor issue, and going to home or switching apps forces the screen to display again when going back to Azahar
2) Android 13, Ayn Odin 2 (Snap 8 Gen 2)
- Couldn't get the second screen to display. Content is only mirrored.
- Tried on normal and desktop modes without success
- Drastic working properly as a comparison
3) Additional feedback
- While niche, for use with XR glasses (or any other display that supports side by side), an option to only enable stereoscopy for only one of the two screens would be welcomed. Currently, the bottom screen is also displayed twice, which is not ideal and probably consume unnecessary ressources.
Thanks for the hard work on this PR !
Not working on an Odin is a bummer. I wish I had one for debugging.
@GH-Fox could you see if MelonDS two-screen mode works on the odin 2? This is open source, unlike drastic, so if it works and we don't, I could at least look at their code to try to understand why...
MelonDS works great on the Odin 2 with a portable display
On Thu, Jun 19, 2025, 3:15 PM David Griswold @.***> wrote:
DavidRGriswold left a comment (azahar-emu/azahar#617) https://github.com/azahar-emu/azahar/pull/617#issuecomment-2988956283
@GH-Fox https://github.com/GH-Fox could you see if MelonDS https://www.reddit.com/r/retroid/comments/1laq8uj/release_melonds_dual_screen_support/ two-screen mode works on the odin 2? This is open source, unlike drastic, so if it works and we don't, I could at least look at their code to try to understand why...
— Reply to this email directly, view it on GitHub https://github.com/azahar-emu/azahar/pull/617#issuecomment-2988956283, or unsubscribe https://github.com/notifications/unsubscribe-auth/BEUCYWT4CRS23RW3PEKDI7T3EMD6HAVCNFSM6AAAAABYF3HBMOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSOBYHE2TMMRYGM . You are receiving this because you commented.Message ID: @.***>
Feedback from testing. Both environments were cleaned up to remove settings from previous apps.
1) Android 15, OnePlus 13 (Snap 8 Elite)
- Managed to get secondary screen working on multiple displays, and XR glasses. Played for a few hours at 3x resolution with no bugs whatsoever.
- Works properly both on normal and (forced) desktop modes.
- Worth noting that the second screen doesn't immediately show up when disconnecting then reconnecting a screen while a game is running. Probably a minor issue, and going to home or switching apps forces the screen to display again when going back to Azahar
2) Android 13, Ayn Odin 2 (Snap 8 Gen 2)
- Couldn't get the second screen to display. Content is only mirrored.
- Tried on normal and desktop modes without success
- Drastic working properly as a comparison
3) Additional feedback
- While niche, for use with XR glasses (or any other display that supports side by side), an option to only enable stereoscopy for only one of the two screens would be welcomed. Currently, the bottom screen is also displayed twice, which is not ideal and probably consume unnecessary ressources.
Thanks for the hard work on this PR !
Not working on an Odin is a bummer. I wish I had one for debugging.
The Odin 2 works fine for me, not sure why it isn't working for others but I tested the Odin 2 with your latest build of Azahar and it works fantastic.
I tested this specific build of MelonDS quickly, and couldn't get anything but mirrored projection as well. I'm less familiar with the settings for this one, so I'll do more testing tomorrow.
@DroidlyMobile: I have an Odin 2 Max. Could it be that you have a different model ? For instance, I know that the OS on the Odin 2 Portal is slightly different. If that's the case, then that would help me ruling out 1 of the 3 potential reasons why it's not working on my end.
Additional "bug" that I found today on my phone: in Desktop mode, the navbar at the bottom is overlapping with the projected screen by a few pixels. This does not happen in normal mode.
I will be honest, I don't even know what Desktop Mode is. I use Samsung phones which have Dex which must be disabled for the apps to detect the second screen correctly.
Does Drastic require you to give permission to record the screen when you use it? That could imply they are using a different API than what this and MelonDS are using.
No Drastic doesn't require anything like this, I decompiled Drastic to find out about the Media Projection library and it also just works with a game I've been working on for Android on even Android 15.
On Thu, Jun 19, 2025, 6:00 PM David Griswold @.***> wrote:
DavidRGriswold left a comment (azahar-emu/azahar#617) https://github.com/azahar-emu/azahar/pull/617#issuecomment-2989224967
Does Drastic require you to give permission to record the screen when you use it? That could imply they are using a different API than what this and MelonDS are using.
— Reply to this email directly, view it on GitHub https://github.com/azahar-emu/azahar/pull/617#issuecomment-2989224967, or unsubscribe https://github.com/notifications/unsubscribe-auth/BEUCYWUDN5TPDANDJAWTZN33EMXJVAVCNFSM6AAAAABYF3HBMOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSOBZGIZDIOJWG4 . You are receiving this because you were mentioned.Message ID: @.***>
Melonds dual screen fork apparently added doco on how it implements it's code, not sure if that helps https://github.com/SapphireRhodonite/melonDS-android/releases/tag/0.0.4
Unfortunately, I still can't get this PR to work on Odin 2 Max (firmware 1.0.0.355) other than in mirror mode.
I've been running other apps for comparison testing:
- Drastic (r2.6.0.4a build 109) working out of the box
- Citra MMJ (20250221) works with the following settings: Layout: Single, Screen Cast: Single Screen
- MelonDS dual screen fork (tested from v0.0.2 to 0.0.4) is not working and only shows mirrored content
My objective is to identify why this PR of Azahar is only displaying mirrored content on my end, while it seems that others had more success. Could be a setting at OS level that I messed up, in which case I'd like to find the culprit in case this also happens to other users once merged. Although I'll only be 100% convinced if someone confirms they got it to work on an Odin 2 Base/Pro/Max (not a portal, not a mini).
Hope this helps
Seems like MelonDS dual screen fork v0.0.5 is fixing the issue on Odin 2. Hopefully that will also apply to Azahar.
I think I understand the bug they describe and will attempt to add something similar to this code either today or tomorrow. Thanks for your help!
@GH-Fox i just pushed the odin 2 bugfix, I think, and a new build is going through CI now. It should hopefully be built soon, if you could test it sometime in the next day or two that would be great!
Confirming that the new version fixes the issue on odin 2 Max. I can now fully enjoy a dual screen experience.
The last missing piece for a perfect 3D experience with XR glasses will be this option to turn on side by side on only one of the 2 monitors.
Thanks for the hard work ! :)
I have implemented all suggested changes, along with changing all internal and external references to the additional display to reference "Secondary Display" for consistency. Ready for more review or testing, or maybe to merge!?!
I have implemented all suggested changes, along with changing all internal and external references to the additional display to reference "Secondary Display" for consistency. Ready for more review or testing, or maybe to merge!?!
I'll need to do some testing later, but hopefully I can merge it today if nothing unexpected happens.