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

Fix WinMR config read by retrying also tidy c file #246

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Wallbraker
Copy link
Member

No description provided.

@Wallbraker Wallbraker requested a review from pH5 August 1, 2019 17:30
@TheOnlyJoey TheOnlyJoey self-requested a review August 1, 2019 17:32
@TheOnlyJoey TheOnlyJoey self-assigned this Aug 1, 2019
@TheOnlyJoey TheOnlyJoey added enhancement WMR Windows Mixed Reality headsets labels Aug 1, 2019
@TheOnlyJoey
Copy link
Member

Since this is based on master and not dev-wmr, i will test this for merge into the 0.3 branch to mark for bugfix release.

Copy link
Contributor

@pH5 pH5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retry is fine to make it work, although I'd like to understand what happens there. Is it just failing randomly, or are we consistently asking for the config too early?

int size = hid_read(priv->hmd_imu, buffer, FEATURE_BUFFER_SIZE);
if(size < 0){
if(size < 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (size < 0)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch :)

free(priv);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this very much, being used to kernel coding style. But if we are going to make this a rule I'm ok with it.

Copy link
Member Author

@Wallbraker Wallbraker Aug 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, that's deffo a me:ism :)

@johnr14
Copy link

johnr14 commented Jan 17, 2020

Hi, I have tried this, I would recommend to double the wait time after each retry and have more retry. On first try, I may need to restart the program for it to work the second time.

When connecting the hmd, it takes a certain time to boot up. So extending the wait time to a few minutes could be a good idea. Here output of opengl when freshly plugged (like about 15s ?).

Also, my hmd is black as discussed in #276, trying to troubleshoot it. My headset is up to date (firmware).

[II] 045e:0659 0008:0104:0000:0000:0104:02
[II] Opening
[EE] Failed to issue command 0b: 17 00 01
[EE] Failed to read data, attempt #1
[EE] Failed to issue command 0b: 17 01 01
[EE] Failed to read data, attempt #2
[EE] Failed to issue command 0b: 17 00 01
[EE] Failed to read data, attempt #3
[EE] Failed to issue command 0b: 17 01 01
[EE] Failed to read data, attempt #4
[EE] Could not read config from the firmware
[EE] unknown message type: 23
[EE] unknown message type: 23
[EE] unknown message type: 23
[EE] unknown message type: 23
[EE] unknown message type: 23
[EE] unknown message type: 23
[EE] unknown message type: 23
[EE] unknown message type: 2
OpenGL Renderer: Radeon RX Vega (VEGA10, DRM 3.35.0, 5.4.8-200.fc31.x86_64, LLVM 9.0.0)
OpenGL Vendor: X.Org
OpenGL Version: 4.5 (Compatibility Profile) Mesa 19.2.8
failed to create fbo 8cd6
failed to create fbo 8cd6
[EE] unknown message type: 23
[EE] unknown message type: 23

When it works this is the output :

[II] 045e:0659 0008:0104:0000:0000:0104:02
[II] Opening
[EE] Failed to issue command 0b: 17 00 01
[EE] Failed to read data, attempt #1
[EE] Failed to issue command 0b: 17 01 01
[EE] Failed to read data, attempt #2
[EE] Failed to issue command 08: 17 00 01
[EE] Failed to read data, attempt #1
[EE] Failed to issue command 0b: 17 01 01
[EE] Failed to read data, attempt #2
[II] Read 10219-byte config data
[II] Model name: Samsung Windows Mixed Reality 800ZBA
[EE] {"CalibrationInformation":{"Cameras":[{"Intrinsics":{"ModelParameterCount":15,"ModelParameters":[0.50986164808273315,0.48059824109077454,0.42008697986602783,0.56038570404052734,0.79907500743865967,0.67329293489456177,0.0038568372838199139,1.0711227655410767,0.80461454391479492,0.087160795927047729,0.0029966279398649931,0.0010741509031504393,7.1934977313503623E-5,1.0643623681971803E-5,2.792189359664917],"ModelType":"CALIBRATION_LensDistortionModelRational6KT"},"Location":"CALIBRATION_CameraLocationHT0","Purpose":"CALIBRATION_CameraPurposeHeadTracking","MetricRadius":2.792189359664917,"Rt":{"Rotation":[1,0,0,0,1,0,0,0,1],"Translation":[0,0,0]},"SensorHeight":480,"SensorWidth":640,"Shutter":"CALIBRATION_ShutterTypeUndefined","ThermalAdjustmentParams":{"Params":[0,0,0,0,0,0,0,0,0,0,0,0]}},{"Intrinsics":{"ModelParameterCount":15,"ModelParameters":[0.50890707969665527,0.4991055428981781,0.41541168093681335,0.55406659841537476,0.50283777713775635,0.2812899649143219,0.0060616401024162769,0.775051474571228,0.31480833888053894,0.049422327429056168,0.0065727368928492069,0.0066355052404105663,0.00017096112424042076,3.507217115839012E-5,2.7875354290008545],"ModelType":"CALIBRATION_LensDistortionModelRational6KT"},"Location":"CALIBRATION_CameraLocationHT1","Purpose":"CALIBRATION_CameraPurposeHeadTracking","MetricRadius":2.7875354290008545,"Rt":{"Rotation":[0.69421511888504028,-0.0052430024370551109,-0.71974849700927734,0.0085603352636098862,0.99996286630630493,0.00097243225900456309,0.71971666812896729,-0.0068363654427230358,0.69423425197601318],"Translation":[-0.09655163437128067,-0.00072534364880993962,-0.041091181337833405]},"SensorHeight":480,"SensorWidth":640,"Shutter":"CALIBRATION_ShutterTypeUndefined","ThermalAdjustmentParams":{"Params":[0,0,0,0,0,0,0,0,0,0,0,0]}},{"Intrinsics":{"ModelParameterCount":15,"ModelParameters":[0.50568294525146484,0.48980224132537842,0.43511775135993958,0.52002924680709839,6.0497612953186035,-10.048660278320312,22.599639892578125,6.1337661743164063,-10.050261497497559,22.486785888671875,-0.0077081732451915741,0.0020905046258121729,0.00099883740767836571,-4.3223499233135954E-6,1.3999999761581421],"ModelType":"CALIBRATION_LensDistortionModelRational6KT"},"Location":"CALIBRATION_CameraLocationDO0","Purpose":"CALIBRATION_CameraPurposeDisplayObserver","MetricRadius":1.3999999761581421,"Rt":{"Rotation":[1,0,0,0,1,0,0,0,1],"Translation":[0,0,0]},"SensorHeight":2048,"SensorWidth":2448,"Shutter":"CALIBRATION_ShutterTypeUndefined","ThermalAdjustmentParams":{"Params":[0,0,0,0,0,0,0,0,0,0,0,0]}},{"Intrinsics":{"ModelParameterCount":15,"ModelParameters":[0.50495320558547974,0.49421533942222595,0.43522077798843384,0.519997775554657,-0.29937207698822021,1.635257363319397,2.0507051944732666,-0.25487691164016724,1.5702483654022217,2.0532345771789551,-0.0011014774208888412,-0.011134925298392773,0.00073413283098489046,0.00052863958990201354,1.3999999761581421],"ModelType":"CALIBRATION_LensDistortionModelRational6KT"},"Location":"CALIBRATION_CameraLocationDO1","Purpose":"CALIBRATION_CameraPurposeDisplayObserver","MetricRadius":1.3999999761581421,"Rt":{"Rotation":[0.99999034404754639,-0.0036428447347134352,-0.0024573411792516708,0.0036511879879981279,0.99998754262924194,0.0033993404358625412,0.0024449273478239775,-0.0034082799684256315,0.99999117851257324],"Translation":[-0.065898001194000244,-3.4150158171541989E-5,-8.4063372923992574E-5]},"SensorHeight":2048,"SensorWidth":2448,"Shutter":"CALIBRATION_ShutterTypeUndefined","ThermalAdjustmentParams":{"Params":[0,0,0,0,0,0,0,0,0,0,0,0]}}],"Displays":[{"Affine":[908.44085693359375,-0.5635298490524292,784.12884521484375,-0,907.9769287109375,798.8868408203125,0,0,1],"AssignedEye":"CALIBRATION_DisplayEyeLeft","DisplayHeight":1600,"DisplayWidth":2880,"DistortionRed":{"ModelParameterCount":5,"ModelParameters":[781.36331799701327,801.763635923943,4.1473482836532425E-7,1.5969270773308546E-13,7.2239625408294761E-19],"ModelType":"CALIBRATION_DisplayDistortionModelPolynomial3K"},"DistortionGreen":{"ModelParameterCount":5,"ModelParameters":[780.61676292029517,800.41757398805748,4.4414169603015714E-7,5.5979522969201756E-14,9.4527429934991752E-19],"ModelType":"CALIBRATION_DisplayDistortionModelPolynomial3K"},"DistortionBlue":{"ModelParameterCount":5,"ModelParameters":[779.69690855952535,802.46387048395343,5.2629204193226318E-7,-2.6212778005540786E-13,1.4814108182430968E-18],"ModelType":"CALIBRATION_DisplayDistortionModelPolynomial3K"},"EyePositionCorrectionModel":{"ModelParameterCount":0,"ModelParameters":[],"ModelType":"CALIBRATION_EyePositionCorrectionModelIpdTranslational"},"HorizontalFieldOfView":0,"VerticalFieldOfView":0,"VisibleAreaCenter":{"X":784.12886136937436,"Y":798.88683370499314},"VisibleAreaRadius":820,"VBlankToPhotonLatency":0,"Rt":{"Rotation":[0.919251024723053,-0.00072798848850652575,-0.39367127418518066,0.14108969271183014,0.93417805433273315,0.32772716879844666,0.36752045154571533,-0.35680648684501648,0.85884678363800049],"Translation":[-0.021427655592560768,0.01893632672727108,0.0796545222401619]}},{"Affine":[907.0704345703125,0.16954471170902252,2106.851318359375,-0,906.3896484375,804.25323486328125,0,-0,1],"AssignedEye":"CALIBRATION_DisplayEyeRight","DisplayHeight":1600,"DisplayWidth":2880,"DistortionRed":{"ModelParameterCount":5,"ModelParameters":[2105.8752607646707,808.09955591043956,4.178502050605862E-7,1.4536338586435907E-13,7.4045241383060828E-19],"ModelType":"CALIBRATION_DisplayDistortionModelPolynomial3K"},"DistortionGreen":{"ModelParameterCount":5,"ModelParameters":[2104.56280019722,806.90980599203465,4.4755631550943938E-7,4.8070052526168123E-14,9.4654126919829428E-19],"ModelType":"CALIBRATION_DisplayDistortionModelPolynomial3K"},"DistortionBlue":{"ModelParameterCount":5,"ModelParameters":[2103.0424327098044,808.93245993960659,5.328309186236615E-7,-2.7757629097578385E-13,1.48493220848616E-18],"ModelType":"CALIBRATION_DisplayDistortionModelPolynomial3K"},"EyePositionCorrectionModel":{"ModelParameterCount":0,"ModelParameters":[],"ModelType":"CALIBRATION_EyePositionCorrectionModelIpdTranslational"},"HorizontalFieldOfView":0,"VerticalFieldOfView":0,"VisibleAreaCenter":{"X":2106.8512597143,"Y":804.25325139685162},"VisibleAreaRadius":820,"VBlankToPhotonLatency":0,"Rt":{"Rotation":[0.918651282787323,-0.00029275190900079906,-0.39506921172142029,0.14223894476890564,0.933183491230011,0.33005556464195251,0.36857545375823975,-0.35940021276474,0.85731184482574463],"Translation":[-0.087451793253421783,0.018844079226255417,0.079152286052703857]}}],"InertialSensors":[{"BiasTemperatureModel":[-0.0034769221674650908,0,0,0,-0.022550992667675018,0,0,0,-0.0038449552375823259,0,0,0],"BiasUncertainty":[9.9999997473787516E-5,9.9999997473787516E-5,9.9999997473787516E-5],"Id":"CALIBRATION_InertialSensorId_ICM20602","MixingMatrixTemperatureModel":[1.0015950202941895,0,0,0,0.0011445422424003482,0,0,0,0.00028985386597923934,0,0,0,0.0011473248014226556,0,0,0,0.99916607141494751,0,0,0,0.00041302491445094347,0,0,0,0.00029020701185800135,0,0,0,0.00041252525988966227,0,0,0,1.0003750324249268,0,0,0],"ModelTypeMask":16,"Noise":[0.00095000001601874828,0.00095000001601874828,0.00095000001601874828,0,0,0],"Rt":{"Rotation":[0.92151069641113281,-0.0033560495357960463,-0.38833853602409363,0.14457683265209198,0.931049644947052,0.33502843976020813,0.36043807864189148,-0.36487704515457153,0.85845738649368286],"Translation":[0,0,0]},"SecondOrderScaling":[0,0,0,0,0,0,0,0,0],"SensorType":"CALIBRATION_InertialSensorType_Gyro","TemperatureBounds":[5,60],"TemperatureC":0},{"BiasTemperatureModel":[-0.010198298841714859,0,0,0,0.13576042652130127,0,0,0,-0.11803635209798813,0,0,0],"BiasUncertainty":[0.0099999997764825821,0.0099999997764825821,0.0099999997764825821],"Id":"CALIBRATION_InertialSensorId_ICM20602","MixingMatrixTemperatureModel":[1.0039643049240112,0,0,0,0.000706581340637058,0,0,0,-0.00051911384798586369,0,0,0,0.00070496101398020983,0,0,0,1.0062718391418457,0,0,0,0.00051600806182250381,0,0,0,-0.00052018952555954456,0,0,0,0.00051826582057401538,0,0,0,1.0018879175186157,0,0,0],"ModelTypeMask":56,"Noise":[0.010700000450015068,0.010700000450015068,0.010700000450015068,0,0,0],"Rt":{"Rotation":[0.92105859518051147,-0.004056127741932869,-0.38940292596817017,0.14407244324684143,0.93254536390304565,0.33106231689453125,0.36179307103157043,-0.36103001236915588,0.85951328277587891],"Translation":[-0.084486521780490875,-0.0041636284440755844,0.0025778105482459068]},"SecondOrderScaling":[0,0,0,0,0,0,0,0,0],"SensorType":"CALIBRATION_InertialSensorType_Accelerometer","TemperatureBounds":[5,60],"TemperatureC":0},{"BiasTemperatureModel":[0,0,0,0,0,0,0,0,0,0,0,0],"BiasUncertainty":[0,0,0],"Id":"CALIBRATION_InertialSensorId_AK09916","MixingMatrixTemperatureModel":[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0],"ModelTypeMask":0,"Noise":[0.699999988079071,0.699999988079071,0.699999988079071,0,0,0],"Rt":{"Rotation":[0.92105859518051147,-0.004056127741932869,-0.38940292596817017,0.14407244324684143,0.93254536390304565,0.33106231689453125,0.36179307103157043,-0.36103001236915588,0.85951328277587891],"Translation":[0,0,0]},"SecondOrderScaling":[0,0,0,0,0,0,0,0,0],"SensorType":"CALIBRATION_InertialSensorType_Magnetometer","TemperatureBounds":[0,0],"TemperatureC":0}],"Metadata":{"SerialId":"XQ8198CKC1000YW","FactoryCalDate":"12/2/2018 12:10:10 AM GMT","Version":{"Major":1,"Minor":2},"DeviceName":"GOERTEK-BUILD-MP"},"TemperatureData":{"ACCEL_0":{"Average":30.187019875701981,"Min":27.54,"Max":32.09},"GYRO_0":{"Average":30.187019875701981,"Min":27.54,"Max":32.09}}}}
[EE] Found display height 1600
[EE] Found display width 2880
[EE] unknown message type: 2
[EE] unknown message type: 23
[EE] unknown message type: 23
OpenGL Renderer: Radeon RX Vega (VEGA10, DRM 3.35.0, 5.4.8-200.fc31.x86_64, LLVM 9.0.0)
OpenGL Vendor: X.Org
OpenGL Version: 4.5 (Compatibility Profile) Mesa 19.2.8
[EE] unknown message type: 23
[EE] unknown message type: 23
[EE] unknown message type: 23
[EE] unknown message type: 23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement WMR Windows Mixed Reality headsets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants