Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-89276

[Android]JNI crash at QMediaPlayer::setVolume and ::setCustomAudioRole

    XMLWordPrintable

Details

    • Android

    Description

      I'm getting a big number of reports in my Google Play Console regarding QMediaPlayer.

      backtrace:
        #00  pc 000000000001db48  /system/lib64/libc.so (abort+104)
        #00  pc 00000000004753b0  /system/lib64/libart.so (art::Runtime::Abort(char const*)+552)
        #00  pc 000000000056b1d0  /system/lib64/libart.so (android::base::LogMessage::~LogMessage()+1080)
        #00  pc 00000000002fd3c0  /system/lib64/libart.so (art::JavaVMExt::JniAbort(char const*, char const*)+1700)
        #00  pc 00000000002fd614  /system/lib64/libart.so (art::JavaVMExt::JniAbortF(char const*, char const*, ...)+180)
        #00  pc 000000000034d4ec  /system/lib64/libart.so (art::JNI::CallIntMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+1384)
        #00  pc 0000000000233c18  /data/app/com.gsoftteam.solitairetripeaks-9WjqbRXRFt1ncZzARVO6rw==/lib/arm64/libQt5Core_arm64-v8a.so (int QJNIObjectPrivate::callMethodV<int>(char const*, char const*, std::__va_list) const)
        #00  pc 0000000000233c68  /data/app/com.gsoftteam.solitairetripeaks-9WjqbRXRFt1ncZzARVO6rw==/lib/arm64/libQt5Core_arm64-v8a.so (int QJNIObjectPrivate::callMethod<int>(char const*, char const*, ...) const)
        #00  pc 000000000007be04  /data/app/com.gsoftteam.solitairetripeaks-9WjqbRXRFt1ncZzARVO6rw==/lib/arm64/libQt5Multimedia_arm64-v8a.so (QMediaPlayer::setVolume(int))
      

      I haven't been able to reproduce the bug on any of my devices so far.

      But apparently the bug is triggered from androidmediaplayer.cpp:

      void AndroidMediaPlayer::setVolume(int volume)
      {
          mMediaPlayer.callMethod<void>("setVolume", "(I)V", jint(volume));
      }
      

      I noticed similar issues with setCustomAudioRole. I wanted to include in production a isValid() check for mMediaPlayer before calling the JNI methods, but I haven't been successful in compiling qtmultimedia for Android.

      I'm not sure if this is even relevant, but in my QML apps I dynamically create Audio instances on demand and destroy them when they are no longer needed.

      Attachments

        1. QTBUG-89276[1].JPG
          QTBUG-89276[1].JPG
          197 kB
        2. QTBUG-89276[2].JPG
          QTBUG-89276[2].JPG
          196 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtandroidteam Qt Android Team
            adrian.gabureanu Adrian Gabureanu
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes