[Xposed Framework Modules] eruben:
So with no media types tick it works fine.

Please find the log (with media types):

XMSO: Received intent Intent { act=pref-xmso flg=0x10 }
XMSO: Reloading settings due to broadcast.
Reloaded preferences: {pref_run_media_scanner_as_foreground_service_state=true, pref_prevent_repetetive_scans_state=true, pref_restrict_directories_to_scan_state=true, pref_log_to_xposed_log_state=true, pref_show_results_state=true, pref_logging_enabled_state=false, pref_restrict_to_certain_media_types_state=true, pref_run_media_scanner_with_background_thread_priority_state=true}
XMSO: Intent Intent { act=com.thomashofmann.xposed.mediascanneroptimizer.SCAN_EXTERNAL flg=0x10 } received.
XMSO: Request to rescan external volume.
XMSO: Request for ApplicationContext for PID 3,610. Returning android.app.ContextImpl@4250e398.
XMSO: ContextImpl#init called with result null
XMSO: Executing hooked method init on android.app.ContextImpl@426baea8. Capturing some Context. Stacktrace is java.lang.RuntimeException: Determine Stacktrace
at com.thomashofmann.xposed.lib.XposedModule.getCurrentStackTraceString(XposedModule.java:424)
at com.thomashofmann.xposed.lib.XposedModule$5.apply(XposedModule.java:125)
at com.thomashofmann.xposed.lib.XposedModule$5.apply(XposedModule.java:122)
at com.thomashofmann.xposed.lib.AfterMethodHook.afterHookedMethod(AfterMethodHook.java:17)
at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:645)
at android.app.ContextImpl.init(Native Method)
at android.app.ContextImpl.init(ContextImpl.java:2351)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2681)
at android.app.ActivityThread.access$1700(ActivityThread.java:159)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1404)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5419)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
at dalvik.system.NativeStart.main(Native Method)

XMSO: ContextImpl#init returns with result null
XMSO: ContextImpl#init called with result null
XMSO: Executing hooked method init on android.app.ContextImpl@426baea8. Capturing some Context. Stacktrace is java.lang.RuntimeException: Determine Stacktrace
at com.thomashofmann.xposed.lib.XposedModule.getCurrentStackTraceString(XposedModule.java:424)
at com.thomashofmann.xposed.lib.XposedModule$5.apply(XposedModule.java:125)
at com.thomashofmann.xposed.lib.XposedModule$5.apply(XposedModule.java:122)
at com.thomashofmann.xposed.lib.AfterMethodHook.afterHookedMethod(AfterMethodHook.java:17)
at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:645)
at android.app.ContextImpl.init(Native Method)
at android.app.ContextImpl.init(ContextImpl.java:2351)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2681)
at android.app.ActivityThread.access$1700(ActivityThread.java:159)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1404)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5419)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
at dalvik.system.NativeStart.main(Native Method)

XMSO: ContextImpl#init returns with result null
XMSO: onStartCommand is called with Intent Intent { cmp=com.android.providers.media/.MediaScannerService (has extras) }, startId 1, filepath null, mimetype null and volume external on com.android.providers.media.MediaScannerService@425fb090
XMSO: startIdsByPid is {3610=1}
Reloaded preferences: {pref_run_media_scanner_as_foreground_service_state=true, pref_prevent_repetetive_scans_state=true, pref_restrict_directories_to_scan_state=true, pref_log_to_xposed_log_state=true, pref_show_results_state=true, pref_logging_enabled_state=false, pref_restrict_to_certain_media_types_state=true, pref_run_media_scanner_with_background_thread_priority_state=true}
XMSO: Number of start commands for external volume is 14
XMSO: Number of successful runs for external volume is 13
XMSO: scan is called for directories [/storage/emulated/0, /storage/extSdCard, /storage/UsbDriveA, /storage/UsbDriveB, /storage/UsbDriveC, /storage/UsbDriveD, /storage/UsbDriveE, /storage/UsbDriveF] on volume external
XMSO: Set service to foreground
XMSO: createSimpleNotification with title Media Scanner Optimizer, text Processing volume external, subText null
XMSO: Request for ApplicationContext for PID 3,610. Returning android.app.ContextImpl@4250e398.
XMSO: Searching directories to scan in /storage/emulated/0
XMSO: Finished searching directories to scan in /storage/emulated/0. Time: 00:00
XMSO: Searching directories to scan in /storage/extSdCard
XMSO: Marker file exists in directory /storage/extSdCard/DCIM
XMSO: Finished searching directories to scan in /storage/extSdCard. Time: 00:00
XMSO: Searching directories to scan in /storage/UsbDriveA
XMSO: Finished searching directories to scan in /storage/UsbDriveA. Time: 00:00
XMSO: Searching directories to scan in /storage/UsbDriveB
XMSO: Finished searching directories to scan in /storage/UsbDriveB. Time: 00:00
XMSO: Searching directories to scan in /storage/UsbDriveC
XMSO: Finished searching directories to scan in /storage/UsbDriveC. Time: 00:00
XMSO: Searching directories to scan in /storage/UsbDriveD
XMSO: Finished searching directories to scan in /storage/UsbDriveD. Time: 00:00
XMSO: Searching directories to scan in /storage/UsbDriveE
XMSO: Finished searching directories to scan in /storage/UsbDriveE. Time: 00:00
XMSO: Searching directories to scan in /storage/UsbDriveF
XMSO: Finished searching directories to scan in /storage/UsbDriveF. Time: 00:00
XMSO: The following directories will be scanned by MediaScanner: [/storage/extSdCard/DCIM]
XMSO: Changing thread priority in MediaScanner constructor
XMSO: In android.media.MediaScanner#processDirectory prescan
XMSO: In android.media.MediaScanner#processDirectory beforeHookedMethod
XMSO: createSimpleNotification with title Media Scanner Optimizer, text Scanning /storage/extSdCard/DCIM, subText null
XMSO: Request for ApplicationContext for PID 3,610. Returning android.app.ContextImpl@4250e398.
XMSO: Request for ApplicationContext for PID 3,610. Returning android.app.ContextImpl@4250e398.
XMSO: In android.media.MediaScanner#processDirectory prescan
XMSO: createSimpleNotification with title Media Scanner Optimizer, text Postscan, subText null
XMSO: Request for ApplicationContext for PID 3,610. Returning android.app.ContextImpl@4250e398.
XMSO: Request for ApplicationContext for PID 3,610. Returning android.app.ContextImpl@4250e398.
XMSO: scan(String[] directories, String volumeName) has finished scanning external
XMSO: createBigTextStyleNotification with title Media Scanner Optimizer, text Scan directories time 00:00, subText Volume external (Expand for details), inboxSummary Volume external
XMSO: Request for ApplicationContext for PID 3,610. Returning android.app.ContextImpl@4250e398.
XMSO: Request for ApplicationContext for PID 3,610. Returning android.app.ContextImpl@4250e398.
XMSO: stopSelf is called on MediaScannerService
XMSO: Received intent Intent { act=pref-xmso flg=0x10 }
XMSO: Reloading settings due to broadcast.
Reloaded preferences: {pref_run_media_scanner_as_foreground_service_state=true, pref_prevent_repetetive_scans_state=true, pref_restrict_directories_to_scan_state=true, pref_log_to_xposed_log_state=true, pref_show_results_state=true, pref_logging_enabled_state=false, pref_restrict_to_certain_media_types_state=true, pref_run_media_scanner_with_background_thread_priority_state=true}