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

The official forum for the Reicast emulator project.

Moderator: Reicast Staff

Post Reply
DCEmu Newbie
DCEmu Newbie
Posts: 1
Joined: Thu Aug 23, 2018 1:16 pm
Has liked: 0
Been liked: 0

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

Post by Ampersat » Thu Aug 23, 2018 1:31 pm

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):
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/


Code: Select all

mapping_name = Microsoft X-Box One S pad
btn_escape = 316

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

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


Code: Select all

backend = auto
disable = 0

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

height = 480
maintain_aspect = yes
width = 640

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

audio_hdmi = yes
audio_latency = 100

ElfFile = 

ta.HashCheckFile = 
ta.HashLogFile = 

OpenGlChecks = 0

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


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
        for ev_device in /dev/input/event*; do
            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

    # 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
        local counter=0
        for ev_device_num in "${!ev_devices[@]}"; do
            if [[ "$counter" -lt "$device_counter" ]]; then
                params+="-config input:evdev_device_id_$counter=$ev_device_num "
                params+="-config input:evdev_mapping_$counter=${file[$ev_device_num]} "
        while [[ "$counter" -lt "4" ]]; do
            params+="-config input:evdev_device_id_$counter=-1 "
            params+="-config input:evdev_mapping_$counter=-1 "
        # fallback to keyboard setup
        params+="-config input:evdev_device_id_1=0 "
    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

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
    "$rootdir/emulators/reicast/bin/reicast" "${params[@]}" >/dev/null

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.
Post Reply