Raspberry Pi 3B+, X-Box One S Pad

The official forum for the Reicast emulator project.
Locked
Ampersat
DCEmu Newbie
DCEmu Newbie
Posts: 1
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Thu Aug 23, 2018 1:16 pm
Has thanked: 0
Been thanked: 0

Raspberry Pi 3B+, X-Box One S Pad

Post by Ampersat »

Hi there! Thanks for taking the time to look at my thread. This was originally posted on the RetroPie forums, but I think it'll get more support over here. If there's any information I can provide, please let me know. At this point, I'm under the impression it's because my controller (X-Box One S) has some issues on the Raspberry Pi or is not supported by Reicast. I use it via USB, -never- bluetooth, so it is correctly identified in pretty much everything, which is not the case when connecting via bluetooth.

e: Oh yeah, when I used the automap tool provided, it worked for all my X-Box One S pad's buttons, but when I tried binding the triggers, it only registered the release of the trigger, never the squeeze. The RPi is a little goofy with these, so that could be on that side of things.

As an aside, I'm pleased to see Bluecrab's name here. My real goal is to see if I can get PSO running on my RPi. I was misled by a reddit thread suggesting schtserv was the only game in town when it came to PSO, but saw Bluecrab's name come up time and again.

Pi Model 3B+
Power Supply used: official
RetroPie Version 4.4
Built From: retropie-4.4-rpi2_rpi3.img
USB Devices connected: Logitech K400+, X-Box One S controller, Logitech Ergo (mouse)
Controller used: X-Box One S controller
Error messages received: NONE
Log found in /dev/shm/runcommand.log (if relevant):
Parameters:
Executing: bash "/home/pi/RetroPie/roms/dreamcast/+Start Reicast.sh"
OMX: creating 3 buffers
OMX: audio output to 'hdmi'
OMX: underrun occurred
OMX: underrun occurred

("OMX: underrun ocurred" this repeats to 960 lines)

Guide used:

https://github.com/RetroPie/RetroPie-Se ... /Dreamcast
https://www.reddit.com/r/RetroPie/comme ... _controls/

File:
/opt/retropie/configs/dreamcast/mappings/controller_MicrosoftX-BoxOneSpad.cfg

Code: Select all

[emulator]
mapping_name = Microsoft X-Box One S pad
btn_escape = 316

[dreamcast]
btn_a = 305
btn_b = 304
btn_c = 311
btn_d = 310
btn_x = 308
btn_y = 307
btn_z = 314
btn_start = 315
axis_x = 0
axis_y = 1

[compat]
axis_dpad1_x = 16
axis_dpad1_x_inverted = no
axis_dpad1_y = 17
axis_dpad1_y_inverted = no
btn_trigger_left = 312
btn_trigger_right = 313
axis_x_inverted = no
axis_y_inverted = no
===========================================

/opt/retropie/configs/dreamcast/emu.cfg

Code: Select all

[audio]
backend = auto
disable = 0

[config]
Debug.SerialConsoleEnabled = 0
Dreamcast.Broadcast = 4
Dreamcast.Cable = 3
Dreamcast.RTC = -2128832150
Dreamcast.Region = 3
Dynarec.Enabled = 1
Dynarec.idleskip = 1
Dynarec.unstable-opt = 0
aica.LimitFPS = 1
aica.NoBatch = 0
aica.NoSound = 0
bios.UseReios = 0
pvr.MaxThreads = 3
pvr.Subdivide = 0
pvr.SynchronousRendering = 0
pvr.rend = 0
rend.UseMipmaps = 1
rend.WideScreen = 0
ta.skip = 0

[dispmanx]
height = 480
maintain_aspect = yes
width = 640

[input]
evdev_device_id_1 = 0
evdev_device_id_2 = -1
evdev_device_id_3 = -1
evdev_device_id_4 = -1
evdev_mapping_1 = /opt/retropie/configs/dreamcast/mappings/controller_MicrosoftX-BoxOneSpad.cfg
joystick_device_id = -1

[omx]
audio_hdmi = yes
audio_latency = 100

[reios]
ElfFile = 

[testing]
ta.HashCheckFile = 
ta.HashLogFile = 

