tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[bug] getUserMedia call slows application down to a halt

Open bits-by-brandon opened this issue 2 years ago • 2 comments

Describe the bug

Calling navigator.mediaDevices.getUserMedia from JS causes performance to drop considerably.

I get this warning from stdout

2022-12-17 18:02:57.497 Whiskey[5575:42511] IMKClient Stall detected, please Report your user scenario attaching a spindump (or sysdiagnose) that captures the problem - (imkxpc_bundleIdentifierWithReply:) block performed very slowly (1.39 secs).

Reproduction

  1. git clone https://github.com/bits-by-brandon/tauri-getusermedia-bug.git
  2. cd tauri-getusermedia-bug
  3. yarn run tauri dev
  4. observe drop in performance

Expected behavior

No response

Platform and versions

Environment › OS: Mac OS 13.1.0 X64 › Node.js: 16.16.0 › npm: 8.11.0 › pnpm: Not installed! › yarn: 1.22.19 › rustup: 1.25.1 › rustc: 1.65.0 › cargo: 1.65.0 › Rust toolchain: stable-x86_64-apple-darwin

Stack trace

2022-12-17 18:02:57.497 Whiskey[5575:42511] IMKClient Stall detected, *please Report* your user scenario attaching a spindump (or sysdiagnose) that captures the problem - (imkxpc_bundleIdentifierWithReply:) block performed very slowly (1.39 secs).

Additional context

No response

bits-by-brandon avatar Dec 18 '22 02:12 bits-by-brandon

My issues is Webrtc video behavior is different from safari behavior. Tauri-mobile can not be autoplay from the camera mediastream. The permission description has been added to the Info.plist file.

<key>NSCameraUsageDescription</key>
<string>Request camera access for WebRTC</string>
<key>NSMicrophoneUsageDescription</key>
<string>Request microphone access for WebRTC</string>

Test URL media-recorder-api-demo tauri.conf.json

{
"build": {
    "beforeDevCommand": "",
    "beforeBuildCommand": "",
    "devPath": "https://addpipe.com/media-recorder-api-demo/",
    "distDir": "../dist",
    "withGlobalTauri": false
  },
}

device

iphone 8 plus
version: 15.5

fuyoo avatar Dec 19 '22 02:12 fuyoo

Similar issue for me.

IMKClient Stall detected, *please Report* your user scenario attaching a spindump (or sysdiagnose) that captures the problem - (imkxpc_windowLevelWithReply:) block performed very slowly (3.30 secs).

LMJW avatar Jun 04 '23 02:06 LMJW