aerokube / images

Browser images for Selenoid and Moon 1.x
https://aerokube.com/images/latest/
Apache License 2.0
168 stars 126 forks source link

Audio playback doesn't work in selenoid/firefox:85+ because of "OpenCubeb() failed to init cubeb" #468

Open bardadymovd opened 2 years ago

bardadymovd commented 2 years ago

Hello. We have audio playback as part of one of our test suites. Audio playback works fine in real browsers(chrome and firefox), it also works fine in selenoid/chrome container. Previously we used selenoid/firefox:83.0 and audio worked fine too. Recently we switched to latest selenoid.firefox:93.0 and our test started to fail because audio playback fails. Log of selenoid/firefox container has "OpenCubeb() failed to init cubeb" error

I've compared older versions, and found what playback was broken in selenoid/firefox:85.0 It may be related with migratin to ubuntu20.04 as base for selenoid/firefox:85+

please use attached sample project for observe issue, you will need Java for lauch it audio playback issue.zip

Steps: 1) Run selenoid/firefox image localy, as following

docker run -it --network host --rm --privileged -p 4444:4444 selenoid/firefox:83.0 2) Run tests from attached project as ./gradlew clean test 3) Examine console output of selenide/firefox container and screenshot from test (saved to build/reports/tests)

As you can see from screenshots playback was started in selenoid/firefox:83.0 and selenoid/firefox:84.0, but was not started in selenoid/firefox:85.0

Log for selenoid/firefox:83.0 has no any error, playback is working here container log 83.txt duringPlayback_83

Log for selenoid/firefox:84.0 has E: [pulseaudio] client-conf-x11.c: xcb_connection_has_error() returned true but playback is working here, not sure if this error is important container log 84.txt duringPlayback_84

Log for selenoid/firefox:85.0 has following errors

[Child 238, MediaDecoderStateMachine #1] WARNING: 7f9264bf3900 OpenCubeb() failed to init cubeb: file /build/firefox-iQ8SFg/firefox-85.0.1+build1/dom/media/AudioStream.cpp:334
[Child 238, MediaDecoderStateMachine #1] WARNING: Decoder=7f926da16400 [OnMediaSinkAudioError]: file /build/firefox-iQ8SFg/firefox-85.0.1+build1/dom/media/MediaDecoderStateMachine.cpp:3886
[Child 238, MediaDecoderStateMachine #1] WARNING: Decoder=7f926da16400 Decode error: NS_ERROR_DOM_MEDIA_MEDIASINK_ERR (0x806e000b) - OnMediaSinkAudioError: file /build/firefox-iQ8SFg/firefox-85.0.1+build1/dom/media/MediaDecoderStateMachine.cpp:3465

audio playback doesn't work here (see screenshot, seeker is still in the start of progress bar) container log 85.txt duringPlayback_85

Can you please suggest something. Thanks in advance.

vania-pooh commented 2 years ago

@bardadymovd probably a missing codec package. What kind of codec are you using?

bardadymovd commented 2 years ago

@vania-pooh we use mp3 and wav formats. answer for media request has 'Content-Type: audio/mpeg' header internal logs from player, not sure it it helps

/usr/bin/ffmpeg -loglevel 48 -i http://segment-service-svc:8081/media/16808535192.168.10.33:24620192.168.10.42:24740_102022/AUDIO -f lavfi -t 134.114 -i anullsrc=sample_rate=16000 -n -filter_complex [0:a]pan=2c|c0=c0|c1=0.5*c0[L0],[L0][1:a]concat=n=2:a=1:v=0[L];[0:a]pan=2c|c0=0.5*c1|c1=c1[R0],[R0][1:a]concat=n=2:a=1:v=0[R] -fflags bitexact -xerror -f s16le -ac 2 -ar 1000 -map 0:a /tmp/interaction-player-cache/13248581660753442795/pcm.s16le -f mp3 -t 134.114 -ac 2 -ar 16000 -map [L] /tmp/interaction-player-cache/13248581660753442795/left.mp3 -f mp3 -t 134.114 -ac 2 -ar 16000 -map [R] /tmp/interaction-player-cache/13248581660753442795/right.mp3

Media used in sample test is also mp3 with "Content-Type: audio/mpeg" https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3