[validate]
OpenGlChecks = 0
===========================================
/opt/retropie/emulators/reicast/bin/reicast.sh

Code: Select all

#!/usr/bin/env bash

# This file is part of The RetroPie Project
#
# The RetroPie Project is the legal property of its developers, whose names are
# too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source.
#
# See the LICENSE.md file at the top-level directory of this distribution and
# at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md
#

AUDIO="$1"
ROM="$2"
rootdir="/opt/retropie"
configdir="$rootdir/configs"

source "$rootdir/lib/inifuncs.sh"

function mapInput() {
    local js_device
    local js_device_num
    local ev_device
    local ev_devices
    local ev_device_num
    local device_counter
    local conf="$configdir/dreamcast/emu.cfg"
    local params=""

    # get a list of all present js device numbers and device names
    # and device count
    for js_device in /dev/input/js*; do
        js_device_num=${js_device/\/dev\/input\/js/}
        for ev_device in /dev/input/event*; do
            ev_device_num=${ev_device/\/dev\/input\/event/}
            if [[ -d "/sys/class/input/event${ev_device_num}/device/js${js_device_num}" ]]; then
                file[$ev_device_num]=$(grep --exclude=*.bak -rl "$configdir/dreamcast/mappings/" -e "= $(</sys/class/input/event${ev_device_num}/device/name)")
                if [[ -f "${file[$ev_device_num]}" ]]; then
                    #file[$ev_device_num]="${file[$ev_device_num]##*/}"
                    ev_devices[$ev_device_num]=$(</sys/class/input/event${ev_device_num}/device/name)
                    device_counter=$(($device_counter+1))
                fi
            fi
        done
    done

    # emu.cfg: store up to four event devices and mapping files
    if [[ "$device_counter" -gt "0" ]]; then
        # reicast supports max 4 event devices
        if [[ "$device_counter" -gt "4" ]]; then
            device_counter="4"
        fi
        local counter=0
        for ev_device_num in "${!ev_devices[@]}"; do
            if [[ "$counter" -lt "$device_counter" ]]; then
                counter=$(($counter+1))
                params+="-config input:evdev_device_id_$counter=$ev_device_num "
                params+="-config input:evdev_mapping_$counter=${file[$ev_device_num]} "
            fi
        done
        while [[ "$counter" -lt "4" ]]; do
            counter=$(($counter+1))
            params+="-config input:evdev_device_id_$counter=-1 "
            params+="-config input:evdev_mapping_$counter=-1 "
        done
    else
        # fallback to keyboard setup
        params+="-config input:evdev_device_id_1=0 "
        device_counter=1
    fi
    params+="-config input:joystick_device_id=-1 "
    params+="-config players:nb=$device_counter "
    echo "$params"
}

if [[ ! -f "$HOME/RetroPie/BIOS/dc_boot.bin" ]]; then
    dialog --no-cancel --pause "You need to copy the Dreamcast BIOS files (dc_boot.bin and dc_flash.bin) to the folder $biosdir to boot the Dreamcast emulator." 22 76 15
    exit 1
fi

params=(-config config:homedir=$HOME -config x11:fullscreen=1)
getAutoConf reicast_input && params+=($(mapInput))
[[ -n "$AUDIO" ]] && params+=(-config audio:backend=$AUDIO -config audio:disable=0)
[[ -n "$ROM" ]] && params+=(-config config:image="$ROM")
if [[ "$AUDIO" == "oss" ]]; then
    aoss "$rootdir/emulators/reicast/bin/reicast" "${params[@]}" >/dev/null
else
    "$rootdir/emulators/reicast/bin/reicast" "${params[@]}" >/dev/null
fi
===========================================

I also used the NullDC trick to try and fix the clock issue. (It edits dc_flash and makes a copy, which you rename and place in the BIOS folder)

reicast_input = "1" in /opt/retropie/configs/all/autoconf.cfg

Emulator: Reicast

How to replicate the problem: I ran the joystick config via command line (reicast-joyconfig) and the joystick was still functional. It was only the joystick, no buttons worked. I had a working joystick until I ran the autoconfig in RETROPIE SETUP.

I've confirmed my controller is at event0. At this point all I can guess is that this controller is just not supported. The config file looks quite a bit like a 360 controller's config provided on the wiki.
Locked