Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. The QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)) return only one audio device(default device) on three audio out devices. Why?

The QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)) return only one audio device(default device) on three audio out devices. Why?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 505 Views
  • 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.
  • A Offline
    A Offline
    anukutten007
    wrote on last edited by
    #1

    Question:

    1. The QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)) return only one audio device(default device) from three audio out devices. Why?
    Total three audio out devices are available and while checking with ALSA devices verified the output using "tinyplay" utility by command line.
    But it is shown in QAudioDeviceInfo::availableDevices(). Do we need to do any update on configurations?
    Note:
    Used the sample code on qt samples for audiooutput. Only one device return.

    m_deviceBox->addItem(defaultDeviceInfo.deviceName(), qVariantFromValue(defaultDeviceInfo));
    foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)) {
    if (deviceInfo != defaultDeviceInfo) {
    m_deviceBox->addItem(deviceInfo.deviceName(), qVariantFromValue(deviceInfo));
    }
    }

    2. How to set a particular ALSA device(for eg: card0, device 0) as default audio device?
    In this case QAudioDeviceInfo::defaultOutputDevice() is set as device 0 on sound card2.

    Please see below for details........

    System Setup:
    Target Board : iMX6Q Sabre AI
    OS : Android M6
    Qt : QT 5.8

    Available Sound Cards:
    root@sabreauto_6q:/ # cat /proc/asound/cards
    0 [cs42888audio ]: cs42888-audio - cs42888-audio
    cs42888-audio
    1 [imxspdif ]: imx-spdif - imx-spdif
    imx-spdif
    2 [imxhdmisoc ]: imx-hdmi-soc - imx-hdmi-soc
    imx-hdmi-soc

    Available Sound Devices:
    root@sabreauto_6q:/ # cat /proc/asound/card0/
    id pcm0c/ pcm0p/ pcm1c/ pcm1p/
    root@sabreauto_6q:/ # cat /proc/asound/card1/
    id pcm0c/
    root@sabreauto_6q:/ # cat /proc/asound/card2/
    id pcm0p/

    Note: Total 3 sound cards and 3 Audio(ALSA) out devices are present.

    Attempts to test audio out devices:

    1. Using tinyplay utility sound out verified.
      tinyplay test.wav -D 0 -d 0 --> Sound verified.
      Note : ALSA device 0 on Sound Card 0 is running to produce sound out.
    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