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

Button report, isn't really a bitmask #12

Open
m-7761 opened this issue Jul 3, 2018 · 4 comments
Open

Button report, isn't really a bitmask #12

m-7761 opened this issue Jul 3, 2018 · 4 comments

Comments

@m-7761
Copy link

m-7761 commented Jul 3, 2018

  struct {
    uint8_t unknown:1;
    // Set if the volume up button is pressed.
    uint8_t plus:1;
    // Set if the volume down button is pressed.
    uint8_t minus:1;
    // Set if the mute button is pressed.
    uint8_t mute:1;
  } button;

A lot of this stuff is in the PSVRFramework's source code. As long as there isn't a reason to not plumb it.

But I say from recent experience, that it's misleading to use bitfields here. Because yes, the values are 2, 4, 8 (1 is surely the power button? But possibly it's meaningless) but they are never combined. I think the most recently pressed button is reported, although if not, there is a hierarchy.

BTW: We cannot really use the PSVR for sound on Windows. But I'm curious, if it's even worthwhile, because mine sounds truly awful! It could be the headphones that come with it are inadequate. But I'm wondering, do you guys get good sound out of home-theater mode? Is it possible we are missing something?

(EDITED: For what it's worth, I know about this, because I repurposed the volume buttons for adjusting an IPD setting.)

@dylanmckay
Copy link
Owner

But I say from recent experience, that it's misleading to use bitfields here. Because yes, the values are 2, 4, 8 (1 is surely the power button? But possibly it's meaningless) but they are never combined

Fair point, I see what you mean. We should adjust the wording a little so it's clearer.

BTW: We cannot really use the PSVR for sound on Windows. But I'm curious, if it's even worthwhile, because mine sounds truly awful! It could be the headphones that come with it are inadequate. But I'm wondering, do you guys get good sound out of home-theater mode? Is it possible we are missing something?

Are you driving the audio from the HDMI signal, or are you transmitting data over the (undocumented) audio USB interfaces?

I haven't even tried using sound yet, my hobby project isn't very game-like.

@dylanmckay
Copy link
Owner

But I say from recent experience, that it's misleading to use bitfields here. Because yes, the values are 2, 4, 8 (1 is surely the power button? But possibly it's meaningless) but they are never combined. I think the most recently pressed button is reported, although if not, there is a hierarchy.

So to be super clear, are you saying that there will only ever be one bit set per report received in the entire button byte?

@m-7761
Copy link
Author

m-7761 commented Jul 11, 2018

It's hard to say. From a design document standpoint, using the C bitfield feature is misleading, but I suppose in an API it might come in handy to not have to expressly compare the value to a constant value.

In practice, yes, only 1 bit is ever set at the same time. I was more concerned about the use of a struct/bitfields, since it gives the wrong impression. But like I say, I suppose it can be useful in a programming scenario (to write briefer code.)


As for sound, yes, I am referring to the HDMI input coming out of the headphones jack on the unit. Just, FYI, off-topic, the other audio mode, does play sound from the HDMI input. It just plays for a short duration, and then is cut off, but then returns later, so that you hear bits and pieces at regular intervals. This suggests that it's sending BGM over HDMI and there is a buffer window or something or other that needs to be coordinated for mixing purposes.

@m-7761
Copy link
Author

m-7761 commented Aug 23, 2018

Update/Off-topic: The package of earpieces that come with the headphones are actually different sizes. It sounds less than truly awful with the right size. But now I can hear them better, they seem unpleasant compared to every pair of headphones I've ever known.

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

2 participants