Live preview image is freezing in ios sdk sample project

Hi guys, I downloaded the sdk from and run the sample project. The app is able to connect to the theta camera, but I kept getting the error log like this

JPEGDecompressSurface: Picture decode failed: e00002d1

Also, the live preview is freezing after capturing photos. (it says new users can’t upload videos…)

Could someone please help me figure it out? Thanks in advance!!!

live preview works with this SDK on iOS

Here’s a test with the THETA X.

Please post the THETA model (such as X) and the firmware version.

I used the older SDK on iOS with the V.

Thanks for the quick response!

I still have few questions for native iOS (swift):

  1. The SDK you posted (theta-client), does it support all theta models?
  2. What is the difference of the sdk theta-client and theta-api2.1-ios-sdk? I’m a bit confused which one should I use.
  3. I’m using theta sc2, firm version 06.41.

Appreciate it!!!

  • THETA Z1
  • THETA S (firmware version 01.62 or later)

I’ve also tested it with the SC2.
with Flutter

The theta-client is the official SDK from RICOH and updated regularly.

Last release was today.

The theta-api2.1-ios-sdk was last updated 2019, 4 years ago.

If theta-client meets your requirements, I suggest using theta-client. We have community information on using theta-client at the site below.

theta-client | Developer information for RICOH THETA

Thanks for elaborating these SDKs.

I just tried theta-client demo-ios with S and SC2, still got the “picture decode failed” error, looks like it only successfully decoded some live frames, the rest was failed to be decoded, so the live view is kind of stuck.
I’m not sure if this is related to what you mentioned setting the API version to 1 or v2.1. If so, could you please let me know how to set it up? since the link in the article you posted is not available.


Is there a way to disconnect from the camera using theta-client? I don’t see it in the doc

The reason for it is because my app needs to connect to the camera multiple times, after too many time connection, I got this error below, and I guess it might be because there are too many sessions?

Error Domain=KotlinException Code=0 "Failed to connect to InetSocketAddress(hostname=, port=80)." UserInfo={NSLocalizedDescription=Failed to connect to InetSocketAddress(hostname=, port=80)., KotlinException=com.ricoh360.thetaclient.ThetaRepository.NotConnectedException: Failed to connect to InetSocketAddress(hostname=, port=80)., KotlinExceptionOrigin=}

As I’m not an expert with theta-client, I feel you’ll get the best help if you open up a GitHub issue and start a communication process directly with the RICOH engineers.

I’ll try again on iOS native with the SC2. I do not have an S.

docs for theta-client are here:

Thanks, I will open an issue on github.


I notice that the SC2 is not listed as a supported model with theta-client.

GitHub - ricohapi/theta-client: A library to control RICOH THETA

I did test the theta-client ios demo (native) with X and it worked fine.

I also tested the Flutter iOS demo with the SC2 and it worked fine.

I have an SC2 in my office and I’m in the process of installing XCode on a MacBook Air here. I’m test the SC2 after I finish setting up the company MacBook Air.

Hey Craig, as it says it supports SC, so I just test with SC and iphoneX, the image decoded issue is gone, but it still has connection problem, please see the video link. The error appears at around 1:23.

Are you using a release version of theta-client? Or, are you using the code from the main branch?

Can you upgrade the SC2B firmware from 6.41 to 6.52?

Download | RICOH THETA

I still haven’t tested it with SC2 yet. I just installed XCode.

Thanks for reminding me this, I’ll test with this version tomorrow

I’m reposting the information about this problem from the issue on GitHub. Let’s move this discussion regarding theta-client to GitHub.

Connection issue with ios demo project · Issue #38 · ricohapi/theta-client · GitHub

We have found two problems in iOS demo.

(1) In ThetaSdk.swift:
Function Theta.livePreview() has wrong callback function invoke().

(2) In TakePhotoView.swift:
When back button is tapped, getThetaInfo() is called before finishing getLivePreview().

To fix the first problem, please replace the 76th line through the 93th line of ThetaSdk.swift with following codes:

            func invoke(p1: Any?) async throws -> Any? {
                let now = CACurrentMediaTime()
                if (now - last > Self.FrameInterval) {
                    var result = false
                    autoreleasepool {
                        if let frameData = p1 as? KotlinPair<KotlinByteArray, KotlinInt> {
                            let nsData = PlatformKt.frameFrom(
                                packet: frameData
                            result = handler(nsData)
                    last = now
                    return result
                } else {
                    return true

To fix the second problem, please replace the 59th line through 61th line of TakePhotoView.swift with following codes:

                    Button(action: {
                        previewing = false
                        DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {

We will include these changes to the next release.