I have made this solution:
The GPIO driver für DB9 had to be installed manually, because the one included in retropie did not work (maybe because of a newer kernel after some updates)
I also made an external usb to two DB9 adapter, bought here (you have to solder it yourself)
Both solutions work flawless inside Retropie (testet with C64, Atari 2600, Atari ST)… except in UAE4ALL2.
Concerning UAE4ALL2 I made some research, but with no pleasing result:
I installed different forks of UAE4ALL2 but all of them have the same problem… hardcoded inputs.
I did a request at one of the most promising forks called UAE4ARM:
So it looks like we have to hope and wait.