pcsx2
pcsx2 copied to clipboard
DEV9: MAC address fetch implementation for MacOS/FreeBSD
Description of Changes
Adds a function to read MAC addresses on macOS
With this, I can successfully ping my emulated PS2 with adapters in bridge mode, but not switched. Better than nothing at least.
Rationale behind Changes
Networking on macOS
Suggested Testing Steps
Test networking things on macOS. I've only tested pinging the ps2sdk's tcpip-basic sample code.
Note: I was unable to ping from the computer running PCSX2, but other devices on the network worked fine.
Note: You'll need write access to the /dev/bpf*
system files. If you have wireshark (or homebrew's wireshark-chmodbpf
package) installed, that should handle it for you. Otherwise, chgrp/chmod those so the user you're running PCSX2 as has access.
@kokroo
Description of Changes
Adds a function to read MAC addresses on macOS
With this, I can successfully ping my emulated PS2 with adapters in bridge mode, but not switched. Better than nothing at least.
Rationale behind Changes
Networking on macOS
Suggested Testing Steps
Test networking things on macOS. I've only tested pinging the ps2sdk's tcpip-basic sample code.
Note: I was unable to ping from the computer running PCSX2, but other devices on the network worked fine.
Note: You'll need write access to the
/dev/bpf*
system files. If you have wireshark (or homebrew'swireshark-chmodbpf
package) installed, that should handle it for you. Otherwise, chgrp/chmod those so the user you're running PCSX2 as has access.@kokroo
Sweet, for some reason I cannot see this in my GitHub notifications. How may I help you with the testing and development, and how do I send you money for a pizza and beers?
Cheers!
How may I help you with the testing and development
Can you test this PR with some actual online games and see if it works there?
Check the log viewer and make sure it says it successfully opened the interface before saying it doesn't work. If it fails it'll be printed in red in the log.
Didn't think that failing to get the mac address would block pcap from working, seems I forgot it was needed for a pcap filter used in switched mode (and also a missing check that the getting the mac address succeeded)
I'll be interested to see if that was all that was needed to get network working on macOS

@tellowkrinkle No success. I am able to go to the last stage of the network configurator. I added the custom DNS entry "45.7.228.197" from ps2online.com and it shows the above. I can confirm the above server is working, and also accessible from my machine. My actual PS2 is on the same network and connects to this custom DNS server just fine.
Have I configured something wrong in the settings? If you want, you can see my screen on Teamviewer and experiment.
@tellowkrinkle Okay, so I changed the settings to this (sockets, auto), and it worked! I have been able to enter the lobby! There are no players online on this game, so haven't been able to test multiplayer, but I guess it'll work. I will report back when I try multiplayer on another game. Cheers for this! Can I buy you a pizza now?

@tellowkrinkle So with sockets, I am able to enter lobbies on NFS Underground and Midnight Club 3 and see other games too. Whenever I try to join them, it fails. I have no other games to test online functionality with, but according to what AirGamer said on discord, PCAP Bridged mode will be needed for full functionality since socket connections don't have complete ethernet frames.
On Underground 2 I am getting this screen:
ppamorim
@ppamorim Is this PCAP Bridged mode or Sockets?
ppamorim
@ppamorim Is this PCAP Bridged mode or Sockets?
I tried both. No change.
ppamorim
@ppamorim Is this PCAP Bridged mode or Sockets?
I tried both. No change.
What are your settings?
ppamorim
@ppamorim Is this PCAP Bridged mode or Sockets?
I tried both. No change.
What are your settings?
I think they used the ps2online.com DNS.
I can confirm that in over 3 games that I own that work with that server, all of them allow me to get to the lobby, and see rooms/lobbies/matches, but it never lets me enter.
This only works with Sockets. PCAP bridged mode doesn't even allow me to go online. The only improvement I see over the previous versions of PCSX2, is that network configuration mode inside the emulator didn't even show the PS2 Network adapter in older builds, but now it does show that.
Should we close this if not being worked on?
@tellowkrinkle Hello, is there any way I could help you with this feature? I am available for testing any builds against the online games I possess.
Hello @TellowKrinkle , any chance of rebasing or resuming this work?
Cheers
Hello @TellowKrinkle , any chance of rebasing or resuming this work?
Cheers
I think no one is working on this right now. I tried to take a crack at it but looks like it's beyond my capabilities. It's quite unfortunate since we do have online PS2 servers these days, but Mac users cannot join them :(
I hope somebody capable takes this up in the future if they can contribute their time. Wishing for the best!
I hope somebody capable takes this up in the future if they can contribute their time. Wishing for the best!
Me wishes the best too. We need more improvements for mac.
First of all, thank you for working on and making PCSX2, it's really great to have game emulation on a computer.
After installing on macOS, I got this scary warning in Little Snitch with the Endpoint Security System Extension installed
and I found this thread. According to Little Snitch firewall documentation about the Berkeley Packet Filter:
BPF allows injection of data packets at the network interface. This means that a (privileged) app which opens a BPF device can send any data packet to any destination. The packet is injected directly at the network interface layer, circumventing all firewalls.
I even have the automatic update check disabled, and this throws up a scary warning in Little Snitch
(this only seems to happen after opening the PCSX2 settings menu window the first time after launching the app)
after running sudo opensnoop -n PCSX2
I saw that PCSX2 tried to access both /dev/bpf
and /dev/bpf0
using macOS Big Sur 11.7.10 PCSX2-v1.7.5637.app
Is there a way of making networking work without this bpf access? Thanks again for making PCSX2
Is there a way of making networking work without this bpf access?
Only the (not currently working) pcap-based backends should require bpf access
If you're getting that warning without a pcap adapter enabled, that's a bug and you can report it in a separate issue
Is there a way of making networking work without this bpf access?
Only the (not currently working) pcap-based backends should require bpf access
If you're getting that warning without a pcap adapter enabled, that's a bug and you can report it in a separate issue
Ok, I don't think I have a pcap adapter enabled as I don't really know what that is, I have made a new issue here with some extra info at the bottom
I believe this pr can be closed now that #10937 is merged, which added the same functionality
I believe this pr can be closed now that #10937 is merged, which added the same functionality
I was actually double checking it, but I saw how this PR was also changing other files, not sure if it is because it was a legacy implementation
I believe this pr can be closed now that #10937 is merged, which added the same functionality
I was actually double checking it, but I saw how this PR was also changing other files, not sure if it is because it was a legacy implementation
That was mostly because the code for getting the mac address was duplicated over different files. That code was unified into AdapterUtils sometime between this pr and yours
Aight gonna close if it's already integrated.
Does this bring us a step closer to online play on PCSX2 for macOS? Thanks!