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
config_hardware=true
config_host=true
config_version=4.1.0
amiberry.rom_path=/opt/retropie/emulators/amiberry/kickstarts/
amiberry.floppy_path=/opt/retropie/emulators/amiberry/disks/
amiberry.hardfile_path=/opt/retropie/emulators/amiberry/
amiberry.cd_path=/opt/retropie/emulators/amiberry/cd32/
;
; *** Controller/Input Configuration
;
joyport0=mouse
joyport0_autofire=none
joyport0_mode=mousenowheel
joyport0_friendlyname=Mouse
joyport0_name=MOUSE0
;
joyport1=joy1
joyport1_autofire=none
joyport1_mode=djoy
joyport1_friendlyname=Xbox Gamepad (userspace driver)
joyport1_name=JOY1
joyport1_amiberry_custom_none_dpad_up=Mouse1 Up
joyport1_amiberry_custom_none_dpad_down=Mouse1 Down
joyport1_amiberry_custom_none_dpad_left=Mouse1 Left
joyport1_amiberry_custom_none_dpad_right=Mouse1 Right
joyport1_amiberry_custom_none_select=Enter GUI
joyport1_amiberry_custom_none_left_shoulder=Joy1 Fire/Mouse1 Left Button
joyport1_amiberry_custom_none_start=Pause emulation
joyport1_amiberry_custom_none_right_shoulder=Joy1 2nd Button/Mouse1 Right Button
joyport1_amiberry_custom_hotkey_right_shoulder=Hard reset emulation
;
;
;
absolute_mouse=mousehack
input.joymouse_speed_analog=2
input.joymouse_speed_digital=10
input.joymouse_deadzone=33
input.joystick_deadzone=33
input.analog_joystick_multiplier=15
input.analog_joystick_offset=-1
input.mouse_speed=100
input.autofire_speed=0
kbd_lang=us
;
; *** Host-Specific
;
amiberry.vertical_offset=-5
amiberry.hide_idle_led=0
amiberry.gfx_correct_aspect=1
amiberry.kbd_led_num=-1
amiberry.kbd_led_scr=-1
amiberry.scaling_method=-1
amiberry.use_analogue_remap=false
amiberry.use_retroarch_quit=true
amiberry.use_retroarch_menu=true
amiberry.use_retroarch_reset=true
;
; *** Common / Paths
;
use_gui=yes
kickstart_rom_file=$(FILE_PATH)/Kick13.rom
kickstart_ext_rom_file=
flash_file=
cart_file=
;
; *** Floppy Drives
;
floppy0=
floppy1=
floppy2=
floppy3=
nr_floppies=2
floppy_speed=100
;
; *** Hard Drives
;
;
; *** CD / CD32
;
cd_speed=100
;
; *** Display / Screen Setup
;
gfx_framerate=0
gfx_width=704
gfx_height=262
gfx_refreshrate=50
gfx_refreshrate_rtg=60
gfx_lores=false
gfx_resolution=hires
gfx_lores_mode=normal
gfx_linemode=none
gfx_fullscreen_amiga=false
gfx_fullscreen_picasso=false
ntsc=false
;
; *** CPU options
;
cpu_speed=real
cpu_type=68000
cpu_model=68000
cpu_compatible=true
cpu_24bit_addressing=true
fpu_no_unimplemented=true
fpu_strict=false
compfpu=false
cachesize=0
;
; *** Memory
;
chipmem_size=1
z3mapping=real
fastmem_size=0
a3000mem_size=0
mbresmem_size=0
z3mem_size=0
z3mem_start=0x40000000
bogomem_size=2
gfxcard_hardware_vblank=false
gfxcard_hardware_sprite=false
gfxcard_multithread=false
rtg_modes=0x112
;
; *** Chipset
;
chipset=ecs_agnus
chipset_refreshrate=50.000000
collision_level=playfields
chipset_compatible=A500
rtc=MSM6242B
cia_todbug=true
immediate_blits=false
waiting_blits=automatic
fast_copper=false
;
; *** Sound Options
;
sound_output=exact
sound_channels=stereo
sound_stereo_separation=7
sound_stereo_mixing_delay=0
sound_frequency=44100
sound_interpol=none
sound_filter=off
sound_filter_type=standard
sound_volume_cd=0
;
; *** Misc. Options
;
bsdsocket_emu=false
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.