Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
The_Franz
Aug 8, 2003

Mr Dog posted:

No that's a dada-esque abomination of a solution. The way to do it correctly is to write correct HID report descriptors.

it's been a couple of years since i messed with raw hid descriptor code, but i don't see anything glaringly wrong there. it reports the device as a keyboard which sends the full device state in one report. what exactly makes this an abomination?

it's much cleaner than most of the unholy usb nkey-rollover hack-solutions some manufactures used in the past.

Adbot
ADBOT LOVES YOU

Sapozhnik
Jan 2, 2005

Nap Ghost
oh I meant pretending to be 10 keyboards is the horrible solution

pseudorandom name
May 6, 2007

well, it isn't perfect, they split the keyboard across two different USB interfaces for some reason

interface #1 has two different packet formats, one packs the power keys into three bits, the other packs that list of media keys into 24 bits (plus a vendor-specific Feature that does who-knows-what)

interface #2 packs the modifier keys into eight bits followed by the entire keyboard state packed into 104 bits, and also defines an output packet for setting the LEDs

but, yeah, this is basically fine

edit: in theory, the mechanical switch / hotkey that toggles between HID BP and NKRO is unnecessary because the keyboard can just power up in BP mode and then automatically switch to NKRO mode when the OS HID driver takes over, but they probably ran into trouble with the various OS HID drivers not doing what the HID specs says they should do

edit 2: what do you know, the Linux HID driver has no mention of the Set_Protocol request. I wonder if Windows works correctly?

pseudorandom name fucked around with this message at 19:40 on Feb 15, 2016

The_Franz
Aug 8, 2003

pseudorandom name posted:

well, it isn't perfect, they split the keyboard across two different USB interfaces for some reason

interface #1 has two different packet formats, one packs the power keys into three bits, the other packs that list of media keys into 24 bits (plus a vendor-specific Feature that does who-knows-what)

interface #2 packs the modifier keys into eight bits followed by the entire keyboard state packed into 104 bits, and also defines an output packet for setting the LEDs

but, yeah, this is basically fine

edit: in theory, the mechanical switch / hotkey that toggles between HID BP and NKRO is unnecessary because the keyboard can just power up in BP mode and then automatically switch to NKRO mode when the OS HID driver takes over, but they probably ran into trouble with the various OS HID drivers not doing what the HID specs says they should do

that's normal for all multimedia keyboards: one device for the real keyboard part and another for the media keys. they have to since usage codes for the consumer and keyboard pages overlap.

pseudorandom name
May 6, 2007

The_Franz posted:

that's normal for all multimedia keyboards: one device for the real keyboard part and another for the media keys. they have to since usage codes for the consumer and keyboard pages overlap.

yeah, but you can switch Usage Pages between reports, it does that for the power keys and the multimedia keys in the first descriptor

for some reason the actual keyboard keys are in a completely separate report descriptor (I used "interface" previously, but I remembered that has actual meaning in the USB spec)

Solaris (well, Illumos) correctly switches keyboards from Boot Protocol to Report mode, in case you were wondering

The_Franz
Aug 8, 2003

pseudorandom name posted:

yeah, but you can switch Usage Pages between reports, it does that for the power keys and the multimedia keys in the first descriptor

for some reason the actual keyboard keys are in a completely separate report descriptor (I used "interface" previously, but I remembered that has actual meaning in the USB spec)

Solaris (well, Illumos) correctly switches keyboards from Boot Protocol to Report mode, in case you were wondering

the spacing is weird, but it looks like the system control keys are in report 2 and the multimedia and keyboard keys are both in report 3.

pseudorandom name
May 6, 2007

the spacing is weird because I copied and pasted two separate descriptors into http://eleccelerator.com/usbdescreqparser/

the original is here: http://www.spinics.net/lists/linux-input/msg33953.html

Sapozhnik
Jan 2, 2005

Nap Ghost

pseudorandom name posted:

edit 2: what do you know, the Linux HID driver has no mention of the Set_Protocol request. I wonder if Windows works correctly?

~*~what does your heart tell you~*~

The_Franz
Aug 8, 2003

pseudorandom name posted:

the spacing is weird because I copied and pasted two separate descriptors into http://eleccelerator.com/usbdescreqparser/

the original is here: http://www.spinics.net/lists/linux-input/msg33953.html

oh, yeah that's kind of weird then.

Notorious b.s.d.
Jan 25, 2003

by Reene

Mr Dog posted:

~*~what does your heart tell you~*~

it tells me that linux probably does whatever is necessary to work with real hardware in the field, even if it's completely loving bass ackwards

suck my woke dick
Oct 10, 2012

:siren:I CANNOT EJACULATE WITHOUT SEEING NATIVE AMERICANS BRUTALISED!:siren:

Put this cum-loving slave on ignore immediately!

Mr Dog posted:

Well, also Windows 95 OSR2 supported "USB" in that it supported HID BP devices and nothing else. Windows 95 OSR2 hasn't been relevant for a while either.

Backwards Compatibility :byodood:

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
please join my twitter campaign to stop the involuntary proliferation of selinux to users who don't need or want it, #inselinux

The_Franz
Aug 8, 2003

Notorious b.s.d. posted:

it tells me that linux probably does whatever is necessary to work with real hardware in the field, even if it's completely loving bass ackwards

no kidding, a surprisingly big chunk of the hid system had to be overhauled to get the dualshock 3 and 4 working properly in bluetooth mode because some goofball at sony decided to do things backwards and use the control channel instead of the interrupt channel for output reports like every other bluetooth device.

the ds4 also needed a completely rewritten bluetooth hid descriptor because as soon as you actually send an output report to the ds4 it completely changes it's operating mode and the basic descriptor it initially sends doesn't map to anything anymore.

edit: oh, bluez had to add a hacked path for these devices too, because sony apparently thinks that doing things like "following the bluetooth spec" doesn't apply to them

The_Franz fucked around with this message at 21:40 on Feb 15, 2016

pseudorandom name
May 6, 2007

code:
/*
 * Some devices don't like this and crash. I don't know of any devices
 * needing this, so it is disabled for now.
 */

#if 0
        if (interface->bInterfaceSubClass == 1)
                usb_set_protocol(dev, hid->ifnum, 1);
#endif

Sapozhnik
Jan 2, 2005

Nap Ghost
See also: anything to do with ACPI

https://mjg59.dreamwidth.org/32369.html

FlapYoJacks
Feb 12, 2009

MALE SHOEGAZE posted:

please join my twitter campaign to stop the involuntary proliferation of selinux to users who don't need or want it, #inselinux

SELinux is cool and good and everybody should use it.

BobHoward
Feb 13, 2012

The only thing white people deserve is a bullet to their empty skull

Mr Dog posted:

Except, much like PS/2, HID BP hasn't been relevant since the early 2000s since I'm pretty sure every single PC firmware out there has been able to understand full HID since forever ago.

oh, you sweet summer childe :allears:

Notorious b.s.d.
Jan 25, 2003

by Reene

ratbert90 posted:

SELinux is cool and good and everybody should use it.

ahmeni
May 1, 2005

It's one continuous form where hardware and software function in perfect unison, creating a new generation of iPhone that's better by any measure.
Grimey Drawer

ratbert90 posted:

SELinux is cool and good and everybody should use it.

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
I installed Solaris 11.3 in a VM and made the mistake of trying to use its graphical interface, which evidently switched to GNOME 2.x sometime after Solaris 9

I now understand completely why Sun no longer makes workstations, even the Soviet-brutalist nightmare of CDE and Motif is a marked improvement over that tire fire

Sapozhnik
Jan 2, 2005

Nap Ghost
Vulkan graphics API spec and reference implementations are out

https://www.khronos.org/registry/vulkan/
https://01.org/linuxgraphics/blogs/jekstrand/2016/open-source-vulkan-drivers-intel-hardware

:toot:

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
I can't wait for it to work on raspberry pi!

Sapozhnik
Jan 2, 2005

Nap Ghost
don't think VideoCore4 has sufficient hardware capabilities to support it but i might be mistaken

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
It does, but Broadcom axed their entire VC team, so....

Sapozhnik
Jan 2, 2005

Nap Ghost
I mean RPi has been a silicon dead end turned Broadcom marketing exercise from day one so that's nothing new. There'll be an open source driver whatever Broadcom does, now that (at least some of) the specs are published.

The_Franz
Aug 8, 2003

nvidia's cross-platform and Intel's linux drivers are out immediately and generally good as expected.

amd's pre-beta driver still hasn't passed the conformance tests, is windows only, has no directx support on windows and is generally crappy as expected.

akadajet
Sep 14, 2003

The_Franz posted:

nvidia's cross-platform and Intel's linux drivers are out immediately and generally good as expected.

amd's pre-beta driver still hasn't passed the conformance tests, is windows only, has no directx support on windows and is generally crappy as expected.
https://www.youtube.com/watch?v=iYWzMvlj2RQ&hd=1&t=30s

FlapYoJacks
Feb 12, 2009


Torvalds is a Asperger's shut-in with no social skills. News at 11!

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

ratbert90 posted:

Torvalds is a Asperger's shut-in with no social skills. News at 11!

this not so subtle dog whistling about the proud finnish people will not be tolerated

FlapYoJacks
Feb 12, 2009

MALE SHOEGAZE posted:

this not so subtle dog whistling about the proud finnish people will not be tolerated

Now let me tell you, I have lots of Finnish friends and they agree with me!

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

what's the context, NVidia not wanting to just release all of their IP as viral Open Source?

if he were competent there would just be release to release binary compatibility and drivers would just work, even across distros

you know, like a real operating system developed by professionals

Soricidus
Oct 21, 2010
freedom-hating statist shill

eschaton posted:

what's the context, NVidia not wanting to just release all of their IP as viral Open Source?

if he were competent there would just be release to release binary compatibility and drivers would just work, even across distros

you know, like a real operating system developed by professionals

at last, someone finally attributed to incompetence something that could adequately be explained by malice

akadajet
Sep 14, 2003

eschaton posted:

if he were competent there would just be release to release binary compatibility and drivers would just work, even across distros

seriously tho. why isn't this the case on linux like it is on every other major os out there?

just give me an .exe to double click to run something

FlapYoJacks
Feb 12, 2009

akadajet posted:

seriously tho. why isn't this the case on linux like it is on every other major os out there?

just give me an .exe to double click to run something

You mean like the nvidia .run file?

akadajet
Sep 14, 2003

ratbert90 posted:

You mean like the nvidia .run file?

if that's how it works then cool

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

akadajet posted:

seriously tho. why isn't this the case on linux like it is on every other major os out there?

for the kernel, it a conscious strategy on Linus' part to ensure "freedom" from binary drivers

the kernel devs changed the layout of a struct important to SCSI support between point releases of the 2.0 kernel and his response was p much just "gently caress binary drivers and gently caress you for even thinking about them" when people pointed out all the poo poo it broke

so of course now any drivers created by professionals just include an Open Source shim layer that can be compiled against whatever hosed up kernel someone is running, and that presents a binary compatibility interface to the real driver

Darwin IOKit on the other hand doesn't just do release to release binary compatibility, it does it by fixing the fragile base class problem for its specialized dialect of C++

(this Open Source iSCSI Initiator for OS X provides a decent example, a single binary could probably be built to run on 10.8 and later, modulo any code signing differences between older and modern OSes)

ahmeni
May 1, 2005

It's one continuous form where hardware and software function in perfect unison, creating a new generation of iPhone that's better by any measure.
Grimey Drawer
binary interfaces are terrible garbage to maintain and it only encourages other companies to do the same dumb poo poo, which is what the gpl3 specifically was crafted to fight

akadajet
Sep 14, 2003

eschaton posted:

the kernel devs changed the layout of a struct important to SCSI support between point releases of the 2.0 kernel and his response was p much just "gently caress binary drivers and gently caress you for even thinking about them" when people pointed out all the poo poo it broke

lol and this guy has the gall to complain about working with driver vendors.

cmykJester
Feb 16, 2011

by Nyc_Tattoo
I got bored and watched an RMS talk and it was pretty bad and he couldn't get his power point presentation to work right and would interrupt people mid question to answer them.

Adbot
ADBOT LOVES YOU

Sapozhnik
Jan 2, 2005

Nap Ghost

akadajet posted:

seriously tho. why isn't this the case on linux like it is on every other major os out there?

just give me an .exe to double click to run something

proprietary drivers are a shitshow and linux doesn't make it a priority to accommodate proprietary driver vendors.

there are precisely zero instances where a proprietary kernel-mode driver genuinely grants a vendor a competitive advantage. even for gpu drivers the important stuff (i.e. the shader compiler) lives in userland.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply