azahar-emu / azahar

A new Citra fork
https://azahar-emu.org/
2.66k stars 133 forks source link

Android external display support #351

Open OpenSauce04 opened 3 months ago

OpenSauce04 commented 3 months ago

Is there an existing issue for this?

What feature are you suggesting?

Users have requested a feature which would allow an external display to be used to show one or both of the 3DS screens. This would provide an experience analogous to Drastic's external display support or the Wii U's DS virtual console emulation.

Why would this feature be useful?

This would allow for a more faithful hardware experience for users on Android, as it would allow the two 3DS to be displayed on separate real-life displays.

DroidlyMobile commented 3 months ago

Media Projection is the feature we need how is Lime3DS rendering the 2 screens?

DroidlyMobile commented 3 months ago

I stared at the source code for hours today, only if I knew Kotlin I'd be able to understand how to implement what is called Media Projection so that the Top screen could be rendered on the surface via a second display or monitor. If one of you devs could look into this that would be epic, as the Windows/Linux versions have this feature but not sure how the two screens render on the views.

Papermanzero commented 3 months ago

You can use the open source waylus exactly for that feature. Create a second screen open that with weylus on the phone or tablet.

DroidlyMobile commented 3 months ago

You can use the open source waylus exactly for that feature. Create a second screen open that with weylus on the phone or tablet.

That's not the same thing as native media projection on Android.

DroidlyMobile commented 2 months ago

Any update to how the two screens render I can add media projection and push an update for this as right now I figured out how to basically copy the screens but I think it's slowing down the performance.

DroidlyMobile commented 2 months ago

Why would this be marked as low as the ability to play the top screen on my tv and the bottom on my device would be amazing to have this properly rendered with Media Projection on Android. Please look into how the two screens render this would help adding this easy to implement feature.

RageDeadworth commented 2 months ago

Droidlymoblie, pls pls pls, push this update if you can, external display support would be amazing. i8h0vkuacor51 It works great on drastic.

AbbyTheAbsol commented 2 months ago

Someone's making a product called the DNA Duo that I want to buy, but support for dual display is limited on Android right now. q7wys3x0gohd1.jpeg

DroidlyMobile commented 1 month ago

All they need to do is figure out how it's done on Windows/Linux and implement Media Projection just like Drastic. I personally have no clue how the two screens render or I'd modify the emulator myself.

DavidRGriswold commented 1 month ago

