This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Xlink Kai support
#11
One of the devs that is related to xlink kai responded here :
https://github.com/jpcsp/jpcsp/issues/45...-720158107
Reply
#12
Hello Gid15,

I could help you get connected on XLink Kai.
I'm curious about the LLE portion of JPCSP, if that can emulate PSP traffic exactly it will be able to work.
If that's the case I would be happy to add support for XLink Kai as well, if you're not comfortable with that.
I would also be happy to explain some of XLink Kai's workings to you if you like.

Kind regards,
CodedWrench
Reply
#13
(11-03-2020, 01:17 PM)codedwrench Wrote: Hello Gid15,

I could help you get connected on XLink Kai.
I'm curious about the LLE portion of JPCSP, if that can emulate PSP traffic exactly it will be able to work.
If that's the case I would be happy to add support for XLink Kai as well, if you're not comfortable with that.
I would also be happy to explain some of XLink Kai's workings to you if you like.

Kind regards,
CodedWrench
Hello CodedWrench,

thank you for your offer!
I would be very interested into more details on which interfaces could be used to communicate with XLink Kai from a Java world.

Jpcsp is supporting multiple levels of emulation for the network code:
1) HLE: high level PSP API's are emulated over ProOnline (or through Jpcsp's own protocol which mainly became obsolete with ProOnline)
2) mix of HLE and LLE: running everything in HLE, except for the networking code which can be run in LLE. I.e. the PSP original firmware networking code can be used to implement the high level PSP networking API's. This code is then interfacing with an HLE module sceWlan which is just responsible for abstracting the WLAN hardware. The complete network traffic is created by the PSP original code but transmitted through an HLE Java interface. Currently, sceWlan is using UDP for networking as Adhoc communication is not available from a Java world.
3) LLE: running everything in LLE. There, Jpcsp is emulating the WLAN hardware interface. Currently, this emulation is using UDP for networking. That part is very similar to the second scenario using sceWlan

I've tried XLink Kai on my own PSP using AdhocToUSB but couldn't really test it due to missing players in the Lobby. Do you know how the AdhocToUSB bridge is interfacing with XLink Kai? Is the bridge sending the PSP traffic over the Adhoc network on the PC side which is then picked up by XLink Kai like coming from a real PSP or is the bridge communicating over TCP/UDP? The TCP/UDP approach would be interesting for Jpcsp from Java.

Thank you for any support!
Always include a complete log file at INFO level in your reports. Thanks! How to post a log
Reply
#14
psp 
(11-04-2020, 01:01 PM)gid15 Wrote: Hello CodedWrench,

thank you for your offer!
I would be very interested into more details on which interfaces could be used to communicate with XLink Kai from a Java world.

Jpcsp is supporting multiple levels of emulation for the network code:
1) HLE: high level PSP API's are emulated over ProOnline (or through Jpcsp's own protocol which mainly became obsolete with ProOnline)
2) mix of HLE and LLE: running everything in HLE, except for the networking code which can be run in LLE. I.e. the PSP original firmware networking code can be used to implement the high level PSP networking API's. This code is then interfacing with an HLE module sceWlan which is just responsible for abstracting the WLAN hardware. The complete network traffic is created by the PSP original code but transmitted through an HLE Java interface. Currently, sceWlan is using UDP for networking as Adhoc communication is not available from a Java world.
3) LLE: running everything in LLE. There, Jpcsp is emulating the WLAN hardware interface. Currently, this emulation is using UDP for networking. That part is very similar to the second scenario using sceWlan

I've tried XLink Kai on my own PSP using AdhocToUSB but couldn't really test it due to missing players in the Lobby. Do you know how the AdhocToUSB bridge is interfacing with XLink Kai? Is the bridge sending the PSP traffic over the Adhoc network on the PC side which is then picked up by XLink Kai like coming from a real PSP or is the bridge communicating over TCP/UDP? The TCP/UDP approach would be interesting for Jpcsp from Java.

Thank you for any support!

Okay, so on the first bit about the different types of emulation, I did spend the last 2 days or so trying all 3 types of emulation. In the last type of emulation you mentioned I almost have full trust that it will work after watching the traffic with wireshark for a bit, sadly I still wasn't able to connect 2 instances together, not sure what was going wrong.

As for the last bit, XLink Kai is taking the PSP traffic directly as is, whether through AdHocToUsb or a supported WiFi adapter. With AdHocToUSB it does so through a loopback adapter.

However, this method of doing things is no longer nessecary with XLink Kai, due to the DDS support that has been added not too long ago. I sent the following links on github as well, but let me just send them again for completeness:

https://www.teamxlink.co.uk/wiki/DDS_Protocol
https://github.com/dolphin-emu/dolphin/pull/8853

I've made a bit of a start on implementing this for JPCSP, (haven't gotten much further than adding the radiobuttons etc. though atm). But essentially for the traffic itself, all you need to do is send the data you're encapsulating in UDP now with the addition of e;e;[data] in the payload, where [data] is the original payload ofcourse.

Also, CrunchBite did find something in the MAC address generation part that is a bit of an issue, there are some PS2 MACs generated:
https://github.com/jpcsp/jpcsp/commit/71...t-43855791

In addition to that, when you start connecting to XLink Kai you would have to send:

connect;locally_unique_identifier;application_name;optional_padding

So for example:
connect;jpcsp1;JPCSP;

And when disconnecting:
disconnect;jpcsp1;JPCSP;

XLink Kai will also occasionally send keepalives, where you need to respond with the same in the form of:
keepalive;

If you want the XLink Kai chat to show up in JPCSP that is also supported, but for that I would refer you to that link I sent you before.
Reply
#15
I read about the DDS protocol and saw the implementation. It is quite simple and looks powerful.

My first thought was to implement XLink Kai at the mixed level (HLE+LLE), since it is much better tested than the pure LLE level. That would be in sceWlan.java, but the first difficulty was implementing the scanning function (IOCTL_CMD_START_SCANNING) which is the start of any Adhoc communication.
However, I don't know how this function translates to the raw Adhoc protocol. In sceWlan it is just implemented by an UDP broadcasting, but that will not work with XLink Kai, I would need to find out which frames are being sent out for scanning. That's why I wanted to try it out using the AdhocToUSB method + wireshark.

The LLE implementation for the Wlan is not complete yet, it is still a work in progress. I have not yet put much priority on it as the mixed HLE+LLE seems to work quite well for networking. That's probably the reason why your tests were failing.
Always include a complete log file at INFO level in your reports. Thanks! How to post a log
Reply
#16
(11-04-2020, 03:41 PM)gid15 Wrote: I read about the DDS protocol and saw the implementation. It is quite simple and looks powerful.

My first thought was to implement XLink Kai at the mixed level (HLE+LLE), since it is much better tested than the pure LLE level. That would be in sceWlan.java, but the first difficulty was implementing the scanning function (IOCTL_CMD_START_SCANNING) which is the start of any Adhoc communication.
However, I don't know how this function translates to the raw Adhoc protocol. In sceWlan it is just implemented by an UDP broadcasting, but that will not work with XLink Kai, I would need to find out which frames are being sent out for scanning. That's why I wanted to try it out using the AdhocToUSB method + wireshark.

The LLE implementation for the Wlan is not complete yet, it is still a work in progress. I have not yet put much priority on it as the mixed HLE+LLE seems to work quite well for networking. That's probably the reason why your tests were failing.

Hi Gid, one second, i'll dm you a packet capture of some traffic, maybe that is something you can use, if you have any way we can chat directly I could also host a server of some game on my PSP for you so you can check yourself.

One thing that might be of interest to you is the following as well. The project I have going, mondevtopromisc uses a WiFi adapter in Monitor mode, it never associates (connects) with the actual PSP, it just sends the data straight to that AdHoc network. The PSP does not care about this whatsoever. As long as the PSP gets its data, it will send back to the MAC of the PSP I'm injecting the packets of. So anything regarding connecting to adhoc networks can probably be skipped!
Reply
#17
The sceWlan code has been reorganized in 7026474 to support a future implementation of XLink Kai. Nothing functional yet, just preparation.
A first test application for the DDS protocol is available in 0816beb. The approach using DDS seems promising as we could, together with CodedWrench, capture the initial scan data from a real PSP through XLink Kai.
Always include a complete log file at INFO level in your reports. Thanks! How to post a log
Reply
#18
I've tested the following scenario:
- real PSP connected with AdhocToUSB
- Jpcsp using DDS protocol
I see that Jpcsp is receiving frames from the PSP and sending back replies, but none of them are able to see hosted games from the other side.
I found out that the memab functions are unimplemented, even when using memab.prx from a real PSP firmware, the KIRK functions used internally are also not implemented. I saw calls to KIRK cmd=13 and cmd=16. So, I guess I will first need to implement properly those KIRK commands as a next step...
Always include a complete log file at INFO level in your reports. Thanks! How to post a log
Reply
#19
Good job working on implementing Xlink Kai on JPCSP so far.
I have a question.
There is a small amount of games that got "Multiplayer/Ad-hoc LAN" option in them.
I am wondering if there are games that do not use encryption and just use simple TCP/UDP networking.
For example Untold Legends Warrior's Code got that mode.
It could be a good test for seeing if DDS/Xlink Kai works from PSP to JPCSP I think.
I could try but I dont know how to do it on Linux.
This is how it looks btw https://ibb.co/M6CbJDB
If someone is interested to know which games got a LAN option then you can check here : https://docs.google.com/spreadsheets/d/1...sp=sharing
Reply
#20
(11-10-2020, 08:01 PM)Nir777 Wrote: Good job working on implementing Xlink Kai on JPCSP so far.
I have a question.
There is a small amount of games that got "Multiplayer/Ad-hoc LAN" option in them.
I am wondering if there are games that do not use encryption and just use simple TCP/UDP networking.
For example Untold Legends Warrior's Code got that mode.
It could be a good test for seeing if DDS/Xlink Kai works from PSP to JPCSP I think.
I could try but I dont know how to do it on Linux.
This is how it looks btw https://ibb.co/M6CbJDB
If someone is interested to know which games got a LAN option then you can check here : https://docs.google.com/spreadsheets/d/1...sp=sharing
This is a good idea if you own one of those games.
Always include a complete log file at INFO level in your reports. Thanks! How to post a log
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)