opencubicplayer icon indicating copy to clipboard operation
opencubicplayer copied to clipboard

Hang after playing the second or third song from modland.com

Open cranderson opened this issue 1 year ago • 4 comments

After selecting the second or third (or more) song from modland.com in the file browser, ocp hangs. This happens no matter which song(s) are selected--even the same song that works fine the first time might hang the second time (after clearing the cached copy so it gets downloaded again)--I compared the two downloaded copies and they are identical. This is on Fedora 41 x86_64.

cranderson avatar Jan 01 '25 22:01 cranderson

Running with this branch: https://github.com/mywave82/opencubicplayer/commits/download_debug/ as follows:

strace -o ocp-strace2.log -ff ocp 2> ocp2.log

produced the attached log files. ocp2.log ocp-strace2.log.732067.txt ocp-strace2.log.732066.txt ocp-strace2.log.731800.txt ocp-strace2.log.731799.txt ocp-strace2.log.731798.txt ocp-strace2.log.731797.txt ocp-strace2.log.731796.txt ocp-strace2.log.731401.txt

cranderson avatar Jan 01 '25 22:01 cranderson

I did try to debug this during the spring. I do suspect the issue is in the threading code of pipewire, and OCP is just lucky/unlucky to trigger hanging behaviour.

Optimization level of OCP changed the behaviour. In practice this changes how much of the code and data cache is used, and thereby how multithreading behaves. Pipewire uses multiple threads.

If using helgrind (cache debugging tool), it throws multiple issues. Some of them being in my eyes real potential issues, others are result of pipewire implementing direct memory writes. I'm not experienced enough to fully know how good that logic works, and it might imply that only some key-values are "thread-safe" while the data not written this way might actually not be thread-safe.

mywave82 avatar Sep 07 '25 19:09 mywave82