External MIDI missing?

Support and general discussion.
Post Reply
darksabre76
Posts: 69
Joined: Tue 12 Sep, 2017 4:33 am
Location: Seattle, WA, USA
Contact:

External MIDI missing?

Post by darksabre76 »

Hey all. After a friend of mine pointed out that his build on Linux didn't have an option to select MUNT for MIDI emulation (even with the --enable-alsa flag), I checked in my MSYS2 build as well, and it's missing there too. In fact, you can't select *any* MIDI output, even the default. Was there a change recently that removed this from the settings? I couldn't find it by looking through the BitBucket page so I was hoping someone here might have seen what happened. Thanks in advance!
shermanp
Posts: 175
Joined: Sat 18 Feb, 2017 2:09 am

Re: External MIDI missing?

Post by shermanp »

Works fine here, on the latest version. Windows 10 compile with MinGW-w64 (not MSYS/MSYS2). Windows 98 is sending MIDI to a softsynth via loopMIDI.

Ensure you are selecting a supported sound card (eg: Sound Blaster 16, AWE32 etc).
darksabre76
Posts: 69
Joined: Tue 12 Sep, 2017 4:33 am
Location: Seattle, WA, USA
Contact:

Re: External MIDI missing?

Post by darksabre76 »

I have my machine set for Sound Blaster 16 and for the life of me I don't see the setting in the sound card options anymore.
sb_16_device_config.png
sb_16_device_config.png (2.55 KiB) Viewed 10685 times
shermanp
Posts: 175
Joined: Sat 18 Feb, 2017 2:09 am

Re: External MIDI missing?

Post by shermanp »

Ummm. That's weird.

Here's mine:
SB16-MIDI.png
SB16-MIDI.png (3.72 KiB) Viewed 10684 times
SB16 on a 430VX machine.

I shall try dusting off my MSYS2 installation to see what happens there.

EDIT: The only other thing I can think of would be that Windows doesn't have a MIDI device "installed", but surely it would still show the default Windows MIDI device?
shermanp
Posts: 175
Joined: Sat 18 Feb, 2017 2:09 am

Re: External MIDI missing?

Post by shermanp »

Ok, definitely something wrong.

Just compiled PCem in a freshly updated MSYS2 environment, and I'm seeing the same behavior.
SB16-MIDI-msys2.png
SB16-MIDI-msys2.png (2.67 KiB) Viewed 10682 times
Let's see if I can figure this one out. I'm going to suspect that the issue may be with incompatibilities with a newer library version.

EDIT: And now I remember the reason I stopped using MSYS2 to compile PCem... it's so SLOW.
shermanp
Posts: 175
Joined: Sat 18 Feb, 2017 2:09 am

Re: External MIDI missing?

Post by shermanp »

I think I found the problem for MSYS2 at least. Still not sure about your friends Linux however.

Turns out Makefile.am had no instructions to build win-midi.c. Therefore, wx-sdl2-midi.c was being used, which basically provides dummy functions. This was never a problem on the bespoke platform specific makefiles, as they DO compile and link win-midi.c.

Here's a quick and dirty patch to get MIDI working in MSYS2. I've also moved the ALSA condition to within the linux condition, as ALSA only makes sense on Linux!

Code: Select all

diff -r bad1d550d2b3 -r bd5a71eb452e src/Makefile.am
--- a/src/Makefile.am	Tue Nov 27 09:39:06 2018 +0000
+++ b/src/Makefile.am	Wed Nov 28 21:11:00 2018 +1300
@@ -62,12 +62,6 @@
  wx-thread.c wx-common.c wx-sdl2-video-renderer.c wx-sdl2-video-gl3.c \
  wx-glslp-parser.c wx-shader_man.c wx-shaderconfig.cc wx-joystickconfig.cc wx-createdisc.cc \
  wx-resources.cpp
-if USE_ALSA
-pcem_LDADD += -lasound
-pcem_SOURCES += midi_alsa.c
-else
-pcem_SOURCES += wx-sdl2-midi.c
-endif
 
 if CPU_I386
 pcem_SOURCES += codegen_x86.c
@@ -95,6 +89,12 @@
 
 if OS_LINUX
 pcem_SOURCES += cdrom-ioctl-linux.c wx-sdl2-display.c
+if USE_ALSA
+pcem_LDADD += -lasound
+pcem_SOURCES += midi_alsa.c
+else
+pcem_SOURCES += wx-sdl2-midi.c
+endif
 endif
 
 if OS_OTHER
@@ -109,8 +109,8 @@
 
 if OS_WINDOWS
 DEFAULT_INCLUDES = -iquote .
-pcem_SOURCES += cdrom-ioctl.c wx-sdl2-display-win.c
-pcem_LDADD += wx.res
+pcem_SOURCES += win-midi.c cdrom-ioctl.c wx-sdl2-display-win.c
+pcem_LDADD += -lwinmm wx.res
 endif
 
 if !HAS_OFF64T
Looking at the PCem history, I don't think MIDI ever should have worked on MSYS2, at least not the current wxWidgets incarnation.
darksabre76
Posts: 69
Joined: Tue 12 Sep, 2017 4:33 am
Location: Seattle, WA, USA
Contact:

Re: External MIDI missing?

Post by darksabre76 »

Thanks for the patch! Hopefully if you post this over in the Patches section it can get fixed for all :)
shermanp
Posts: 175
Joined: Sat 18 Feb, 2017 2:09 am

Re: External MIDI missing?

Post by shermanp »

So long as it works, yeah I will do so.
darksabre76
Posts: 69
Joined: Tue 12 Sep, 2017 4:33 am
Location: Seattle, WA, USA
Contact:

Re: External MIDI missing?

Post by darksabre76 »

Can confirm the patch restores the option on an MSYS2 build. Won't show Munt when it's running, but I'll figure that one out later. Thanks again :) I'll have to follow up with my friend on the Linux build.
shermanp
Posts: 175
Joined: Sat 18 Feb, 2017 2:09 am

Re: External MIDI missing?

Post by shermanp »

I checked on my Kubuntu VM, and even without the patch, I get the MIDI selection when compiling with ALSA support. Didn't actually try using it though.

As far as MUNT is concerned, have is it set up as a Windows MIDI device?
Post Reply