Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Bug in QtMultimedia QAudioOutput ALSA module
Forum Updated to NodeBB v4.3 + New Features

Bug in QtMultimedia QAudioOutput ALSA module

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rykomick
    wrote on last edited by
    #1

    Hello,

    I'm writing multimedia applications with QT and I think I have found a bug. In this function:

    839 qint64 OutputPrivate::writeData(const char* data, qint64 len)
    840 {
    841 int retry = 0;
    842 qint64 written = 0;
    843 if((audioDevice->deviceState == QAudio::ActiveState)
    844 ||(audioDevice->deviceState == QAudio::IdleState)) {
    845 while(written < len) {
    846 int chunk = audioDevice->write(data+written,(len-written));
    847 if(chunk <= 0)
    848 retry++;
    849 written+=chunk;
    850 if(retry > 10)
    851 return written;
    852 }
    853 }
    854 return written;
    855
    856 }

    If audioDevice->write ( line 846 ) returns an negative error code to chunk variable it must not be added to the written variable.

    Besides of that it seems that the whole approach of using ALSA API in this module wrong and is causing ridicoulusly high CPU usage. Mainly because it uses non blocking mode and tries to write ( syscall !!! ) multiple times without at a sleep call in between. Just lik in the function above.

    Who is responsible for this? Can I provide an patch?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      steno
      wrote on last edited by
      #2

      Try looking if there has been a bug logged against it, or log one yourself. "bug report":https://bugreports.qt-project.org

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved