puavo-org / puavo-os

Puavo OS is an disk image based operating system that is built from Debian GNU/Linux and is specifically designed for learning.
https://puavo.org
GNU General Public License v2.0
11 stars 7 forks source link

Surface cameras do not work on every boot #710

Open asokero opened 1 month ago

asokero commented 1 month ago

Sometimes after device boot/reboot the cameras of Surface Go 3 are unusable / not available for applications.

Mazhoon commented 1 month ago

some dmesg from boot with no working cameras

[    8.549691] intel_pmc_core INT33A1:00:  initialized
[    8.565907] input: Intel HID events as /devices/platform/INT33D5:00/input/input12
[    8.584274] ACPI: AC: AC Adapter [ACAD] (off-line)
[    8.591208] intel-hid INT33D5:00: platform supports 5 button array
[    8.591274] input: Intel HID 5 button array as /devices/platform/INT33D5:00/input/input13
[    8.598420] intel-hid INT33D5:00: platform supports switches
[    8.599027] input: Intel HID switches as /devices/platform/INT33D5:00/input/input14
[    8.645424] mc: Linux media interface: v0.10
[    8.734326] videodev: Linux video capture interface: v2.00
[    8.761622] int3472-tps68470 i2c-INT3472:01: TPS68470 REVID: 0x21
[    8.770087] CORE: Bringing 900000uV into 1200000-1200000uV
[    8.779410] ANA: Bringing 875000uV into 2815200-2815200uV
[    8.780545] VCM: Bringing 875000uV into 2815200-2815200uV
[    8.782596] AUX1: Bringing 875000uV into 2815200-2815200uV
[    8.791092] input: ELAN9038:00 04F3:2A1C as /devices/pci0000:00/0000:00:15.1/i2c_designware.1/i2c-1/i2c-ELAN9038:00/0018:04F3:2A1C.0001/input/input15
[    8.793906] AUX2: Bringing 875000uV into 1800600-1800600uV
[    8.805354] input: ELAN9038:00 04F3:2A1C Stylus as /devices/pci0000:00/0000:00:15.1/i2c_designware.1/i2c-1/i2c-ELAN9038:00/0018:04F3:2A1C.0001/input/input18
[    8.927134] hid-multitouch 0018:04F3:2A1C.0001: input,hidraw0: I2C HID v1.00 Device [ELAN9038:00 04F3:2A1C] on i2c-ELAN9038:00
[    8.987126] ipu3_imgu: module is from the staging directory, the quality is unknown, you have been warned.
[    8.989404] ipu3-imgu 0000:00:05.0: enabling device (0000 -> 0002)
[    8.989605] ipu3-imgu 0000:00:05.0: device 0x1919 (rev: 0x1)
[    8.989637] ipu3-imgu 0000:00:05.0: physical base address 0x00000000a1000000, 4194304 bytes
[    9.006240] ipu3-cio2 0000:00:14.3: Found supported sensor INT33BE:00
[    9.006447] ipu3-cio2 0000:00:14.3: Found supported sensor INT347A:00
[    9.012408] mei_me 0000:00:16.0: enabling device (0004 -> 0006)
[    9.013993] ipu3-cio2 0000:00:14.3: Found supported sensor INT347E:00
[    9.014156] ipu3-cio2 0000:00:14.3: Connected 3 cameras
[    9.014199] ipu3-cio2 0000:00:14.3: enabling device (0000 -> 0002)
[    9.014371] ipu3-cio2 0000:00:14.3: device 0x9d32 (rev: 0x1)
[    9.018691] ov5693 i2c-INT33BE:00: supply dovdd not found, using dummy regulator
[    9.018735] ov5693 i2c-INT33BE:00: supply dvdd not found, using dummy regulator
[    9.069421] input: PC Speaker as /devices/platform/pcspkr/input/input33
[    9.207729] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    9.231252] surface_gpe: no compatible Microsoft Surface device found, exiting
[    9.262754] Loaded X.509 cert 'benh@debian.org: 577e021cb980e0e820821ba7b54b4961b8b4fadf'
[    9.263139] Loaded X.509 cert 'romain.perier@gmail.com: 3abbc6ec146e09d1b6016ab9d6cf71dd233f0328'
[    9.263403] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    9.263680] Loaded X.509 cert 'wens: 61c038651aabdcf94bd0ac7ff06c7248db18c600'
[    9.266292] platform regulatory.0: firmware: direct-loading firmware regulatory.db
[    9.266585] platform regulatory.0: firmware: direct-loading firmware regulatory.db.p7s
[    9.343640] Intel(R) Wireless WiFi driver for Linux
[    9.343872] iwlwifi 0000:01:00.0: enabling device (0000 -> 0002)
[    9.346144] ipu3-imgu 0000:00:05.0: firmware: direct-loading firmware intel/irci_irci_ecr-master_20161208_0213_20170112_1500.bin
[    9.346902] RAPL PMU: API unit is 2^-32 Joules, 5 fixed counters, 655360 ms ovfl timer
[    9.346905] RAPL PMU: hw unit of domain pp0-core 2^-14 Joules
[    9.346907] RAPL PMU: hw unit of domain package 2^-14 Joules
[    9.346909] RAPL PMU: hw unit of domain dram 2^-14 Joules
[    9.346910] RAPL PMU: hw unit of domain pp1-gpu 2^-14 Joules
[    9.346911] RAPL PMU: hw unit of domain psys 2^-14 Joules
[    9.353212] ipu3-imgu 0000:00:05.0: loaded firmware version irci_irci_ecr-master_20161208_0213_20170112_1500, 17 binaries, 1212984 bytes
[    9.382426] iwlwifi 0000:01:00.0: Detected crf-id 0x3617, cnv-id 0x100530 wfpm id 0x80000000
[    9.382548] iwlwifi 0000:01:00.0: PCI dev 2723/008c, rev=0x340, rfid=0x10a100

