@lmjiang1 hello i had this same issue with xu4 retroarena, m30 after reboot i get no pair, m30 would pair but couldnt do anything in game or ES, i updated m30, no luck.
Xu4 has only 3 ports i had a hdd connected, wifi usb, bt dongle all my usb connects gone so i thought maybe i need to connect to 3.0 usb, i bought 2 bt and same issue happen.
I then added a multi usb but it would do the same thing, i had some try m30 with thoses 20 dollar usb bt by with like super mario block design and i thought i need one of thoses, same thing happen, no pairing all what i have type above.
So i gave it about 2 months and asked again and tried again, once i had turned on the xu4 after months it paired right up like nothing had happened, so i played.
I had help and we tired to pair with switch mode and android but no luck i was fed up dude.
The guys at retroarena dont know what it is, i been waiting for about 1 month in a half but i havent bothered anymore.
But the m30 works fine with all other machines, just might be the xu4 cos someone else tired and did the same thing, might be your pi2 is the samething.
Works fine on my pi3b+ i used thme and pair just fine.
So my solution at the end since i got xu4 for saturn and just more power i put it away and ordered a pi4 and works super awesome!
I installed yabause on desktop and played dracula x.
Im sorry that it acts the way it does and i hope someone can help.