Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with HORIPAD mini4 #274

Open
Windblade-GR01 opened this issue Mar 8, 2020 · 4 comments
Open

Error with HORIPAD mini4 #274

Windblade-GR01 opened this issue Mar 8, 2020 · 4 comments

Comments

@Windblade-GR01
Copy link

Windblade-GR01 commented Mar 8, 2020

When I call glfw.Init with a Hori PS4 Mini I get this error.

GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 030000000d0f0000ee00000000000000 (HORIPAD mini4)
GLFW: Please report this bug in the Go package immediately.
@dmitshur
Copy link
Member

dmitshur commented Mar 8, 2020

The issue is either in the upstream GLFW C library (which use a different issue tracker, https://github.com/glfw/glfw/issues), or in this Go binding for it.

In order to fix it, we need to identify where the problem is. I doubt many people have the same hardware, so it's likely you're the only person who can reproduce it.

Can you try using the latest GLFW C library release, or master version, and see if it happens with it too? If so, you should report the issue in the https://github.com/glfw/glfw/issues issue tracker. Otherwise, post the C and Go programs so we can try to find out what might be different.

@pwaller
Copy link
Member

pwaller commented Mar 9, 2020

My reading of this is that we're coming through the default select case here:

glfw/v3.3/glfw/error.go

Lines 111 to 124 in e5ec435

// Holds the value of the last error.
var lastError = make(chan *Error, 1)
//export goErrorCB
func goErrorCB(code C.int, desc *C.char) {
flushErrors()
err := &Error{ErrorCode(code), C.GoString(desc)}
select {
case lastError <- err:
default:
fmt.Println("GLFW: An uncaught error has occurred:", err)
fmt.Println("GLFW: Please report this bug in the Go package immediately.")
}
}

If so that seems a bit surprising as it would imply that two errors have been fed into the pipe (and we're seeing the second of them?).

@Windblade-GR01:

  1. What is the minimal procedure to reproduce? Do I need to plug in a Hori PS4? Do I need to do anything other than call glfw.Init? Is there any other setup required?
  2. Please can you try instrumenting the following line of code to print every error you see, and report back?

err := &Error{ErrorCode(code), C.GoString(desc)}

@SolarLune
Copy link

SolarLune commented Apr 19, 2020

Hello, I'm getting the same error with Ebiten and an 8BitDo SF30 Pro gamepad on Linux (Solus OS).

solarlune@solarlune ~/Documents/Projects/Go/LDJam46 $ go run ./test
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
...
...
...
panic: InvalidValue: Invalid button in gamepad mapping 050000005e040000e002000003090000 (Xbox One Wireless Controller)

goroutine 1 [running]:
github.com/go-gl/glfw/v3.3/glfw.acceptError(0xc00014de58, 0x1, 0x1, 0xc000159410, 0xc00000e160)
        /home/solarlune/go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/error.go:174 +0x216
github.com/go-gl/glfw/v3.3/glfw.Init(0x55176dd2, 0xbefbdaa537231e59)
        /home/solarlune/go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/glfw.go:37 +0x54
github.com/hajimehoshi/ebiten/internal/glfw.Init(...)
        /home/solarlune/go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/glfw/glfw_notwindows.go:291
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.initialize(0xc000024450, 0xc000024420)
        /home/solarlune/go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:125 +0x26
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.init.1()
        /home/solarlune/go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:115 +0x22
exit status 2

Worth noting is that the controller identifies as an Xbox One Wireless Controller in Antimicro and in the terminal output. This issue does not happen with an iPega 9118 (golden d-pad Xbox-style) mobile controller connected to my computer over Bluetooth, or to a PXN 9607S (Switch Pro Controller, also works wired through USB). The iPega is reported as just a "PG-9118" through Antimicro, and the PXN is reported as being an "X360 Controller".

Here's a minimal reproduction main.go using Ebiten:

package main

import (
	"github.com/hajimehoshi/ebiten"
)

type Game struct{}

func (game *Game) Update(screen *ebiten.Image) error {
	return nil
}

func (game *Game) Layout(w, h int) (int, int) {
	return 320, 240
}

func main() {
	ebiten.RunGame(&Game{})
}

The problem happens when "plugging in" (connecting) my 8BitDo controller, regardless of when (while the application is running, or beforehand). The problem persists until I power down the controller and my system stops recognizing it; after that, the program can run normally. I'm wondering if it's something like the controllers have one extra button that isn't there in the default mapping or something...?

Any ideas?

EDIT: More interesting information - the crash DOESN'T happen with the 8BitDo controller if I connect it via USB; then it identifies as an "X360 Controller". It only happens if connecting wirelessly.

@aspendlove
Copy link

seems related to #292

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants