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. Phonon: only one output device
Forum Updated to NodeBB v4.3 + New Features

Phonon: only one output device

Scheduled Pinned Locked Moved General and Desktop
15 Posts 2 Posters 3.5k 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.
  • S Offline
    S Offline
    skoczo
    wrote on last edited by
    #1

    Hi,
    I have usb sound cards and i want to play music on this cards. Unfortunetly phonon don't see my card.

    When i'm waiting on notify signal:
    @connect(Phonon::BackendCapabilities::notifier(), SIGNAL(availableAudioOutputDevicesChanged()), this, SLOT(devicesChanged()));@
    I got only 1 device.

    In console i can see two cards: pactl list
    @Card #1
    Name: alsa_card.pci-0000_00_1b.0
    Driver: module-alsa-card.c
    Owner Module: 26
    Properties:
    alsa.card = "0"
    alsa.card_name = "HDA Intel PCH"
    alsa.long_card_name = "HDA Intel PCH at 0xd3610000 irq 46"
    alsa.driver_name = "snd_hda_intel"
    device.bus_path = "pci-0000:00:1b.0"
    sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
    ......

    Card #2
    Name: alsa_card.usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00-Device
    Driver: module-alsa-card.c
    Owner Module: 29
    Properties:
    alsa.card = "1"
    alsa.card_name = "USB PnP Sound Device"
    alsa.long_card_name = "C-Media Electronics Inc. USB PnP Sound Device at usb-0000:00:14.0-2.2, full spe"
    alsa.driver_name = "snd_usb_audio"
    device.bus_path = "pci-0000:00:14.0-usb-0:2.2:1.0"
    sysfs.path = "/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.2/1-2.2:1.0/sound/card1"
    .....
    @

    Can you help?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      What Distribution/Desktop environment are you running ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        skoczo
        wrote on last edited by
        #3

        Arch linux, XFCE with pulseaudio.

        When i call "QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)" i got 3 devices. This is ok but how to connect this with phonon?

        Any ideas?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          skoczo
          wrote on last edited by
          #4

          How to use multiple sound cards to play mp3 or internet radio in QT? Can anyone help?

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            IIRC, using phonon, you'll use what the backend is setup to use e.g. pulseaudio.

            If you want to play with several outputs at the same time, you should rather look at QtMultimedia

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • S Offline
              S Offline
              skoczo
              wrote on last edited by
              #6

              Do you have some examples how to do that? I know how to play (raw formats)wave but how to play mp3 or internet radio using QtMultimedia?

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                QMediaPlayer comes to mind

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  skoczo
                  wrote on last edited by
                  #8

                  In QMediaPlayer i can't found way to set output device.
                  Do you know how to set it? I even looked at the code but i don't know how it works :/

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    AFAIK, you can't just simply set it. You have to get a QAudioEndpointSelector from QMediaPlayer. However it might not be implement in all backends

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      skoczo
                      wrote on last edited by
                      #10

                      I have Qt 5.3.1 and can't find QAudioEndpointSelector class.
                      About what version Qt you are talking about? Do you have an example?

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        Sorry, my bad it's a class from QtMobility, it's QAudioOutputSelectorControl that I was thinking about

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          skoczo
                          wrote on last edited by
                          #12

                          What the qt-mobility is? It sounds like lib for mobile devices. Can i use it in desktop app?

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

                            It was for the Qt 4 series, some of the classes have been integrated in Qt 5 others might need porting.

                            Yes you can,

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            0
                            • S Offline
                              S Offline
                              skoczo
                              wrote on last edited by
                              #14

                              I don't know how to do that.
                              Maybe you know some other C++ library than qt where can i play music on multiple sound cards? I use it on linux and want play music from internet radio.

                              1 Reply Last reply
                              0
                              • SGaistS Offline
                                SGaistS Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on last edited by
                                #15

                                You can have a look at GStreamer and QGStreamer

                                Interested in AI ? www.idiap.ch
                                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                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