Disable media capabilities

1,588 views
Skip to first unread message

xivan...@gmail.com

unread,
Mar 17, 2017, 2:24:49 AM3/17/17
to headless-dev
Hello,

is there a way to completely disable Chrome media capabilities?
E.g. html audio / video, flash(?) or something else.

Motivation:

1. Improve performance (probably, i.e. not waste time on this at all)
2. Get rid of related errors in logs like this:
20:20:31 chrome.1   | ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
20:20:31 chrome.1   | ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
20:20:31 chrome.1   | ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
20:20:31 chrome.1   | ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
20:20:31 chrome.1   | ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
20:20:31 chrome.1   | ALSA lib conf.c:4771:(snd_config_expand) Evaluate error: No such file or directory
20:20:31 chrome.1   | ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
20:20:31 chrome.1   | ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
20:20:31 chrome.1   | ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
20:20:31 chrome.1   | ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
20:20:31 chrome.1   | ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
20:20:31 chrome.1   | ALSA lib conf.c:4771:(snd_config_expand) Evaluate error: No such file or directory

or 

20:21:09 chrome.1   | [0316/202109.655851:ERROR:render_media_log.cc(30)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"FFmpegDemuxer: open context failed"}

Sami Kyostila

unread,
Mar 17, 2017, 2:54:39 PM3/17/17
to xivan...@gmail.com, headless-dev
If there's no available sound card in your system, the headless browser won't try to use one. Flash isn't supported, and as soon as we have animation and rendering control overhead from video should not be an issue.

- Sami

--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/99167a06-2715-4126-9daa-9e3de0d4c287%40chromium.org.

Ivan

unread,
Mar 18, 2017, 2:29:14 AM3/18/17
to headless-dev, xivan...@gmail.com
root@crawler-renderer-1108506230-81xt5:/# aplay -l
aplay: device_list:268: no soundcards found...

According to logs it seems that Chrome is trying to do something even if there is no playback sound device:
06:15:32 chrome.1   | [0318/061532.141181:ERROR:render_media_log.cc(30)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"Failed to reconcile encoded audio times with decoded output."}

06:16:48 chrome.1   | [0318/061648.828569:ERROR:render_media_log.cc(30)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"FFmpegDemuxer: open context failed"}

06:16:48 chrome.1   | [0318/061648.829453:ERROR:render_media_log.cc(30)] MediaEvent: PIPELINE_ERROR demuxer: could not open

06:19:44 chrome.1   | [0318/061944.642694:WARNING:HTMLMediaElement.cpp(1993)] currentPlaybackPosition readyState = 4 but no webMeidaPlayer to provide currentPlaybackPosition

08:02:04 chrome.1   | ALSA lib confmisc.c:768:(parse_card) cannot find card '0'

etc...


There is a batch of records with error severity related to audio playback and they are duplicated, i.e. Chrome doesn't tries to memorize the fact of absence of sound device, it just tries to do something over and over and yells.

From the perspective of headless browser user it looks like sound playback is not a case, so maybe headless team can consider opportunity of introducing setting (command line, devtools, whatever else) to disable it?

Sami Kyostila

unread,
Mar 20, 2017, 10:45:52 AM3/20/17
to Ivan, headless-dev
Here's some discussion we had with the audio team around this issue: https://codereview.chromium.org/2632733002/. It might be simplest just to uninstall the Alsa and PulseAudio libraries from your server.

- Sami

Ivan

unread,
Mar 20, 2017, 11:22:56 PM3/20/17
to headless-dev, xivan...@gmail.com
Hello Sami,

thank you for the link to CR, it was interesting morning reading.

After removing of all existing packages with wildcards *alsa* *pulseaudio* there is still errors in logs.
Also i have found explicit installation of libasound2 dependency in my dockerfile, on a new image without it chrome isn't starting:
/root/chrome-linux/chrome: error while loading shared libraries: libasound.so.2: cannot open shared object file: No such file or directory

In CR discussion tommi - chröme suggested to introduce --disable-audio flag, maybe it is more explicit, clean and safer way of disable audio functionality instead of attempts to remove shared libs from entire system.

PS: also i have observed new audio related warning in logs, not sure whether they are related to image changes
[0321/101015.039159:WARNING:audio_sync_reader.cc(173)] ASR: No room in socket buffer.
[0321/101015.055961:WARNING:audio_sync_reader.cc(188)] AudioSyncReader::Read timed out, audio glitch count=1

john.j....@gmail.com

unread,
May 22, 2017, 3:08:02 AM5/22/17
to headless-dev, xivan...@gmail.com
I'll second this feature request - I get this all over my logs too.

run...@gmail.com

unread,
May 22, 2018, 5:11:41 PM5/22/18
to headless-dev
Did anything ever happen with this? Our group here at LinkedIn is trying to run automated CI testing on RedHat instances with no audio support, and occasionally, though not always, we get messages to stderr indicating things like

pulse_util.cc(130) . Failed to connect to the context. Error: Connection refused

and then the test is failed. It looks like there was never anything done about --disable-audio. We do have the --mute-audio switch set in our testem chrome config settings.

Anybody have any ideas on further chrome settings we could use to "fix" this so we don't get these random failures? I've searched the net for a couple days and not yet found anything.

Thanks!
Dave
Reply all
Reply to author
Forward
0 new messages