and some from a boot with working cameras

[    8.188980] intel_pmc_core INT33A1:00:  initialized
[    8.260280] input: Intel HID events as /devices/platform/INT33D5:00/input/input12
[    8.285423] mc: Linux media interface: v0.10
[    8.343469] intel-hid INT33D5:00: platform supports 5 button array
[    8.343543] input: Intel HID 5 button array as /devices/platform/INT33D5:00/input/input13
[    8.344639] intel-hid INT33D5:00: platform supports switches
[    8.344708] input: Intel HID switches as /devices/platform/INT33D5:00/input/input14
[    8.376108] videodev: Linux video capture interface: v2.00
[    8.412267] mei_me 0000:00:16.0: enabling device (0004 -> 0006)
[    8.487161] input: ELAN9038:00 04F3:2A1C as /devices/pci0000:00/0000:00:15.1/i2c_designware.1/i2c-1/i2c-ELAN9038:00/0018:04F3:2A1C.0001/input/input15
[    8.501568] input: ELAN9038:00 04F3:2A1C Stylus as /devices/pci0000:00/0000:00:15.1/i2c_designware.1/i2c-1/i2c-ELAN9038:00/0018:04F3:2A1C.0001/input/input18
[    8.529458] int3472-tps68470 i2c-INT3472:01: TPS68470 REVID: 0x21
[    8.544510] ipu3-cio2 0000:00:14.3: Found supported sensor INT33BE:00
[    8.544656] ipu3-cio2 0000:00:14.3: Found supported sensor INT347A:00
[    8.544792] ipu3-cio2 0000:00:14.3: Found supported sensor INT347E:00
[    8.544910] ipu3-cio2 0000:00:14.3: Connected 3 cameras
[    8.544926] ipu3-cio2 0000:00:14.3: enabling device (0000 -> 0002)
[    8.545097] ipu3-cio2 0000:00:14.3: device 0x9d32 (rev: 0x1)
[    8.548970] ov5693 i2c-INT33BE:00: supply dovdd not found, using dummy regulator
[    8.549001] ov5693 i2c-INT33BE:00: supply dvdd not found, using dummy regulator
[    8.549405] CORE: Bringing 900000uV into 1200000-1200000uV
[    8.552152] ipu3_imgu: module is from the staging directory, the quality is unknown, you have been warned.
[    8.553620] ANA: Bringing 875000uV into 2815200-2815200uV
[    8.555787] VCM: Bringing 875000uV into 2815200-2815200uV
[    8.556158] ipu3-imgu 0000:00:05.0: enabling device (0000 -> 0002)
[    8.556362] ipu3-imgu 0000:00:05.0: device 0x1919 (rev: 0x1)
[    8.556395] ipu3-imgu 0000:00:05.0: physical base address 0x00000000a1000000, 4194304 bytes
[    8.562680] AUX1: Bringing 875000uV into 2815200-2815200uV
[    8.563912] AUX2: Bringing 875000uV into 1800600-1800600uV
[    8.614792] input: PC Speaker as /devices/platform/pcspkr/input/input33
[    8.661153] hid-multitouch 0018:04F3:2A1C.0001: input,hidraw0: I2C HID v1.00 Device [ELAN9038:00 04F3:2A1C] on i2c-ELAN9038:00
[    8.715262] ipu3-imgu 0000:00:05.0: firmware: direct-loading firmware intel/irci_irci_ecr-master_20161208_0213_20170112_1500.bin
[    8.722164] ipu3-imgu 0000:00:05.0: loaded firmware version irci_irci_ecr-master_20161208_0213_20170112_1500, 17 binaries, 1212984 bytes
[    8.808434] surface_gpe: no compatible Microsoft Surface device found, exiting
[    8.963719] RAPL PMU: API unit is 2^-32 Joules, 5 fixed counters, 655360 ms ovfl timer
[    8.963725] RAPL PMU: hw unit of domain pp0-core 2^-14 Joules
[    8.963727] RAPL PMU: hw unit of domain package 2^-14 Joules
[    8.963728] RAPL PMU: hw unit of domain dram 2^-14 Joules
[    8.963729] RAPL PMU: hw unit of domain pp1-gpu 2^-14 Joules
[    8.963730] RAPL PMU: hw unit of domain psys 2^-14 Joules
[    8.967084] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    9.010950] Loaded X.509 cert 'benh@debian.org: 577e021cb980e0e820821ba7b54b4961b8b4fadf'
[    9.011346] Loaded X.509 cert 'romain.perier@gmail.com: 3abbc6ec146e09d1b6016ab9d6cf71dd233f0328'
[    9.011666] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    9.011960] Loaded X.509 cert 'wens: 61c038651aabdcf94bd0ac7ff06c7248db18c600'
[    9.015746] platform regulatory.0: firmware: direct-loading firmware regulatory.db
[    9.037822] mei_hdcp 0000:00:16.0-b638ab7e-94e2-4ea2-a552-d1c54b627f04: bound 0000:00:02.0 (ops i915_hdcp_ops [i915])
[    9.051144] platform regulatory.0: firmware: direct-loading firmware regulatory.db.p7s
[    9.149789] ov7251 i2c-INT347E:00: OV7251 revision 7 (1F) detected at address 0x60
[    9.255837] ov8865 i2c-INT347A:00: Instantiated dw9719 VCM
[    9.315766] Intel(R) Wireless WiFi driver for Linux
[    9.316053] iwlwifi 0000:01:00.0: enabling device (0000 -> 0002)
[    9.334041] iwlwifi 0000:01:00.0: Detected crf-id 0x3617, cnv-id 0x100530 wfpm id 0x80000000
[    9.334163] iwlwifi 0000:01:00.0: PCI dev 2723/008c, rev=0x340, rfid=0x10a100

