chadaustin / is-it-snappy

iOS App for measuring input-to-output latency
Other
107 stars 8 forks source link

iPhone XR problem #7

Closed pahwp closed 3 years ago

pahwp commented 5 years ago

https://www.youtube.com/watch?v=fOx_D9-Xx_E

Here's a video of the problem.

Anyways, I'm using a iPhone XR, and everytime I use try to frame skip, it always does intervals of 4, I'm not sure why. I've installed and downloaded, and it always skips with intervals of 4. I currently still have the app on my iphone 6, which I've been using for IsItSnappy, where it doesn't skip, and goes by frame by frame. I hope there's a fix. Thank you for the wonderful app, I've been using it for years.

chadaustin commented 5 years ago

Thanks for the report! I'll try to find some time to take a look soon.

chadaustin commented 5 years ago

I got all set up to look at this on the weekend, and realized you can't run Is It Snappy in the simulator and I don't own any of the newer iPhones. I'm planning on getting a new phone soon, so I'll have to take a look soon.

When you say frame skip, are you talking about tapping the edge of the screen? Or are you scrubbing your finger across the screen?

pahwp commented 5 years ago

It is both, tapping at the edges of the screen and scrubbing that it will skip 4 frames at a time.

sinky commented 5 years ago

Hi, I can confirm this problem on my iPhone XR. 4 frames is the minimum step. I’m happy to help if I can.

snipeso commented 4 years ago

Hi, I have the iPhone 11 and ran into the same problem. More specifically, I can gently scroll through 4 separate frames, but the frame index at the bottom of the app remains stuck at a multiple of 4 (and same block for the milliseconds), so it needs four frame changes before updating. I’m happy to help with testing if needed.

sponge commented 4 years ago

Same issue here, too. I think it is a global issue with newer iOS. Changing the camera format from High Efficiency to Most Compatible, so I don't think it's an HEVC thing.

I'm sure it won't be much relative to a full-time job but I would absolutely chip in a few bucks for an in-app/paid version if it helps! The app has been very handy for me and I've definitely missed it on these recent phone generations.

sponge commented 4 years ago

Took a look at it, I think I found a workaround. In MarkViewController.swift, this loop is ran:

        var times: [CMTime] = []
        while reader.status == .reading {
            if let sampleBuffer = output.copyNextSampleBuffer() {
                if CMSampleBufferIsValid(sampleBuffer) && 0 != CMSampleBufferGetTotalSampleSize(sampleBuffer) {
                    let frameTime = CMSampleBufferGetOutputPresentationTimeStamp(sampleBuffer)
                    if frameTime.isValid {
                        times.append(frameTime)
                    }
                }
            }
        }

but it looks like CMSampleBufferGetOutputPresentationTimeStamp is causing the times array to no longer be monotonic. For a 30FPS video, the debugger was showing something like 0, 20, 10, 30. I have no idea why it would do this, but if I changed the assignment below from

frameTimes = times

to

frameTimes = times.sorted()

it seemed to work again since the timestamps are sorted properly and the lookups don't stop too early. It's probably worth trying to figure out why that function isn't doing the same thing anymore, but I don't know a ton about this stuff and there's probably some broken edge cases there. Hopefully this helps someone else!

(By the way I was able to get it to run in the simulator, I just had to drag a video file into the simulator and put it in the Is It Snappy? album. Exporting a slowmo video from my iPhone caused it to render it out to a plain old 30FPS video, but I could still jump between frames in it, so it seemed to work.)

chadaustin commented 4 years ago

Good news! @lhecker submitted https://github.com/chadaustin/is-it-snappy/pull/9 and I'm merging it. I will try to push up a build to the App Store, but it's been long enough that I have to relearn how to submit, and hope that the dance hasn't chanced substantially for iPhone 10+. (I haven't been able to submit a bug fix to another app I maintain because making the new submission compatible with iPhone 10+ is proving to be harder than the spare time I have.)

chadaustin commented 3 years ago

OK, I've made a new build of the app, and I've confirmed it fixes the frame selection issue, dark mode, and some weirdnesses in how the screens are rendered on new iOS.

I'm trying to submit the new build of the app, but I don't have a 6.5" phone, and I can't easily take screenshots in the simulator. So there might be a delay of the new build showing up in the app store until I can find a way to produce plausible 6.5" screenshots.

lhecker commented 3 years ago

Taking screenshots in the simulator should work out of the box… 🤔 Do you have problems taking them at their full resolution? If yes: https://stackoverflow.com/a/47152270

chadaustin commented 3 years ago

The issue is that the simulator doesn't have a camera, so it's hard to set up a realistic screenshot without the device. But I forgot, I'd already added a screenshot mode. :P Taking screenshots for every screen size now!

chadaustin commented 3 years ago

OK, 1.0.5 build is submitted for review. Now to wait for the reviewers.

chadaustin commented 3 years ago

1.0.5 build is in the app store and should fix this issue. Thanks everyone.