4

I have compiled QtWebEngine into my i.MX6 embedded device. When I tried to play youtube Video with quicknanobrowser, the video plays but there would be no sound. In fact, there is no sound when I try to test play the audio files in hpr.dogphilosophy.net/test even though the website said that the browser codec is supported.

I have enabled pulseaudio, gstreamer, ffmpeg, opus, vpx, libwebp and yet still no sound.

However, I could play video with gst-launch and there would be sound.

Is it something wrong with quicknanobrowser that does not enable sound? Or is there components that I need to add to the embedded system?

Edit: Alsa and pulseaudio, GStreamer are all working fine with sound.

Community
  • 1
  • 1
Charles C.
  • 3,725
  • 4
  • 28
  • 50
  • Firstly play test sound via `aplay test.wav` command also test the `amixer`. If both are working then for your device `ALSA` is working and can think of further options. – suneet saini Mar 16 '16 at 06:40
  • I have tested Alsa before installing QtWebEngine. Alsa works via aplay and amixer. What are the further options? – Charles C. Mar 16 '16 at 16:42
  • I'm also using quicknanobrowser but I the app is crashing when trying to play the youtube videos. Can you please tell me how to launch the quicknanobrowser; I mean the options with which you're able to play the youtube videos? – surendra nath Sep 22 '17 at 09:09
  • @surendranath Please create a new question :) – Charles C. Sep 22 '17 at 16:15

1 Answers1

1

You need to force QtWebEngine to use ALSA. In embedded systems, it is disabled by default.

In qt5.7/qtwebengine/src/3rdparty/chromium/media/media.gyp, there is a test to check if we are on an embedded system:

  # Enable ALSA and Pulse for runtime selection.
  ['(OS=="linux" or OS=="freebsd" or OS=="solaris") and ((embedded!=1 and chromecast==0) or is_cast_desktop_build==1)', {
    # ALSA is always needed for Web MIDI even if the cras is enabled.
    'use_alsa%': 1,
    'conditions': [
      ['use_cras==1', {
        'use_pulseaudio%': 0,
      }, {
        'use_pulseaudio%': 1,
      }],
    ],
  }, {
    'use_alsa%': 0,
    'use_pulseaudio%': 0,
  }],

I changed last use_alsa% to 1 and in qt5.7/qtwebengine/src/core/config/embedded_linux.pri, I added a new flag:

use_alsa=1

With this settings I have audio on my embedded ARM Linux and with flag:

enable_webrtc=1

I am able to start a WebRTC session with video and audio.

Toby Speight
  • 27,591
  • 48
  • 66
  • 103