As Drastic is not open source, we cannot simply see how they do it (which wouldn't be simple anyway but at least would be a start).

I glanced through the code and I think it is likely significantly harder to implement than you are making this out to be, since the android code is designed right now with only one emulation surface (the screen) in mind, and keeping track of a potential second surface within the android code to pass into the C++ code for the core would require more work than you seem to think it would. It isn't easy would take a lot of work and testing. If somebody passionate about this feature wants to take it on, awesome. Until then, be patient.

DavidRGriswold commented 1 month ago

For future reference for anybody who looks into this more, the API needed for doing this (at least with a Google Cast device) is probably https://developers.google.com/cast/docs/overview?utm_campaign=cast-remote-710&utm_source=gdbc&utm_medium=blog rather than the MediaProjection API mentioned above. MediaProjection seems to be about capturing a real device screen to mirror rather than creating a fully virtual screen on the cast-enabled device. As to supporting physical screens, that seems to be the wild west a bit, no idea how drastic does it.

DroidlyMobile commented 1 month ago

For future reference for anybody who looks into this more, the API needed for doing this (at least with a Google Cast device) is probably https://developers.google.com/cast/docs/overview?utm_campaign=cast-remote-710&utm_source=gdbc&utm_medium=blog rather than the MediaProjection API mentioned above. MediaProjection seems to be about capturing a real device screen to mirror rather than creating a fully virtual screen on the cast-enabled device. As to supporting physical screens, that seems to be the wild west a bit, no idea how drastic does it.

Inccorrect David, I have seen someone do this for Android what they said they did though was rendered the screen twice using Media Projection. I have also decompiled the .apk of drastic and found the source code that is how I know they are using Media Projection which is something I dabbled with myself to create a dual screen game that utilizes the external display and the main display. The SDK you're linking isn't anything close to what Drastic is using, not sure how you read the other api wrong but I again decompiled Drastics source code and it clearly shows this. I have added a snippet of this that is how I found out how Drastic is utilizing the second screen ability it wasn't a hunch or a matter of knowing how to research this stuff. Screenshot 2024-10-10 153914

OpenSauce04 commented 1 month ago

@DroidlyMobile not a fan of your tone, don't put down others who aren't thinking the same thing as you are. This is a collaborative environment.

DavidRGriswold commented 1 month ago

It's fine, my tone wasn't great either, I should have been more neutral. Anyway, I stand corrected about the API.

The code to manage rendering surfaces and pass then to the core emulator code seems to be managed in EmulationActiviy.kt and the NativeLibrary code. If you want to take a crack at it that's where you should start.

DroidlyMobile commented 1 month ago

What tone? You can figure out my tone by messaging? I was stating the facts but thanks 😊 my tone god keyboard warriors love to make something out of nothing I didn't have a tone 😆

On Thu, Oct 10, 2024, 5:19 p.m. OpenSauce @.***> wrote:

@DroidlyMobile https://github.com/DroidlyMobile not a fan of your tone, don't put down others who aren't thinking the same thing as you are.

— Reply to this email directly, view it on GitHub https://github.com/Lime3DS/Lime3DS/issues/351#issuecomment-2406056138, or unsubscribe https://github.com/notifications/unsubscribe-auth/BEUCYWVIVZO77UPJFJQOCW3Z23VM5AVCNFSM6AAAAABMMR2C52VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBWGA2TMMJTHA . You are receiving this because you were mentioned.Message ID: @.***>

DroidlyMobile commented 1 month ago

It's fine, my tone wasn't great either, I should have been more neutral. Anyway, I stand corrected about the API.

The code to manage rendering surfaces and pass then to the core emulator code seems to be managed in EmulationActiviy.kt and the NativeLibrary code. If you want to take a crack at it that's where you should start.

I wasn't bringing a tone at all, idk how anyone can get a tone out of messaging unless they start swearing or using caps. I was stating what I did some people just don't leave the house and think everyone is out to get them so they take messages written on paper as snarky 😆

DroidlyMobile commented 2 weeks ago

So are we ever going to see this feature as it's a feature that is available on Windows/Linux so why isn't is added to Android yet which is the most popular devices right now.

AbbyTheAbsol commented 2 weeks ago

So are we ever going to see this feature as it's a feature that is available on Windows/Linux so why isn't is added to Android yet which is the most popular devices right now.

Doing this on Android is a lot more complicated. Android doesn't natively support split windows, so apps have to use convoluted tricks to get it to work. I believe DraStic accomplishes this through doubling the screens. There's one invisible top screen and one invisible bottom screen that you can't see.

DroidlyMobile commented 2 weeks ago

No it doesn't I have already advised how Drastic uses this feature via the Media Projection library. If you can figure out how the implement this via Windows/Linux in a second window all you need to do is render the second window via Android using The surfaceview within Media Projection when a secondary display is attached. I don't know Kotlin or C or I'd deep dive into this more myself, I only understand Java and Kotlin isn't something I want to take the time to learn right now.

On Sun, Nov 10, 2024, 12:21 a.m. AbbyTheAbsol @.***> wrote:

So are we ever going to see this feature as it's a feature that is available on Windows/Linux so why isn't is added to Android yet which is the most popular devices right now.

Doing this on Android is a lot more complicated. Android doesn't natively support split windows, so apps have to use convoluted tricks to get it to work. I believe DraStic accomplishes this through doubling the screens. There's one invisible top screen and one invisible bottom screen that you can't see.

— Reply to this email directly, view it on GitHub https://github.com/Lime3DS/Lime3DS/issues/351#issuecomment-2466592225, or unsubscribe https://github.com/notifications/unsubscribe-auth/BEUCYWWCZ3JNRT3VONIQJQTZ73UNJAVCNFSM6AAAAABMMR2C52VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRWGU4TEMRSGU . You are receiving this because you were mentioned.Message ID: @.***>

DavidRGriswold commented 2 weeks ago

No it doesn't I have already advised how Drastic uses this feature via the Media Projection library. If you can figure out how the implement this via Windows/Linux in a second window all you need to do is render the second window via Android using The surfaceview within Media Projection when a secondary display is attached. I don't know Kotlin or C or I'd deep dive into this more myself, I only understand Java and Kotlin isn't something I want to take the time to learn right now.

Nobody at Lime3DS works for you, or for anybody. It is a volunteer project. Stop demanding features.

If you have figured out how to implement it, great! Implement it yourself and make a PR, but nobody currently working on it seems to be interested.

DroidlyMobile commented 2 weeks ago

Cool then why is there a section requesting features clown. Get a life

On Sun, Nov 10, 2024, 6:27 a.m. David Griswold @.***> wrote:

No it doesn't I have already advised how Drastic uses this feature via the Media Projection library. If you can figure out how the implement this via Windows/Linux in a second window all you need to do is render the second window via Android using The surfaceview within Media Projection when a secondary display is attached. I don't know Kotlin or C or I'd deep dive into this more myself, I only understand Java and Kotlin isn't something I want to take the time to learn right now.

On Sun, Nov 10, 2024, 12:21 a.m. AbbyTheAbsol @.***> wrote:

So are we ever going to see this feature as it's a feature that is available on Windows/Linux so why isn't is added to Android yet which is the most popular devices right now.

Doing this on Android is a lot more complicated. Android doesn't natively support split windows, so apps have to use convoluted tricks to get it to work. I believe DraStic accomplishes this through doubling the screens. There's one invisible top screen and one invisible bottom screen that you can't see.

— Reply to this email directly, view it on GitHub

351 (comment)

https://github.com/Lime3DS/Lime3DS/issues/351#issuecomment-2466592225, or unsubscribe

https://github.com/notifications/unsubscribe-auth/BEUCYWWCZ3JNRT3VONIQJQTZ73UNJAVCNFSM6AAAAABMMR2C52VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRWGU4TEMRSGU . You are receiving this because you were mentioned.Message ID: @.***>

Nobody at Lime3DS works for you, or for anybody. It is a volunteer project. Stop demanding features.

If you have figured out how to implement it, great! Implement it yourself and make a PR, but nobody currently working on it seems to be interested.

— Reply to this email directly, view it on GitHub https://github.com/Lime3DS/Lime3DS/issues/351#issuecomment-2466696235, or unsubscribe https://github.com/notifications/unsubscribe-auth/BEUCYWTZ2YYYZRFQGYXQW2LZ747LRAVCNFSM6AAAAABMMR2C52VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRWGY4TMMRTGU . You are receiving this because you were mentioned.Message ID: @.***>