dterrahe / darktable

darktable is an open source photography workflow application and raw developer
https://www.darktable.org
GNU General Public License v3.0
2 stars 0 forks source link

Crashes at startup when MIDI controller plugged in on Win10 #16

Closed jannekem closed 2 years ago

jannekem commented 3 years ago

Describe the bug/issue

Darktable crashes on startup when a MIDI device is connected on Windows 10. It opens normally when the device is unplugged. I'm using the Behringer X-Touch Mini.

I have built the installer according to the instructions with MSYS, and I have installed the portmidi library with this command:

 pacman -S mingw-w64-x86_64-portmidi

I chose the installer build and used the exe to install darktable.

Platform

Additional context

Error log


-------------------

Error occurred on Tuesday, April 13, 2021 at 21:34:51.

darktable.exe caused an Access Violation at location 0000000070C41812 in module libportmidi.dll Reading from location 000000005CBCE068.

AddrPC           Params
0000000070C41812 0000000000000000 00007FFC4C43CFA4 0000000000000000  libportmidi.dll!pm_free
00007FFC4DDF55FF 0000000000000000 0000000070C4BAE0 0000000000000007  winmmbase.dll!DriverCallback
00007FFC4C43989E 0000018B5B67B140 0000000000000007 0000018B00000000  wdmaud.drv!widMessage
00007FFC4C439B89 0000018B5B67B140 0000000070C4BAE0 0000018B5B67B140  wdmaud.drv!widMessage
00007FFC4DDF8F02 0000018B5CBCE010 0000000000000000 000000000000012C  winmmbase.dll!midiInOpen
0000000070C41E48 0000018B5C7FC960 0000000000000001 00000087A1FFEEB0  libportmidi.dll!pm_free
0000000070C441AD 0000000000000001 00007FFC7453AF03 0000018B5EC87818  libportmidi.dll!Pm_OpenInput
00007FFC00A72285 0000000000000000 00000087A1FFEEB0 00007FFC09EB94C4  libmidi.dll!midi_open_devices
00007FFC00A72486 00007FFC09EB94C0 0000000000000000 0000018B519B8800  libmidi.dll!gui_init
00007FFC09D93592 00000000000000B0 0000018B4F5D0CC0 0000000000000000  libdarktable.dll!dt_lib_init_presets
00007FFC09BB7D99 0000000000000000 00000000000001D0 00007FFC09D90AD0  libdarktable.dll!dt_module_load_modules
00007FFC09D93B8C 0000000000000004 0000000000000004 0000000000000000  libdarktable.dll!dt_lib_init
00007FFC09B227EF 00007FFC00000001 0000018B4F63F830 00007FFC00000001  libdarktable.dll!dt_init
00007FF6BFB02A79 00007FF6BFB01670 0000000000000010 0000000000000000  darktable.exe!0x7ff600002a79
00007FF6BFB015C5 0000000000000050 0000000000000000 00007FF6BFB070A0  darktable.exe!0x7ff6000015c5
00007FF6BFB013E4 0000000000000000 0000000000000000 0000000000000000  darktable.exe!0x7ff6000013e4
00007FF6BFB01516 0000000000000000 0000000000000000 0000000000000000  darktable.exe!0x7ff600001516
00007FFC85BC7034 0000000000000000 0000000000000000 0000000000000000  KERNEL32.DLL!BaseThreadInitThunk
00007FFC86482651 0000000000000000 0000000000000000 0000000000000000  ntdll.dll!RtlUserThreadStart

darktable.exe   2.7.0.8784
ntdll.dll       10.0.19041.844
KERNEL32.DLL    10.0.19041.804
KERNELBASE.dll  10.0.19041.804
msvcrt.dll      7.0.19041.546
libintl-8.dll   0.19.8.0
ADVAPI32.dll    10.0.19041.610
sechost.dll     10.0.19041.789
RPCRT4.dll      10.0.19041.746
libdarktable.dll
GDI32.dll       10.0.19041.746
win32u.dll      10.0.19041.867
gdi32full.dll   10.0.19041.746
msvcp_win.dll   10.0.19041.789
ucrtbase.dll    10.0.19041.789
USER32.dll      10.0.19041.746
ole32.dll       10.0.19041.746
combase.dll     10.0.19041.844
libglib-2.0-0.dll   2.68.1.0
PSAPI.DLL       10.0.19041.546
SHELL32.dll     10.0.19041.844
WS2_32.dll      10.0.19041.546
libiconv-2.dll  1.16.0.0
libcairo-2.dll
exchndl.dll     0.9.2.0
libgdk_pixbuf-2.0-0.dll 2.42.2.0
libgdk-3-0.dll  3.24.27.0
IMM32.dll       10.0.19041.546
SETUPAPI.dll    10.0.19041.844
cfgmgr32.dll    10.0.19041.546
bcrypt.dll      10.0.19041.662
libgio-2.0-0.dll    2.68.1.0
SHLWAPI.dll     10.0.19041.746
libgobject-2.0-0.dll    2.68.1.0
libharfbuzz-0.dll
libgtk-3-0.dll  3.24.27.0
libpango-1.0-0.dll  1.48.4.0
libpangocairo-1.0-0.dll 1.48.4.0
zlib1.dll
comdlg32.dll    10.0.19041.844
shcore.dll      10.0.19041.746
libwinpthread-1.dll 1.0.0.0
libgcc_s_seh-1.dll
libstdc++-6.dll
libgomp-1.dll
libavif.dll
libcurl-4.dll
libexiv2.dll
CRYPT32.dll     10.0.19041.844
libgmodule-2.0-0.dll    2.68.1.0
WLDAP32.dll     10.0.19041.546
libgphoto2_port-12.dll
libgphoto2-6.dll
libGraphicsMagick-3.dll
libicuin68.dll
libicuuc68.dll
libIlmImf-2_5.dll
libjpeg-8.dll
libjson-glib-1.0-0.dll
libopenjp2-7.dll
liblcms2-2.dll
libpng16-16.dll
libpugixml.dll  1.11.0.0
librsvg-2-2.dll
libsecret-1-0.dll
libsoup-2.4-1.dll
libtiff-5.dll
libsqlite3-0.dll
libxml2-2.dll
libpcre-1.dll
MSIMG32.dll     10.0.19041.546
libfontconfig-1.dll
libfreetype-6.dll   2.10.4.0
libpixman-1-0.dll
mgwhelp.dll     0.9.2.0
VERSION.dll     10.0.19041.546
dwmapi.dll      10.0.19041.746
gdiplus.dll     10.0.19041.789
libcairo-gobject-2.dll
WINMM.dll       10.0.19041.546
libepoxy-0.dll
libfribidi-0.dll
DNSAPI.dll      10.0.19041.746
IPHLPAPI.DLL    10.0.19041.546
libpangowin32-1.0-0.dll 1.48.4.0
libffi-7.dll
USP10.dll       10.0.19041.546
libgraphite2.dll
libthai-0.dll
libpangoft2-1.0-0.dll   1.48.4.0
COMCTL32.dll    6.10.19041.844
libatk-1.0-0.dll    2.36.0.0
WINSPOOL.DRV    10.0.19041.746
libaom.dll
libdav1d.dll    5.0.1.0
rav1e.dll
libexpat-1.dll
libbrotlidec.dll
libcrypto-1_1-x64.dll   1.1.1.11
libidn2-0.dll
libnghttp2-14.dll
libpsl-5.dll
libssh2-1.dll
libzstd.dll
libssl-1_1-x64.dll  1.1.1.11
libltdl-7.dll
libsystre-0.dll
libexif-12.dll
libbz2-1.dll
libHalf-2_5.dll
libicudt68.dll
libIex-2_5.dll
libIlmThread-2_5.dll
libImath-2_5.dll
libgcrypt-20.dll    1.9.2.0
USERENV.dll     10.0.19041.572
libdeflate.dll
liblzma-5.dll   5.2.5.0
libwebp-7.dll
dbghelp.dll     10.0.19041.867
libdatrie-1.dll
libbrotlicommon.dll
libunistring-2.dll  0.9.10.0
libtre-5.dll
libgpg-error-0.dll  1.41.0.0
dbgcore.DLL     10.0.19041.789
CRYPTBASE.DLL   10.0.19041.546
CRYPTSP.dll     10.0.19041.546
rsaenh.dll      10.0.19041.546
bcryptPrimitives.dll    10.0.19041.662
NSI.dll         10.0.19041.610
windows.storage.dll 10.0.19041.844
Wldp.dll        10.0.19041.662
kernel.appcore.dll  10.0.19041.546
uxtheme.dll     10.0.19041.746
OLEAUT32.dll    10.0.19041.804
clbcatq.dll     2001.12.10941.16384
propsys.dll     7.0.19041.867
profapi.dll     10.0.19041.844
mswsock.dll     10.0.19041.546
MSCTF.dll       10.0.19041.867
DEVOBJ.dll      10.0.19041.546
WINTRUST.dll    10.0.19041.804
MSASN1.dll      10.0.19041.546
OpenCL.dll      2.2.8.0
AppXDeploymentClient.dll    10.0.19041.844
nvopencl64.dll  27.21.14.6109
cryptnet.dll    10.0.19041.546
nvapi64.dll     27.21.14.6109
nvcompiler64.dll    27.21.14.6109
winhttp.dll     10.0.19041.844
Windows.ApplicationModel.dll    10.0.19041.746
twinapi.appcore.dll 10.0.19041.746
Windows.FileExplorer.Common.dll 10.0.19041.867
iertutil.dll    11.0.19041.844
mssprxy.dll     7.0.19041.844
IconCodecService.dll    10.0.19041.1
WindowsCodecs.dll   10.0.19041.867
libpixbufloader-png.dll
mrmcorer.dll    10.0.19041.746
windows.staterepositorycore.dll 10.0.19041.844
mscms.dll       10.0.19041.746
ColorAdapterClient.dll  10.0.19041.546
bcp47mrm.dll    10.0.19041.867
icm32.dll       10.0.19041.546
Windows.UI.dll  10.0.19041.746
WindowManagementAPI.dll
TextInputFramework.dll  10.0.19041.844
InputHost.dll   10.0.19041.746
wintypes.dll    10.0.19041.844
CoreMessaging.dll   10.0.19041.746
CoreUIComponents.dll    10.0.19041.546
ntmarta.dll     10.0.19041.546
libdarkroom.dll
libknight.dll
liblighttable.dll
libmap.dll
libosmgpsmap-1.0-1.dll
libslideshow.dll
libtethering.dll
libavif.dll
libcopy.dll
libexr.dll
libj2k.dll
libjpeg.dll
libpdf.dll
libpfm.dll
libpng.dll
libppm.dll
libtiff.dll
libwebp.dll
libxcf.dll
libdisk.dll
libemail.dll
libgallery.dll
liblatex.dll
libpiwigo.dll
libashift.dll
libatrous.dll
libbasecurve.dll
libbasicadj.dll
libbilat.dll
libbilateral.dll
libbloom.dll
libborders.dll
libcacorrect.dll
libcensorize.dll
libchannelmixer.dll
libchannelmixerrgb.dll
libclahe.dll
libclipping.dll
libcolisa.dll
libcolorbalance.dll
libcolorbalancergb.dll
libcolorchecker.dll
libcolorcontrast.dll
libcolorcorrection.dll
libcolorin.dll
libcolorize.dll
libcolormapping.dll
libcolorout.dll
libcolorreconstruct.dll
libcolortransfer.dll
libcolorzones.dll
libdefringe.dll
libdemosaic.dll
libdenoiseprofile.dll
libdither.dll
libequalizer.dll
libexposure.dll
libfilmic.dll
libfilmicrgb.dll
libfinalscale.dll
libflip.dll
libgamma.dll
libglobaltonemap.dll
libgraduatednd.dll
libgrain.dll
libhazeremoval.dll
libhighlights.dll
libhighpass.dll
libhotpixels.dll
libinvert.dll
liblens.dll
liblensfun.dll
liblevels.dll
libliquify.dll
liblowlight.dll
liblowpass.dll
libmask_manager.dll
libmonochrome.dll
libnegadoctor.dll
libnlmeans.dll
liboverexposed.dll
libprofile_gamma.dll
librawdenoise.dll
librawoverexposed.dll
librawprepare.dll
librelight.dll
libretouch.dll
librgbcurve.dll
librgblevels.dll
librotatepixels.dll
libscalepixels.dll
libshadhi.dll
libsharpen.dll
libsoften.dll
libsplittoning.dll
libspots.dll
libtemperature.dll
libtonecurve.dll
libtoneequal.dll
libtonemap.dll
libvelvia.dll
libvibrance.dll
libvibrancergb.dll
libvignette.dll
libwatermark.dll
libzonesystem.dll
libbackgroundjobs.dll
libcamera.dll
libcollect.dll
libcolorlabels.dll
libcolorpicker.dll
libcopy_history.dll
libdarktable_label.dll
libduplicate.dll
libexport.dll
libfilmstrip.dll
libfilter.dll
libgeotagging.dll
libglobal_toolbox.dll
libhinter.dll
libhistogram.dll
libhistory.dll
libimage.dll
libimage_infos.dll
libimport.dll
libioporder.dll
liblighttable_mode.dll
liblive_view.dll
liblocation.dll
libmap_locations.dll
libmap_settings.dll
libmasks.dll
libmetadata.dll
libmetadata_view.dll
libmidi.dll
libportmidi.dll
winmmbase.dll   10.0.19041.1
MMDevAPI.DLL    10.0.19041.789
wdmaud.drv      10.0.19041.1
AVRT.dll        10.0.19041.546
ksuser.dll      10.0.19041.1
AUDIOSES.DLL    10.0.19041.789
powrprof.dll    10.0.19041.546
UMPDC.dll
msacm32.drv     10.0.19041.488
MSACM32.dll     10.0.19041.1
midimap.dll     10.0.19041.488
TextShaping.dll

Windows 10.0.19041
DrMingw 0.9.2
dterrahe commented 3 years ago

Unfortunately there is a known bug in the latest current official portmidi release, which is quite old, that affects MINGW64. It is resolved in the later development releases, but those are not packaged for MINGW. You can download and install it yourself from here https://sourceforge.net/p/portmedia/code/HEAD/tree/portmidi/trunk/ or if you want you can use the version I compiled myself (with very little knowledge of MSYS2 so it was a journey): mingw-w64-x86_64-portmidi-234-1-any.pkg.tar.zst.zip

GitHub doesn't allow uploading zst files so you need to unzip before installing using pacman -U.

jannekem commented 3 years ago

Thanks, that solved it!

That info could be added to the PR so that anyone else testing this on Windows would find it too.

I'm able to configure both A and B layers to different functions, which is really nice. Sometimes the value jumps to one end after switching layers but other than that it works really well. I also have a spare Launchpad that I could test a little but I'm not sure if anyone would actually want to use it for image editing.

dterrahe commented 3 years ago

You are right, I should have added the info to the PR after the problem developed. Initially all worked well under windows as well, until I made the change to open all midi devices at the same time (you should be able to use both the x-touch and launchpad together). That triggered the crash, but I only found out much later and was still hoping to work around it at some point. Having had no feedback from windows users even though it must have been broken for a while I assumed/hoped that nobody had tried it anyway...

Now I've put a link in the PR to this topic.

Midi/device support needs further development to make it fully configurable and support many types of devices each with their own quirks. I may be able to somewhat fix the jumping when switching between A and B, but it can't be completely avoided because of the way the x-touch firmware ignores any updates received for the "invisible" bank.

github-actions[bot] commented 3 years ago

This issue did not get any activity in the past 30 days and will be closed in 365 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.

dterrahe commented 2 years ago

PortMidi 234 is now available in MSYS2 (https://packages.msys2.org/package/mingw-w64-x86_64-portmidi?repo=mingw64) which resolves this issue.