KEMBAR78
Add libslirp support (#797) by kcgen · Pull Request #1419 · dosbox-staging/dosbox-staging · GitHub
Skip to content

Conversation

kcgen
Copy link
Member

@kcgen kcgen commented Dec 2, 2021

Address the review comments and merge the excellent work by @Jookia from March 2021. Thank you!

2021-12-02_12-48

Fixes #797.

@kcgen
Copy link
Member Author

kcgen commented Dec 2, 2021

Test package:

ethernet-pack.zip

@Grounded0
Copy link
Collaborator

Thank you @Jookia!

@Jookia
Copy link
Contributor

Jookia commented Dec 3, 2021

As salty as I was in my PR, I'm glad to see kcgen is doing the work I wouldn't to get this merged. Slirp for everyone!

@PatTheMav
Copy link

@kcgen Your timing is impeccable, was just reading through the comments of the old PR.. 😱

@Jookia
Copy link
Contributor

Jookia commented Dec 3, 2021

Oh that reminds me, will this be enabled on Windows? DOSBox-X disables the Win32 code (which I tested and made work) because glib and slirp don't support Windows XP.

@Grounded0
Copy link
Collaborator

Grounded0 commented Dec 3, 2021

Our target is to support Windows 7 or newer so on that basis it should be enabled.

@Jookia
Copy link
Contributor

Jookia commented Dec 3, 2021 via email

@Grounded0
Copy link
Collaborator

Grounded0 commented Dec 3, 2021

https://wiki.gnome.org/Projects/GLib/SupportedPlatforms

Windows: minimum version is Windows 8, minimum build chain is Visual Studio 2012.

I think its unlikely we are going to drag everyone else down to support Windows 7.

@Grounded0
Copy link
Collaborator

https://gs.statcounter.com/windows-version-market-share/desktop/worldwide/

Windows 8+ has a 86.5% market share.

@kcgen
Copy link
Member Author

kcgen commented Dec 3, 2021

Oh that reminds me, will this be enabled on Windows? DOSBox-X disables the Win32 code (which I tested and made work) because glib and slirp don't support Windows XP.

vcpkg (as of right now) currently doesn't packagelibslirp, so it's not currently an option for the visual studio build. But (good news!) One of the sticking points has been glib, and we know it's now (or soon to be) in much better shape on Windows, so this should unlock more depenent packages (like libslirp).

Since your PR, @shermp has contributed a newly authored and improved msys2 CI stack, producing all-features-enabled binaries: and libslirp is available under msys2. So no matter what, we will have libslirp in these builds going forward.

@Jookia
Copy link
Contributor

Jookia commented Dec 3, 2021 via email

@kcgen kcgen force-pushed the kc/slirp-2 branch 4 times, most recently from a77995b to b44e6fe Compare December 8, 2021 13:40
@arrowgent
Copy link
Contributor

had a small issue when compiling dosbox-x requesting libslirp awhile ago, it might have been resolved by debian11/raspbian11

previous debian10 doesnt have any libslirp in the repo

raspbian 11/debian11:

librust-libslirp-dev/stable,stable 4.3.0-3 armhf
librust-libslirp-sys-dev/stable,stable 4.2.0-1 armhf
libslirp-dev/stable,stable 4.4.0-1+deb11u2 armhf
libslirp-helper/stable 4.3.0-3 armhf
libslirp0/stable 4.4.0-1+deb11u2 armhf
libvdeplug-slirp/stable 0.1.0-2 armhf
libvdeslirp-dev/stable,stable 0.1.1-1 armhf
libvdeslirp0/stable 0.1.1-1 armhf
slirp4netns/stable 1.0.1-2 armhf
slirp/stable 1:1.0.17-11 armhf

vs ubuntu x86_64

slirp/bionic-updates,bionic-security 1:1.0.17-8ubuntu18.04.1 amd64
slirp/bionic 1:1.0.17-8build1 amd64

resolution was to disable networking at build time or compile slirp and install it separately

libslirp (optional)
For slirp backend of NE2000 networking support.
Get it from https://gitlab.freedesktop.org/slirp/libslirp

depends if staging is building this static linked or dynamically with the src
just a small note for compatibility

@shermp
Copy link
Collaborator

shermp commented Dec 9, 2021

had a small issue when compiling dosbox-x requesting libslirp awhile ago, it might have been resolved by debian11/raspbian11 ...

Perhaps @kcgen should add the slirp wrap as a fallback if required. It exists in the meson wrapdb.

@kcgen kcgen force-pushed the kc/slirp-2 branch 5 times, most recently from 294d218 to d765996 Compare December 10, 2021 17:36
@Jookia
Copy link
Contributor

Jookia commented Dec 10, 2021

Oh cool, port forwarding. I think DOSBox-X took that. Awesome!

Just to confirm: The libslirp.h thing might have been a bug. I'm not sure, I don't remember entirely but I do recall a bug with libslirp directories not working with Homebrew on macOS.

@kcgen
Copy link
Member Author

kcgen commented Dec 10, 2021

Oh cool, port forwarding. I think DOSBox-X took that. Awesome!

Thanks @Jookia ; yup - @Wengier 's pulled that commit into X already. Soon enough when we get this merged, the two projects will be able to communicate via TCP with one acting as the server. Fun times indeed, all thanks to your contribution!

@kcgen
Copy link
Member Author

kcgen commented Dec 10, 2021

Just to confirm: The libslirp.h thing might have been a bug. I'm not sure, I don't remember entirely but I do recall a bug with libslirp directories not working with Homebrew on macOS.

Thanks for the heads up. Still chipping away at the CI side as time permits, so this is good to know.

This commit uses 32-bit float and avoids
internally threading FluidSynth voices (and
using openMP), as 64-bit samples and
voice-threading and voice-threading are simply
unecessary for performance and the precision
demands of 24 parallel mixed voices of General
MIDI.

DOSBox Staging already threads FluidSynth as as
whole, and performance is acceptable on
decade-old hardware such as a core2duo and Pi2.

(Context: 64-bit and OpenMP /are/ useful when
mixing demands climb into the hundreds or
thousands of parallel voices, but this isn't
General MIDI, which limited to 24 voices).
@kcgen kcgen merged commit 9b953f7 into main Dec 13, 2021
@Jookia
Copy link
Contributor

Jookia commented Dec 13, 2021

Woot!

@kcgen kcgen deleted the kc/slirp-2 branch December 14, 2021 17:08
@kcgen kcgen added this to the 0.78 release milestone Dec 21, 2021
@PatTheMav
Copy link

Unfortunately in my tests on macOS it seems as if no actual network traffic is forwarded outside of Dosbox.

I loaded the ne2000 driver successfully, dhcp assigned the expected IP addresses (IP 10.0.2.15, gateway 10.0.2.2, nameserver 10.0.2.3) and the nameserver IP can be pinged, but when I try to ping e.g. google.com all I get is timeouts.

I also tried dnstest from the mTCP package but only get the following:

Dns: Sending query to 10.0.2.3 for google.com
Dns: Timeout finding: google.com
Dns: No activity, pushing again
Dns: Resending initial query

which then repeats without success. Annoyingly there are also no log messages in the console related to SLIRP that could help with debugging.

@Jookia
Copy link
Contributor

Jookia commented Feb 24, 2022

Please open a bug for that issue and provide logs, etc.

@shermp
Copy link
Collaborator

shermp commented Feb 24, 2022

Note that ICMP (ping) does not work on all platforms with SLIRP (I know it doesn't work on Windows), so I wouldn't rely on ping as an indication on whether it works or not.

@PatTheMav
Copy link

I'll prepare a more comprehensive issue for it if I get around to it. I went back to testing ping because I couldn't get anything else to work either.

@Grounded0
Copy link
Collaborator

Grounded0 commented Feb 24, 2022

@PatTheMav Please open a new ticket on our issue tracker over this instead of using this page for issues.

@PatTheMav
Copy link

Thank you for telling me twice, especially after I already mentioned that I'll prepare a more comprehensive issue on that.

@Grounded0
Copy link
Collaborator

Just trying to keep pages related to code reviews clean from issues. Thats all.

@dosbox-staging dosbox-staging locked as resolved and limited conversation to collaborators Feb 24, 2022
@dosbox-staging dosbox-staging deleted a comment from lgtm-com bot Aug 29, 2022
@Grounded0 Grounded0 added the networking Issues related to networking label Jun 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or enhancement of existing features networking Issues related to networking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement NE2000 Ethernet emulation with libvdeslirp TCP/IP handling

7 participants