Bug 491595

Summary: Amarok 3.x does not recognize MTP devices
Product: [Applications] amarok Reporter: rnet723
Component: Collections/MTP playerAssignee: Amarok Bugs <amarok-bugs-null>
Status: REPORTED ---    
Severity: normal CC: tuomas
Priority: NOR    
Version First Reported In: 3.1.0   
Target Milestone: kf5   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description rnet723 2024-08-11 20:17:14 UTC
SUMMARY
The MTP library does not show up in Local Music collections when the phone is plugged into a computer. Phone filesystem is navigatable with Dolphin. MTP plug-in is active in Amarok settings.

STEPS TO REPRODUCE
1. Start Amarok
2. Go to Media Sources -> Local Music
3. Plug an MTP device

OBSERVED RESULT
MTP Devices is not shown in Local Music

EXPECTED RESULT
MTP device should be available in collections

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSUSE KDE:Extra KF6
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Amarok: 3.1.0

ADDITIONAL INFORMATION
Comment 1 Tuomas Nurmi 2024-12-31 12:56:03 UTC
Testing with some MTP devices. Some don't get added to device list,
log displays messages like
libusb_claim_interface() reports device is busy, likely in use by GVFS or KDE MTP device handling alreadyLIBMTP PANIC: Unable to initialize device
amarok:       [MtpHandler] Unable to open raw device:  1

Various Internet sources (e.g. https://wiki.archlinux.org/title/Media_Transfer_Protocol#kio-mtp_being_called_simultaneously_by_different_services ) suggest that having multiple things access MTP simultaneously is problematic. Tried terminating kiod6, after which Amarok recognized the problematic MTP device. Not sure how to fix properly.
Comment 2 Tuomas Nurmi 2025-01-04 15:52:30 UTC
Looked a bit deeper. There doesn't seem to be a way to get any nice error messages from libmtp, so at most there could perhaps be a "something went wrong when trying to connect to an MTP device [device name]" warning if device setup fails. I'm not sure if that'd be ok, or if it will provide excessive warnings in some cases. Anyhow, would require surprisingly much effort, so I won't implement it at least right now.