Skip to content

Mobile and Embedded

The forum for developing everything embedded: Linux, WinCE, Symbian, MeeGo... you name it.
13.9k Topics 61.7k Posts
  • How to set app icon?

    Unsolved
    4
    0 Votes
    4 Posts
    553 Views
    SGaistS

    @Gilberrt hi, it's literally the first platform explained in the link posted by the OP. Qt 5 and Qt 6.

  • 0 Votes
    2 Posts
    130 Views
    J

    Hello,

    To remove the small lines with triangles (scroll indicators) above and below the scroll bar in your QComboBox’s QListView, you can customize the style of the scroll bar using a stylesheet. Here’s how you can do it:
    Set the Scroll Bar Policy: Ensure that the scroll bar is set to always show or hide as needed.
    Customize the Scroll Bar Style: Use a stylesheet to hide the scroll indicators.
    Hope that helps.

  • Native phone application performance or C++ performance

    Unsolved
    3
    0 Votes
    3 Posts
    206 Views
    S

    "Native code" means native to the processor. The processor does not understand Java or Swift. Swift is also compiled into "native code" whereas Java is usually compiled to bytecode which is then converted to native code by the Java VM. So, at least in theory your C++ Qt app should be faster than Java on Android and has the potential to be as fast as Swift on iOS (if not even faster according to a recent study). QML, however, is a different story: By default this is compiled at runtime (though there is an option to pre-compile it, I think). You might still include some code in JavaScript with QML. JavaScript generally performs worse than Java.

    Generally speaking, you don't pay a performance penalty for using C++ on these platform. But, you might pay a performance penalty for using QML because it is not using native GUI elements (as far as my knowledge goes; I don't use QML personally). For most apps I doubt you'll notice the overhead of using QML.

    Maybe someone with more experience using QML can chime in.

  • 0 Votes
    14 Posts
    1k Views
    A

    Here's a complete patch for hacks according to @Jojojoris's investigation and changes to make video playback work with un-extended GLES2. I have only tested it with the GStreamer backend where it does work in my situation: VP8 video resulting in NV12 format, i.MX6 DualLite SoC, Linux 5.15.74, etnaviv driver from Mesa 22.1.7.

    Since it isn't possible to paste files here, I'm pasting it as a code block. The file name would be: 0001-HACK-disable-texture-and-pixel-formats-that-don-t-wo.patch

    From 7a194147152534efd213346771ce3af135e3df02 Mon Sep 17 00:00:00 2001 From: Andreas Hartmetz <andreas@ixgreen.de> Date: Thu, 1 Aug 2024 14:10:27 +0200 Subject: [PATCH] HACK: disable texture and pixel formats that don't work with GLES2 Un-extended GLES2 doesn't support R8 and RG8 texture formats. For R8, RHI's RED_OR_ALPHA8 is a suitable workaround resulting in A[lpha]8, but for RG8, there is no simple workaround. To avoid the need for RG8, crudely mark the NV12 and NV21 pixel formats whose OpenGL pixel conversion shaders require it as unsupported in the commonly used GStreamer and FFMPEG backends. Symptoms without this hack, on i.MX6 DualLite / etnaviv: OpenGL error messages about unsupported texture format R8 and the video output is just solid green. Mostly based on a post of user Jojojoris on forum.qt.io. --- src/multimedia/shaders/yuv_triplanar.frag | 6 +++--- src/multimedia/shaders/yuv_triplanar_p10.frag | 6 +++--- src/multimedia/shaders/yvu_triplanar.frag | 6 +++--- src/multimedia/video/qvideotexturehelper.cpp | 20 +++++++++---------- .../multimedia/ffmpeg/qffmpegvideobuffer.cpp | 9 +++++++++ .../common/qgstvideorenderersink.cpp | 6 ++++++ 6 files changed, 34 insertions(+), 19 deletions(-) diff --git a/src/multimedia/shaders/yuv_triplanar.frag b/src/multimedia/shaders/yuv_triplanar.frag index 5b83b05b5..0d3ab7a2c 100644 --- a/src/multimedia/shaders/yuv_triplanar.frag +++ b/src/multimedia/shaders/yuv_triplanar.frag @@ -6,20 +6,20 @@ layout(location = 0) in vec2 texCoord; layout(location = 0) out vec4 fragColor; layout(binding = 1) uniform sampler2D plane1Texture; layout(binding = 2) uniform sampler2D plane2Texture; layout(binding = 3) uniform sampler2D plane3Texture; void main() { - float Y = texture(plane1Texture, texCoord).r; - float U = texture(plane2Texture, texCoord).r; - float V = texture(plane3Texture, texCoord).r; + float Y = texture(plane1Texture, texCoord).a; + float U = texture(plane2Texture, texCoord).a; + float V = texture(plane3Texture, texCoord).a; vec4 color = vec4(Y, U, V, 1.); fragColor = ubuf.colorMatrix * color * ubuf.opacity; #ifdef QMM_OUTPUTSURFACE_LINEAR fragColor = convertSRGBToLinear(fragColor); #endif } diff --git a/src/multimedia/shaders/yuv_triplanar_p10.frag b/src/multimedia/shaders/yuv_triplanar_p10.frag index bac34c72c..fbbed3506 100644 --- a/src/multimedia/shaders/yuv_triplanar_p10.frag +++ b/src/multimedia/shaders/yuv_triplanar_p10.frag @@ -6,20 +6,20 @@ layout(location = 0) in vec2 texCoord; layout(location = 0) out vec4 fragColor; layout(binding = 1) uniform sampler2D plane1Texture; layout(binding = 2) uniform sampler2D plane2Texture; layout(binding = 3) uniform sampler2D plane3Texture; void main() { - float Y = texture(plane1Texture, texCoord).r * 64; - float U = texture(plane2Texture, texCoord).r * 64; - float V = texture(plane3Texture, texCoord).r * 64; + float Y = texture(plane1Texture, texCoord).a * 64; + float U = texture(plane2Texture, texCoord).a * 64; + float V = texture(plane3Texture, texCoord).a * 64; vec4 color = vec4(Y, U, V, 1.); fragColor = ubuf.colorMatrix * color * ubuf.opacity; #ifdef QMM_OUTPUTSURFACE_LINEAR fragColor = convertSRGBToLinear(fragColor); #endif } diff --git a/src/multimedia/shaders/yvu_triplanar.frag b/src/multimedia/shaders/yvu_triplanar.frag index 37fc3a18d..cfe406f2a 100644 --- a/src/multimedia/shaders/yvu_triplanar.frag +++ b/src/multimedia/shaders/yvu_triplanar.frag @@ -6,20 +6,20 @@ layout(location = 0) in vec2 texCoord; layout(location = 0) out vec4 fragColor; layout(binding = 1) uniform sampler2D plane1Texture; layout(binding = 2) uniform sampler2D plane2Texture; layout(binding = 3) uniform sampler2D plane3Texture; void main() { - float Y = texture(plane1Texture, texCoord).r; - float V = texture(plane2Texture, texCoord).r; - float U = texture(plane3Texture, texCoord).r; + float Y = texture(plane1Texture, texCoord).a; + float V = texture(plane2Texture, texCoord).a; + float U = texture(plane3Texture, texCoord).a; vec4 color = vec4(Y, U, V, 1.); fragColor = ubuf.colorMatrix * color * ubuf.opacity; #ifdef QMM_OUTPUTSURFACE_LINEAR fragColor = convertSRGBToLinear(fragColor); #endif } diff --git a/src/multimedia/video/qvideotexturehelper.cpp b/src/multimedia/video/qvideotexturehelper.cpp index 3675e157f..0627cf556 100644 --- a/src/multimedia/video/qvideotexturehelper.cpp +++ b/src/multimedia/video/qvideotexturehelper.cpp @@ -88,97 +88,97 @@ static const TextureDescription descriptions[QVideoFrameFormat::NPixelFormats] = }, // Format_AYUV_Premultiplied { 1, 4, [](int stride, int height) { return stride*height; }, { QRhiTexture::RGBA8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 1 }, { 1, 1 } } }, // Format_YUV420P { 3, 1, [](int stride, int height) { return stride * ((height * 3 / 2 + 1) & ~1); }, - { QRhiTexture::R8, QRhiTexture::R8, QRhiTexture::R8 }, + { QRhiTexture::RED_OR_ALPHA8, QRhiTexture::RED_OR_ALPHA8, QRhiTexture::RED_OR_ALPHA8 }, { { 1, 1 }, { 2, 2 }, { 2, 2 } } }, // Format_YUV422P { 3, 1, [](int stride, int height) { return stride * ((height * 3 / 2 + 1) & ~1); }, - { QRhiTexture::R8, QRhiTexture::R8, QRhiTexture::R8 }, + { QRhiTexture::RED_OR_ALPHA8, QRhiTexture::RED_OR_ALPHA8, QRhiTexture::RED_OR_ALPHA8 }, { { 1, 1 }, { 2, 1 }, { 2, 1 } } }, // Format_YV12 { 3, 1, [](int stride, int height) { return stride * ((height * 3 / 2 + 1) & ~1); }, - { QRhiTexture::R8, QRhiTexture::R8, QRhiTexture::R8 }, + { QRhiTexture::RED_OR_ALPHA8, QRhiTexture::RED_OR_ALPHA8, QRhiTexture::RED_OR_ALPHA8 }, { { 1, 1 }, { 2, 2 }, { 2, 2 } } }, // Format_UYVY { 1, 2, [](int stride, int height) { return stride*height; }, { QRhiTexture::RGBA8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 2, 1 }, { 1, 1 }, { 1, 1 } } }, // Format_YUYV { 1, 2, [](int stride, int height) { return stride*height; }, { QRhiTexture::RGBA8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 2, 1 }, { 1, 1 }, { 1, 1 } } }, // Format_NV12 { 2, 1, [](int stride, int height) { return stride * ((height * 3 / 2 + 1) & ~1); }, - { QRhiTexture::R8, QRhiTexture::RG8, QRhiTexture::UnknownFormat }, + { QRhiTexture::RED_OR_ALPHA8, QRhiTexture::RG8, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 2, 2 }, { 1, 1 } } }, // Format_NV21 { 2, 1, [](int stride, int height) { return stride * ((height * 3 / 2 + 1) & ~1); }, - { QRhiTexture::R8, QRhiTexture::RG8, QRhiTexture::UnknownFormat }, + { QRhiTexture::RED_OR_ALPHA8, QRhiTexture::RG8, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 2, 2 }, { 1, 1 } } }, // Format_IMC1 { 3, 1, [](int stride, int height) { // IMC1 requires that U and V components are aligned on a multiple of 16 lines int h = (height + 15) & ~15; h += 2*(((h/2) + 15) & ~15); return stride * h; }, - { QRhiTexture::R8, QRhiTexture::R8, QRhiTexture::R8 }, + { QRhiTexture::RED_OR_ALPHA8, QRhiTexture::RED_OR_ALPHA8, QRhiTexture::RED_OR_ALPHA8 }, { { 1, 1 }, { 2, 2 }, { 2, 2 } } }, // Format_IMC2 { 2, 1, [](int stride, int height) { return 2*stride*height; }, - { QRhiTexture::R8, QRhiTexture::R8, QRhiTexture::UnknownFormat }, + { QRhiTexture::RED_OR_ALPHA8, QRhiTexture::RED_OR_ALPHA8, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 2 }, { 1, 1 } } }, // Format_IMC3 { 3, 1, [](int stride, int height) { // IMC3 requires that U and V components are aligned on a multiple of 16 lines int h = (height + 15) & ~15; h += 2*(((h/2) + 15) & ~15); return stride * h; }, - { QRhiTexture::R8, QRhiTexture::R8, QRhiTexture::R8 }, + { QRhiTexture::RED_OR_ALPHA8, QRhiTexture::RED_OR_ALPHA8, QRhiTexture::RED_OR_ALPHA8 }, { { 1, 1 }, { 2, 2 }, { 2, 2 } } }, // Format_IMC4 { 2, 1, [](int stride, int height) { return 2*stride*height; }, - { QRhiTexture::R8, QRhiTexture::R8, QRhiTexture::UnknownFormat }, + { QRhiTexture::RED_OR_ALPHA8, QRhiTexture::RED_OR_ALPHA8, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 2 }, { 1, 1 } } }, // Format_Y8 { 1, 1, [](int stride, int height) { return stride*height; }, - { QRhiTexture::R8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, + { QRhiTexture::RED_OR_ALPHA8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 1 }, { 1, 1 } } }, // Format_Y16 { 1, 2, [](int stride, int height) { return stride*height; }, { QRhiTexture::R16, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 1 }, { 1, 1 } } }, // Format_P010 { 2, 2, diff --git a/src/plugins/multimedia/ffmpeg/qffmpegvideobuffer.cpp b/src/plugins/multimedia/ffmpeg/qffmpegvideobuffer.cpp index 7b72a3cfe..d70e9cb9c 100644 --- a/src/plugins/multimedia/ffmpeg/qffmpegvideobuffer.cpp +++ b/src/plugins/multimedia/ffmpeg/qffmpegvideobuffer.cpp @@ -264,24 +264,33 @@ QVideoFrameFormat::PixelFormat QFFmpegVideoBuffer::toQtPixelFormat(AVPixelFormat case AV_PIX_FMT_YUV422P: return QVideoFrameFormat::Format_YUV422P; case AV_PIX_FMT_YUV420P: return QVideoFrameFormat::Format_YUV420P; case AV_PIX_FMT_YUV420P10: return QVideoFrameFormat::Format_YUV420P10; case AV_PIX_FMT_UYVY422: return QVideoFrameFormat::Format_UYVY; case AV_PIX_FMT_YUYV422: return QVideoFrameFormat::Format_YUYV; +// The following two are disabled because the pixel format conversion shader for these requires the RG8 pixel +// format, which is not supported in OpenGL ES2 without GL_EXT_texture_rg, which etnaviv does not currently +// (July 2024) support. It will probably come with OpenGL ES3 support in etnaviv, which seems to be the focus +// of its development. ES3 supports RG8 textures in the base specification. +// (UNTESTED. It is possible that this crude approach breaks something or everything video-related. It might +// be necessary to recognize these formats in situations other than "which Qt format should we choose for the +// output buffer".) +#if 0 case AV_PIX_FMT_NV12: return QVideoFrameFormat::Format_NV12; case AV_PIX_FMT_NV21: return QVideoFrameFormat::Format_NV21; +#endif case AV_PIX_FMT_GRAY8: return QVideoFrameFormat::Format_Y8; case AV_PIX_FMT_GRAY16: return QVideoFrameFormat::Format_Y16; case AV_PIX_FMT_P010: return QVideoFrameFormat::Format_P010; case AV_PIX_FMT_P016: return QVideoFrameFormat::Format_P016; case AV_PIX_FMT_MEDIACODEC: diff --git a/src/plugins/multimedia/gstreamer/common/qgstvideorenderersink.cpp b/src/plugins/multimedia/gstreamer/common/qgstvideorenderersink.cpp index d67319fdd..e6a572210 100644 --- a/src/plugins/multimedia/gstreamer/common/qgstvideorenderersink.cpp +++ b/src/plugins/multimedia/gstreamer/common/qgstvideorenderersink.cpp @@ -55,22 +55,28 @@ void QGstVideoRenderer::createSurfaceCaps() auto caps = QGstCaps::create(); // All the formats that both we and gstreamer support auto formats = QList<QVideoFrameFormat::PixelFormat>() << QVideoFrameFormat::Format_YUV420P << QVideoFrameFormat::Format_YUV422P << QVideoFrameFormat::Format_YV12 << QVideoFrameFormat::Format_UYVY << QVideoFrameFormat::Format_YUYV +// The following two are disabled because the pixel format conversion shader for these requires the RG8 +// pixel format, which is not supported in OpenGL ES2 without GL_EXT_texture_rg, which etnaviv does not +// currently (July 2024) support. It will probably come with OpenGL ES3 support in etnaviv, which seems to +// be the focus of its development. ES3 supports RG8 textures in the base specification. +#if 0 << QVideoFrameFormat::Format_NV12 << QVideoFrameFormat::Format_NV21 +#endif << QVideoFrameFormat::Format_AYUV << QVideoFrameFormat::Format_P010 << QVideoFrameFormat::Format_XRGB8888 << QVideoFrameFormat::Format_XBGR8888 << QVideoFrameFormat::Format_RGBX8888 << QVideoFrameFormat::Format_BGRX8888 << QVideoFrameFormat::Format_ARGB8888 << QVideoFrameFormat::Format_ABGR8888 << QVideoFrameFormat::Format_RGBA8888 << QVideoFrameFormat::Format_BGRA8888 -- 2.43.0
  • 0 Votes
    15 Posts
    6k Views
    M

    @iSolve_Tech You are asking in a solved thread something that has nothing to do with the threads topic

  • 0 Votes
    3 Posts
    182 Views
    KaguroK

    Hello @samuel898
    Unfortunately it was not solved :( no one wrote a comment, there is no solution on stack overflow... I already asked the question on Qt Bug Report, but they didn't respond to it even there. :(
    https://bugreports.qt.io/browse/QTBUG-127495
    https://stackoverflow.com/questions/78792793/qcombobox-stops-working-after-tap-back-navigation-on-android-in-qt-6-4-2-c
    I will write it if i have a solution about this.

  • Gradle error building for Android

    Solved
    3
    0 Votes
    3 Posts
    208 Views
    mrdebugM

    In order to build an Android app using Debian 12 and the last qtcreator I have to:

    switch between jdk 12 and 17 remove to recreate the file pro.user close and reopen qtcreator
    After that qtcreator can builds a valid android app. I have to do this each time I want to open a project.
  • Performance of QVector append

    Unsolved
    7
    0 Votes
    7 Posts
    341 Views
    S

    @SeDi said in Performance of QVector append:

    A QVector<Item*> is not feasible?

    Pointers mean more allocations. And allocations are slow. If you don't have any specific reason for pointers, prefer QVector<Item> over QVector<Item*>.

  • 0 Votes
    4 Posts
    229 Views
    jsulmJ

    @Clovr Can you please answer all questions? Especially whether you're starting debug or release builds of these applications.

  • How to make a Virtual Keyboard that can input Chinese

    Unsolved
    3
    0 Votes
    3 Posts
    139 Views
    SGaistS

    Hi and welcome to devnet,

    Are you looking for QtVirtualKeyboard ?

  • accessing QIOSViewController

    Solved
    3
    0 Votes
    3 Posts
    140 Views
    M

    Thank you! this worked for me

  • 0 Votes
    2 Posts
    98 Views
    F

    @Marker said in [Boot2Qt 6.7.0 for Beaglebone Black (meta-boot2qt-ti) does not build cape overlays]myloweslife(/post/802586):

    Trying to get boot2qt working on the BeagleBone Black with a touchscreen display. It builds and boots fine, but it does not seem to compile any cape overlays. I can see them downloaded into the work directory (for example "tmp/work-shared/beaglebone/kernel-source/arch/arm/boot/dts/overlays/BBORG_RELAY-00A2.dts"), but they do not get compiled (.dtbo) and included in the image.

    I was able to compile a few of them manually, but I would prefer to have it done autmatically.

    Does anyone know how I can enable this "feature"?

    Thanks

    Hello,

    To enable automatic compilation of Device Tree Overlays (DTBOs) on the BeagleBone Black, follow these steps:

    Device Tree Overlays (DTOs):
    Device Tree Overlays allow you to customize the Device Tree of a given board, describing components added externally (such as capes or expansion boards) or tweaking pin multiplexing.
    DTBOs are fragments used to modify the Device Tree at runtime without recompiling the entire kernel.
    Compile DTBOs Automatically:
    First, ensure you have the source code for your overlay (e.g., BBORG_RELAY-00A2.dts).
    Use the Device Tree Compiler (DTC) to compile the overlay into a DTBO file

    dtc -O dtb -o BBORG_RELAY-00A2.dtbo BBORG_RELAY-00A2.dts

    Copy the resulting .dtbo file to /lib/firmware.
    Load DTBOs at Boot:
    Modify the U-Boot options (usually in /```
    boot/uEnv.txt

    cape_enable=capemgr.enable_partno=BBORG_RELAY-00A2.dtbo

    Reboot: Reboot your BeagleBone Black, and the DTBO will be automatically loaded. Remember to adjust the filenames and paths according to your specific overlay. This approach allows you to customize the Device Tree without recompiling the entire kernel. Hope this will help you. Best regards, florence023
  • 0 Votes
    2 Posts
    88 Views
    SGaistS

    Hi and welcome to devnet,

    QWindow comes to mind for that.

    However, depending on what your application does, QtQuick might be a good alternative.

  • Qt Android OpenGL integration

    Unsolved
    2
    0 Votes
    2 Posts
    130 Views
    No one has replied
  • Update Qt 6.6.1 to 6.7.2

    Unsolved
    4
    0 Votes
    4 Posts
    278 Views
    F

    @marisHealthCareGov said in Update Qt 6.6.1 to 6.7.2:

    No solution to the problem.
    I am using the old version 6.6.1

    Okay, Thanks for the reply.

  • How to use activity-alias to manage app arguments

    Solved
    2
    0 Votes
    2 Posts
    320 Views
    G

    Hello,

    You need to configure more parameters inside your activity-alias

    <activity-alias android:name=".Test" android:enabled="true" android:exported="true" android:label="-- %%INSERT_APP_NAME%% --" android:targetActivity="org.qtproject.qt.android.bindings.QtActivity">

    Add copy all meta-data needed by the default activity to start

  • No qDebug()<<"Output"; on android

    2
    0 Votes
    2 Posts
    242 Views
    M

    I don't understand why but qWarning() works OK ;)

    other solution, use spdlog

    #include "spdlog/sinks/android_sink.h" // auto file_sink = std::make_shared<spdlog::sinks::basic_file_sink_mt>("logs/multisink.txt", true); // file_sink->set_level(spdlog::level::trace); auto android_sink = std::make_shared<spdlog::sinks::android_sink_mt>("ssss", false); android_sink->set_pattern("[multi_sink_example] [%^%l%$] %v"); // to dziala jak jest "false" powyżej spdlog::set_default_logger(std::make_shared<spdlog::logger>("multi_sink", spdlog::sinks_init_list({android_sink // ,file_sink })) ); spdlog::info("###############################!!!!!!!!!!!!!###############");
  • Unable to debug the Android Application Waiting for Debugger

    Unsolved
    14
    0 Votes
    14 Posts
    2k Views
    cristian-adamC

    At https://bugreports.qt.io/browse/QTCREATORBUG-31277 I have a similar case, but with Windows as host.

    I've added more logging for the jdb debugger settling in newer Qt Creator versions. On my machine I've got from Tools > Debug Qt Creator > Show Logs... and checking the Debug checkbox for qtc.android.run.androidrunnerworker something like:

    18:03:12.238 qtc.android.run.androidrunnerworker: QML debugging enabled 18:03:12.238 qtc.android.run.androidrunnerworker: QML server: "tcp://127.0.0.1:63927" 18:03:12.238 qtc.android.run.androidrunnerworker: Environment variables for the app QList() 18:03:12.252 qtc.android.run.androidrunnerworker: Device Serial: emulator-5554 , API level: 34 , Extra Start Args: QList() , Before Start ADB cmds: QList() , After finish ADB cmds: QList() , Debug server path: /Users/cristian/Library/Android/sdk/ndk/26.2.11394342/toolchains/llvm/prebuilt/darwin-x86_64/lib/clang/17.0.2/lib/linux/aarch64/lldb-server 18:03:12.340 qtc.android.run.androidrunnerworker: Running logcat command (async): /Users/cristian/Library/Android/sdk/platform-tools/adb -s emulator-5554 logcat -T '07-22 18:03:09.033' 18:03:12.378 qtc.android.run.androidrunnerworker: Using application arguments: QList(-qmljsdebugger=port:63927,block,services:DebugMessages,QmlDebugger,V8Debugger,QmlInspector,DebugTranslation) 18:03:12.741 qtc.android.run.androidrunnerworker: Process ID changed from: -1 to: 18195 18:03:12.783 qtc.android.run.androidrunnerworker: Starting JDB: /opt/homebrew/Cellar/openjdk@17/17.0.12/bin/jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=5038 18:03:12.855 qtc.android.run.androidrunnerworker: Uploading GdbServer 18:03:13.135 qtc.android.run.androidrunnerworker: Debugger process started 18:03:14.357 qtc.android.run.androidrunnerworker: Handle JDB settled 18:03:14.861 qtc.android.run.androidrunnerworker: JDB output: "Set uncaught java.lang.Throwable\nSet deferred uncaught java.lang.Throwable\nInitializing jdb ...\n> " 18:03:14.861 qtc.android.run.androidrunnerworker: JDB input: "ignore uncaught java.lang.Throwable" 18:03:15.361 qtc.android.run.androidrunnerworker: JDB output: "" 18:03:15.862 qtc.android.run.androidrunnerworker: JDB output: "" 18:03:16.086 qtc.android.run.androidrunnerworker: JDB output: "Removed: uncaught java.lang.Throwable\n> " 18:03:16.086 qtc.android.run.androidrunnerworker: JDB input: "threads" 18:03:16.090 qtc.android.run.androidrunnerworker: JDB output: "Group system:\n" 18:03:16.129 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24861 Signal Catcher cond. waiting\n" 18:03:16.133 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24862 ADB-JDWP Connection Control Thread cond. waiting\n" 18:03:16.137 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24863 HeapTaskDaemon cond. waiting\n" 18:03:16.141 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24864 Jit thread pool worker thread 0 running\n" 18:03:16.146 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24865 FinalizerWatchdogDaemon cond. waiting\n" 18:03:16.150 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24866 FinalizerDaemon cond. waiting\n" 18:03:16.153 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24867 ReferenceQueueDaemon cond. waiting\n" 18:03:16.157 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24871 Profile Saver running\n" 18:03:16.162 qtc.android.run.androidrunnerworker: JDB output: "Group main:\n" 18:03:16.165 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24853 main sleeping\n" 18:03:16.169 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24868 binder:18195_1 running\n" 18:03:16.173 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24869 binder:18195_2 running\n" 18:03:16.177 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24870 binder:18195_3 running\n" 18:03:16.182 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24860 RenderThread running\n" 18:03:16.186 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24887 qtMainLoopThread cond. waiting\n> " 18:03:16.186 qtc.android.run.androidrunnerworker: JDB input: "cont" 18:03:16.186 qtc.android.run.androidrunnerworker: JDB output: "> Nothing suspended.\n" 18:03:16.186 qtc.android.run.androidrunnerworker: JDB input: "exit" 18:03:16.191 qtc.android.run.androidrunnerworker: JDB settled

    Check the logs. /opt/homebrew/Cellar/openjdk@17/17.0.12/bin/jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=5038 is the part that's important.

    jdb needs to connect to the device on port 5038.

    Alternatively you can start Qt Creator as QT_LOGGING_RULES=qtc.android*=true qtcreator to get all the Qt Creator android logging.

  • 0 Votes
    5 Posts
    1k Views
    cristian-adamC

    @seijikun you are correct in the analysis. The jdb debugger is not settling.

    At https://bugreports.qt.io/browse/QTCREATORBUG-31277 I have a similar case, but with Windows as host.

    I've added more logging for the jdb debugger settling. On my machine I've got from qtc.android.run.androidrunnerworker something like:

    18:03:12.238 qtc.android.run.androidrunnerworker: QML debugging enabled 18:03:12.238 qtc.android.run.androidrunnerworker: QML server: "tcp://127.0.0.1:63927" 18:03:12.238 qtc.android.run.androidrunnerworker: Environment variables for the app QList() 18:03:12.252 qtc.android.run.androidrunnerworker: Device Serial: emulator-5554 , API level: 34 , Extra Start Args: QList() , Before Start ADB cmds: QList() , After finish ADB cmds: QList() , Debug server path: /Users/cristian/Library/Android/sdk/ndk/26.2.11394342/toolchains/llvm/prebuilt/darwin-x86_64/lib/clang/17.0.2/lib/linux/aarch64/lldb-server 18:03:12.340 qtc.android.run.androidrunnerworker: Running logcat command (async): /Users/cristian/Library/Android/sdk/platform-tools/adb -s emulator-5554 logcat -T '07-22 18:03:09.033' 18:03:12.378 qtc.android.run.androidrunnerworker: Using application arguments: QList(-qmljsdebugger=port:63927,block,services:DebugMessages,QmlDebugger,V8Debugger,QmlInspector,DebugTranslation) 18:03:12.741 qtc.android.run.androidrunnerworker: Process ID changed from: -1 to: 18195 18:03:12.783 qtc.android.run.androidrunnerworker: Starting JDB: /opt/homebrew/Cellar/openjdk@17/17.0.12/bin/jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=5038 18:03:12.855 qtc.android.run.androidrunnerworker: Uploading GdbServer 18:03:13.135 qtc.android.run.androidrunnerworker: Debugger process started 18:03:14.357 qtc.android.run.androidrunnerworker: Handle JDB settled 18:03:14.861 qtc.android.run.androidrunnerworker: JDB output: "Set uncaught java.lang.Throwable\nSet deferred uncaught java.lang.Throwable\nInitializing jdb ...\n> " 18:03:14.861 qtc.android.run.androidrunnerworker: JDB input: "ignore uncaught java.lang.Throwable" 18:03:15.361 qtc.android.run.androidrunnerworker: JDB output: "" 18:03:15.862 qtc.android.run.androidrunnerworker: JDB output: "" 18:03:16.086 qtc.android.run.androidrunnerworker: JDB output: "Removed: uncaught java.lang.Throwable\n> " 18:03:16.086 qtc.android.run.androidrunnerworker: JDB input: "threads" 18:03:16.090 qtc.android.run.androidrunnerworker: JDB output: "Group system:\n" 18:03:16.129 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24861 Signal Catcher cond. waiting\n" 18:03:16.133 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24862 ADB-JDWP Connection Control Thread cond. waiting\n" 18:03:16.137 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24863 HeapTaskDaemon cond. waiting\n" 18:03:16.141 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24864 Jit thread pool worker thread 0 running\n" 18:03:16.146 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24865 FinalizerWatchdogDaemon cond. waiting\n" 18:03:16.150 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24866 FinalizerDaemon cond. waiting\n" 18:03:16.153 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24867 ReferenceQueueDaemon cond. waiting\n" 18:03:16.157 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24871 Profile Saver running\n" 18:03:16.162 qtc.android.run.androidrunnerworker: JDB output: "Group main:\n" 18:03:16.165 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24853 main sleeping\n" 18:03:16.169 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24868 binder:18195_1 running\n" 18:03:16.173 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24869 binder:18195_2 running\n" 18:03:16.177 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24870 binder:18195_3 running\n" 18:03:16.182 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24860 RenderThread running\n" 18:03:16.186 qtc.android.run.androidrunnerworker: JDB output: " (java.lang.Thread)24887 qtMainLoopThread cond. waiting\n> " 18:03:16.186 qtc.android.run.androidrunnerworker: JDB input: "cont" 18:03:16.186 qtc.android.run.androidrunnerworker: JDB output: "> Nothing suspended.\n" 18:03:16.186 qtc.android.run.androidrunnerworker: JDB input: "exit" 18:03:16.191 qtc.android.run.androidrunnerworker: JDB settled

    Please try it out with Qt Creator 13 or newer.

  • 0 Votes
    6 Posts
    333 Views
    Axel SpoerlA

    Emulation adds layers to about everything. It's therefore more error-prone and never 100% on the level of a physical device.
    The fact that it works on physical devices, indicates that the issue is more likely to be in the emulation layer, than in Qt.