I spent some time on this last night and managed to solve many problems but found a couple of others along the way…
I’ve fixed the sound issue - that was entirely my fault.
A long time ago I installed the alsa loopback driver as I was trying to get AlmusVCU and Brutefir to do multi-channel down mixing with 3d surround to stereo, the idea was to send Kodi multi-channel PCM output to the loopback device, process it and then output via the normal alsa HDMI sound device - I never did get that to work but forgot it was installed. So emulation station and emulators were trying to send to the alsa loopback device, (which was configured as the default alsa sound device) and since nothing was connected on the other side of it it failed. Whoops! Sorry for adding confusion to this thread…
For the performance issue, one of my suspicions turned out to be true - the issue with sound output was causing Amiberry video to stutter badly, as it wouldn’t have been able to sync video with the audio.
Once I fixed the sound problem performance of Amiberry is normal! Performance is at least as good as on the Pi in all tests I tried, in some cases dramatically better.
Amiga games that play smoothly on the Pi 2 also play smoothly on the Vero4k and there are no sound glitches. Demos with heavy copper effects that were slowing down to a crawl - probably 5-10fps on the Pi 2 (from a normal 50fps) are still slowing down but to more like 25-30 fps, so based on a rough estimate of fps by eye the CPU performance of the Vero4k during emulation is about 2x to 4x faster than the Pi 2 clocked at 1000Mhz, which seems about right. So there is definitely a significant performance edge for any emulator/game that might perform marginally on a Pi 2.
I managed to get the controller working properly - sort of. It turns out that both the Pi 2 (official Retropie image) and OSMC are using the xpad driver with default kernel module options, and neither uses xboxdrv by default. In fact in the Retropie docs it specifically says since Retropie 4.1 “With the recent kernel issues of xboxdrv rendering images unusable, there is an updated xpad driver which will work just as well for Xbox controllers, it’s possible it may also support Xbox One controllers.”
Why does it work properly on the Pi 2 then and not the Vero 4k ? The reason is obvious in hindsight. The Pi 2 Retropie image is running a fairly recent 4.x kernel while the Vero4k is still back on 3.14. Presumably the xpad driver in 3.14 has issues that were not fixed until later.
I tried installing the xpad driver from source in Retropie config but it didn’t seem to make any difference, (I’m not sure that it actually built anything from source to be honest - possibly not compatible with such an old 3.14 kernel)
I then tried building xboxdrv from source in Retropie config which it then installs in rc.local and that works! It installs the following line:
"/opt/retropie/supplementary/xboxdrv/bin/xboxdrv" --daemon --detach --dbus disabled --detach-kernel-driver --id 0 --led 2 --deadzone 4000 --silent --trigger-as-button --next-controller --id 1 --led 3 --deadzone 4000 --silent --trigger-as-button
I then configured the controller in emulation station without any problems - no jumping when pressing triggers etc. I also use the swap A and B options for emulation station in Retropie settings. Interestingly I can navigate emulation station using both the d-pad AND the left stick with xboxdrv, whereas xpad on the Pi 2 I have to use the d-pad to navigate emulation station.
I then went to copy my Amiberry config profiles across from my Pi 2 install and of course they didn’t work because the name of the joystick device is now different. Instead of something like “Xbox 360 wireless receiver” it’s now “Xbox Gamepad (userspace driver)”.
So I reconfigured the joystick settings in the profile and saved it and ran a couple of games and it seems to work perfectly in amiberry…
EXCEPT… every time I quit Amiberry and reload the same profile the Joystick changes back to “None” in the configuration in the emulator and I have to reconfigure the joystick settings every time I load the emulator. And I can’t figure out why. I spent over an hour trying to figure out this one problem and even went as far as renaming the device to a simpler name without parentheses in case it was choking on those but no improvement.
The joystick settings are retained correctly in the Pi 2 installation using xpad but there just seems to be something about the xboxdrv joystick device that the emulator sees that it doesn’t like when it loads the configuration profile which causes it to drop back to joystick none. It might be a bug in Amiberry but not sure how to prove that or what to do about it. In short, I’m stumped.
As the Amiga emulator is the main one I use and my joystick configuration is quite complex this is a deal breaker so I really need to figure out why it won’t keep the joystick settings that are in the profile. When I look in the profile the settings are there as they should be but seem to be ignored:
config_description=UAE default configuration
; *** Controller/Input Configuration
joyport1_friendlyname=Xbox Gamepad (userspace driver)
joyport1_amiberry_custom_none_left_shoulder=Joy1 Fire/Mouse1 Left Button
joyport1_amiberry_custom_none_right_shoulder=Joy1 2nd Button/Mouse1 Right Button
joyport1_amiberry_custom_hotkey_right_shoulder=Hard reset emulation
; *** Host-Specific
; *** Common / Paths
; *** Floppy Drives
; *** Hard Drives
; *** CD / CD32
; *** Display / Screen Setup
; *** CPU options
; *** Memory
; *** Chipset
; *** Sound Options
; *** Misc. Options
Anyone else seen a problem like this with Amiberry ?
Vice seems to work fine. I didn’t get a chance to try muppen64plus apart from briefly loading Mario 64 (which appeared very small in the bottom left corner instead of fullscreen like the Pi 2) as I wanted to look at the runcommand issue next.
I tried what I suggested with the stdin/stdout redirection and it didn’t solve the issue, I also tried the openvt command method used in mcobit’s scripts and that also did not work, so this needs more investigation. I’ll have a look at how emulation station is launched in official retropie images - I suspect it’s a systemd service with special options to attach it to the console.
So a couple of setbacks but a lot of progress overall.