the most obvious suspects are

[    9.149789] ov7251 i2c-INT347E:00: OV7251 revision 7 (1F) detected at address 0x60
[    9.255837] ov8865 i2c-INT347A:00: Instantiated dw9719 VCM

which are missing on unsuccesful init boot.

Their drivers seem to be stuck or something

sudo rmmod -fv ov8865 
rmmod: ERROR: ../libkmod/libkmod-module.c:856 kmod_module_remove_module() could not remove 'ov8865': Device or resource busy
tuomasjjrasanen commented 3 weeks ago

My test results:

bpo 6.6.13 + surface patches for 6.6, on keyboardless Surface Go 3, cameras worked on 4/9 boots.

bpo 6.7.12 + surface patches for 6.7, on keyboardless Surface Go 3, cameras worked on 9/9 boots.

Tested with Cheese.

I did'n see any specific fixes for this issue, the only fix affecting cameras was Fix camera issues in 6.7.x on SGo2. But anything is possible, it's possible that upgrade to 6.7 fixed the issue, or made the possible race condition harder to achieve.

We are treating only the symptoms, the disease cannot be cured.

Mazhoon commented 2 weeks ago

Tested with cheese on opinsys-os-opinsys-bookworm-2024-06-06-103020-amd64 / 6.7.12-1~bpo12+1+puavo1+buildonce, 4/4 boots works