Deadlock - library scan vs track playback (Win)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mixxx |
Fix Released
|
Critical
|
Unassigned |
Bug Description
(Note: I was testing the master branch when I meant to be testing NewSoundSourceAPI. I will try to reproduce on the desired branch.)
Similar to #1445298, this affects M4A/AAC. I was playing an AAC file, then clicked "Rescan Library", then tried to load another AAC file. This apparently caused a deadlock. I verified that both threads were blocked on the same file in the debugger. The trace of the library scanner thread:
ntdll.
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
ntdll.
KernelBase.
KernelBase.
kernel32.
mfreadwrite.
mfreadwrite.
mfreadwrite.
mfreadwrite.
> soundsourcemedi
mixxx.
mixxx.
QtCored4.
msvcr120d.
msvcr120d.
kernel32.
ntdll.
ntdll.
The trace of the other thread (same as #1445298):
ntdll.
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
ntdll.
KernelBase.
KernelBase.
kernel32.
mfreadwrite.
mfreadwrite.
> soundsourcemedi
mixxx.
mixxx.
QtCored4.
msvcr120d.
msvcr120d.
kernel32.
ntdll.
ntdll.
summary: |
- Deadlock - library scan vs track playback + Deadlock - library scan vs track playback (Win) |
tags: | added: library windows |
tags: | removed: library |
Changed in mixxx: | |
status: | Fix Committed → Fix Released |
Buh! It looks like SoundSourceMedi aFoundation/ mfreadwrite. dll is not thread save.
Maybe it is caused by /github. com/mixxxdj/ mixxx/blob/ bba85f15540e277 af6fbf343fda934 95c5090c6f/ plugins/ soundsourcemedi afoundation/ soundsourcemedi afoundation. cpp#L102
https:/
Here is is recommendation to use COINIT_ MULTITHREADED /msdn.microsoft .com/de- de/library/ windows/ desktop/ ee892371% 28v=vs. 85%29.aspx
https:/
However in other place you found advises that you have to use COINIT_ APARTMENTTHREAD ED /msdn.microsoft .com/de- de/library/ windows/ desktop/ dd757929% 28v=vs. 85%29.aspx
https:/
Even if setting COINIT_ MULTITHREADED fixes the issue,
It will likely enable an extra locking layer. That may cause a priority inversion between th low priority analyzer thread and the High priority caching worker thread.
The issue seams to be difficult. Maybe it helps switching to the Callback interface. /msdn.microsoft .com/de- de/library/ windows/ desktop/ ms704787% 28v=vs. 85%29.aspx
https:/
But that is not a short term solution.