Bug 255461 - multimedia/webcamd: update xpad driver
Summary: multimedia/webcamd: update xpad driver
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Hans Petter Selasky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-28 13:35 UTC by Rudolf Polzer
Modified: 2021-05-22 12:17 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (hselasky)


Attachments
Minimal patch (but see description) (458 bytes, text/plain)
2021-04-28 13:35 UTC, Rudolf Polzer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rudolf Polzer 2021-04-28 13:35:08 UTC
Created attachment 224498 [details]
Minimal patch (but see description)

I have a game pad (the current PowerA Xbox One one) that is not supported by the version of xpad.c included with webcamd.

The Linux commit that fixed things for me is this one:

https://github.com/torvalds/linux/commit/9bbd77d5bbc9aff8cb74d805c31751f5f0691ba8

A minimal fix for my concrete gamepad (USB 20d6:2802) is simply adding an XPAD_XBOXONE_VENDOR(0x20d6) line into xpad.c (attached).

Would prefer a full sync with current Linux xpad.c, of course, see https://github.com/torvalds/linux/blob/master/drivers/input/joystick/xpad.c - ideally just with a newer Linux kernel base. From looking at a diff of Linux' current xpad.c and the xpad.c from 5.10-rc6, which this port uses, it seems like the only changes were some minor refactoring (probably a kernel API change) and lots of added devices.

Tested with a game that uses the ebiten game library and a patched go-gl/glfw (requires https://github.com/go-gl/glfw/pull/318). Likely gonna work with SDL and RetroArch too, haven't tested though.
Comment 1 Hans Petter Selasky freebsd_committer 2021-04-28 14:39:57 UTC
Is this patch urgent?

Possibly it is better to update webcamd's Linux sources, instead of managing loose patches :-)

--HPS
Comment 2 Rudolf Polzer 2021-04-28 16:46:19 UTC
Not urgent as I clearly have my own workaround - I assume my personal patch in the port is rather stable, and just switched from portsnap to git so I can retain the patch for a while.
Comment 3 commit-hook freebsd_committer 2021-05-22 12:17:31 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5bb985f48091f8e8ca0a8445ef0eff6cd0fcb4e8

commit 5bb985f48091f8e8ca0a8445ef0eff6cd0fcb4e8
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2021-05-22 12:13:23 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2021-05-22 12:14:40 +0000

    multimedia/webcamd: Update Linux kernel sources used to v5.13-rc2 .

    PR:             255461
    Approved by:    pi (implicit)

 multimedia/webcamd/Makefile |  6 ++----
 multimedia/webcamd/distinfo | 10 +++++-----
 2 files changed, 7 insertions(+), 9 deletions(-)
Comment 4 Hans Petter Selasky freebsd_committer 2021-05-22 12:17:58 UTC
Please test the latest version of webcamd.