QtWebEngine Quicknano has no Sound in Embedded Linux

回眸只為那壹抹淺笑 提交于 2019-12-10 20:54:11

问题


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.


回答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.



来源:https://stackoverflow.com/questions/35952615/qtwebengine-quicknano-has-no-sound-in-embedded-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!