-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 UI for wifi remote disc streaming #8845
Conversation
The timeout is useful to allow for shutdown of the thread.
Since it isn't text/html.
This allows matching inside a network.
Huh, I thought I tested this?
Should ideally escape other characters, but only space is necessary for our server to parse.
Because it's probably not what you want to do. This is less confusing.
This is necessary for better caching, in case you share often.
It's not great to delay loading when the server is down - we'll do a proper check when we display the games. This also fixes shutdown being slow.
Very cool. But, I could get it to hang very easily by first sharing, then stopping sharing, then clicking Browse games and then Cancel. Would be nice to have that fixed before merging :) |
Oh, it's connecting to the socket that just closed... derp, forgot to close it properly. -[Unknown] |
Hopefully this will prevent a crash. Currently http::Client uses blocking reads so it will just hang.
Okay, now it tries to protect against that scenario. It is possible it may leak a hung thread waiting to download from a broken server - it'd be nice to change the http client to a non-blocking server. But anyway, it no longer hangs. -[Unknown] |
Before we were just relying on whatever timeout connect() wanted.
Can I use this to connect to my NAS (from my iPhone for example) or should I hard-code it in my recent list? Will this also work if I save the game to my RAM or will it fail because it actualy isn't fully downloading? |
Well, if your NAS has an http:// server, you can use that directly by adding to your recent list. The remote disc streaming simply uses standard HTTP 1.1 features, so it will typically work with most standards-compliant webservers. There could be bugs, though. I know for sure it works with Apache. Alternatively, you could mount the NAS from your desktop, and use this sharing feature to broadcast it to your iPhone. However, it would be going from your phone to your desktop, and then to the NAS. Might add extra latency. The "read entire ISO into RAM" setting on your desktop won't change anything with this feature currently. If used on your phone, it would likely reduce performance, so I don't recommend it. It won't fully load the disc, but it does cache it on your device to reduce latency. -[Unknown] |
Are there any plans to support more protocols like FTP or SMB? Also I was asking if there could be a option which discovers all devices in the network like my NAS (e.g. HTTP, DLNA, Zeroconf). |
Well, I'm not personally planning to implement those things. FTP would probably have worse latency than HTTP, but would be fairly easy to add. The HTTP client is really quite simple and a good reference for anyone looking to implement another protocol: https://github.com/hrydgard/ppsspp/blob/master/Core/FileLoaders/HTTPFileLoader.cpp I don't know much about SMB, but it's probably doable too. The important things it needs are:
Some standard of multicast discovery could probably be implemented as well, but there can be complexities there. But nothing's really stopping anyone. -[Unknown] |
@unknownbrackets So I just installed a http server on my NAS and put the game in my recent list - and it works. But I would find it more convenient to discover my NAS rather than noting every game in Also I find out that when the server is not avalible or I have no internet connection, PPSSPP doesn't even load the covers of local games and when I click on a something, it hangs. Maybe you should include some sort of timeout? |
It does have a timeout (which is why the covers don't load), but I haven't checked what happens when you try to actually click it. That can probably be improved - and the covers could probably more ideally show some sort of "timeout icon". I'd rather it didn't auto-remove them from Recent, though. More discovery methods are welcome. Just open a pull request. -[Unknown] |
@unknownbrackets 😉 I know I want many things, so I hope I don't bother you that much. Also another (probably last) thing: You said that a file is being created when you stream a game (I think it was something like |
I'm not being snarky - many other emulators have a varied number of contributors too. It's a fact that features are usually implemented by people who are interested in them. PPSSPP has a vacuum in a few areas right now - no active contributor is interested in the iOS side of things, no active contributor is interested in network play, TAS, etc. That's why those features get the "short end of the stick." At the root, this probably either means the code looks bad to people who might otherwise be interested (even if only in those specific areas), or that people think that a person named "Someone A. Else" might do it. If you're excited about something you've already got some of the qualifications needed - I'm not joking or being mean. A lot of open source contributors are not actually programmers - some are scientists, authors, graphic designers, musicians, students, teachers, or even middle management. Passion is really the only qualification. As to the ppdc file - it definitely gets recreated. It's designed so the operating system can, at any time, clear these files. They are stored where Android asks for cache files to be stored. You can go to app info and hit "Clear cache". On Windows, they are stored in PSP/SYSTEM/CACHE. Feel free to delete at leisure. -[Unknown] |
@unknownbrackets Well, if I had the time I would already contributed to PPSSPP 😄 On the last question, where is the supposed file location on iOS? |
Not sure. The part that tells PPSSPP where the OS wants cache files is probably not implemented on iOS, so it's probably also in PSP/SYSTEM/CACHE. -[Unknown] |
I can only see the |
I delete them a lot, for testing. Any time it even generates a thumbnail for an HTTP URL, it will recreate them. Note that it may not recreate a cache file if it cannot connect to the URL at all. The filename will look similar to the URL, but with more underscores. An easy way to test is on windows or linux/mac, just run I don't really know how to validate things on iOS, but if your On Android, you can run -[Unknown] |
One last note: PPSSPP crashes when the connection is lost (only tested on iOS). Can we have a more user-friendly way for that scenario, maybe a popup? |
Well, PPSSPP would probably crash if you were playing off a USB disk and you unplugged the disk too. Can probably handle that better, although the crash is likely due to the "fast memory" setting (note: in the "IR Interpreter" and "Interpreter", fast memory is ALWAYS on iirc.) We probably don't emulate it properly when this happens (like if you pulled the UMD out of a PSP while playing the game, which is the behavior we should probably emulate...) -[Unknown] |
IIRC if you push the eject button (on the old PSPs), it would shutdown the game and then show the XMB. Maybe we could use this function? |
Well, I'm about as interested in mimicking the XMB UI as in mimicking Windows 3.11's UI, but when I eject a game on a PSP, it asks me if I want to quit the game. I can say no, and the game keeps playing. In the game I tried, it just hung when I tried to do something that would require the disc. Putting the disc back in actually made it work, so it kinda seems like it just waits as long as it takes for the disc data to reappear. In that case, we could enable retry/disable timeouts when the game is reading data. -[Unknown] |
This adds a screen under Tools where you can:
The sharing is based on your desktop's recent games list. The UI could probably use some polish but at least it's a basic start. Both devices must be connected to the same wifi network.
It selects a random port when sharing (via the OS), but for caching reasons, tries to reuse that port if possible next time.
-[Unknown]