Rockbox Technical Forums

Support and General Use => Plugins/Viewers => Topic started by: dhugas on May 18, 2022, 04:46:57 PM

Title: [lastfm_scrobbler] plugin creates a *PANIC* when USB unplugs.
Post by: dhugas on May 18, 2022, 04:46:57 PM
Hello,

I have trouble with the [lastfm_scrobbler] plugin. When it is running and the device is plugged via USB to the computer, the computer doesn't detect the device and it's inaccessible. If the USB is unplugged, it shows a *PANIC* mount: 0 error message. I can't unmount it before unplugging because the computer does not recognize the device. On the other hand, if [lastfm_scrobbler] is stopped and a USB pugged in, the computer detects the device, it can be mounted and files accessed. When it is unmounted and the USB unplugged, the device resumes its normal function.

The device is an xDuoo X3ii runing 2f71571c0a daily build, the last one as of today.
Title: Re: [lastfm_scrobbler] plugin creates a *PANIC* when USB unplugs.
Post by: Bilgus on May 18, 2022, 10:22:41 PM
Can you try the battery_bench plugin and see if you can connect to USB while it is running?
it uses a similar mechanism and should tell us if its the device failing to notify USB or the plugin
Title: Re: [lastfm_scrobbler] plugin creates a *PANIC* when USB unplugs.
Post by: dhugas on May 19, 2022, 06:03:13 PM
I have tried it and it has the same behavior. I've checked that lastfm_scrobbler is not running, I turn on battery_bench and when the USB is connected, the computer does not detect it and there is a *PANIC* mount:0 when I disconnect the USB. If battery_bench is not running and neither lastfm_scrobbler is, everything is fine.
Title: Re: [lastfm_scrobbler] plugin creates a *PANIC* when USB unplugs.
Post by: Bilgus on May 19, 2022, 11:32:02 PM
dhugas I think what this means is that the device is not sending USB events

could you try running Plugins>demos>cube and see if it exits on USB plug to see if maybe its just TSR plugins not getting events

Title: Re: [lastfm_scrobbler] plugin creates a *PANIC* when USB unplugs.
Post by: amachronic on May 21, 2022, 10:20:14 AM
*PANIC* mount:0 is from usb.c L265 (https://github.com/Rockbox/rockbox/blob/master/firmware/usb.c#L265) so I can't see why the scrobbler would affect it... more likely it's noise from the usb unplug making the card detect look like the SD card is not present, possibly combined with a timing issue with the TSR threads.

dhugas is this panic reproducible or intermittent? and does it happen even if you disable the scrobbler?
Title: Re: [lastfm_scrobbler] plugin creates a *PANIC* when USB unplugs.
Post by: dhugas on May 22, 2022, 12:32:05 PM
Hello,

Sorry for the late response.

The *PANIC* is reproducible, always. I've run the cube plugin and it happens the same as the lastfm and battery_bench plugin: the cube is turning, whin I plug the USB the cube disappears, the USB connection icon in the xDuoo appears and the computer does not detect the device. When I unplug it, the *PANIC* error appears.

It's not a big issue for me, I just have to remember to stop any plugin before I plug it to my computer.

Thank you for looking into it!
Title: Re: [lastfm_scrobbler] plugin creates a *PANIC* when USB unplugs.
Post by: amachronic on May 22, 2022, 04:40:33 PM
Thanks, no worries. I forgot to ask before - did you have USB Mode set to Ask? It's under settings -> general -> system. That is known not to work and might cause a problem like this. (That setting really needs to be removed...)

If it's not that, I think this probably a hardware-specific issue. There's a few things I could think of that might help, I'll post again when I have some fixes you can test.
Title: Re: [lastfm_scrobbler] plugin creates a *PANIC* when USB unplugs.
Post by: amachronic on May 31, 2022, 01:49:46 PM
Uh, whoops, I was going to post a build but I just re-read the thread and realized you are using an xDuoo x3ii. I thought it was an M3K; I must've gotten mixed up with the other scrobbler thread.

I don't have an x3ii, and it's a hosted port, so unfortunately the stuff I did won't help with your problem. I'd guess this bug could affect other hosted targets since they mostly have similar code. Do you have any other players you can test with?
Title: Re: [lastfm_scrobbler] plugin creates a *PANIC* when USB unplugs.
Post by: dhugas on June 02, 2022, 03:21:18 PM
Hi amachronic,

No, I have no other devices I can test this buid on. The USB mode is set on Mass Storage, by the way.