'Chrome on Linux: can't play <audio> and WebRTC audio at the same time
With Chrome under Linux we can't use both WebRTC audio (video call) and the <audio> tag in a single web page, meaning that only one of the two works at a time:
During a single browser session, when a
<audio>tag is played (which can be heared), a WebRTC video call (ie. MediaStream) doesn't play any sound (microphone and video works, though).Likewise, when the WebRTC video call is started first, it works perfectly (audio playback is okay) but then no
<audio>tag works anymore.
Obviously there seems to be some sort of conflict, although the problem is not related to WebRTC video call and <audio> running at the same time - it also happens when one starts after the other having been stopped already.
Under Windows the same web application works without any problems, happily playing both sound sources, meaning that is related to Chrome under Linux.
Is this a known limitation of Chrome under Linux? Is there any workaround?
technical details
- Chrome 48 32bit
- Debian Jessie Linux 32bit
- Intel Celeron J1900 with 4GB ram (a thin client)
- ALSA 1.0.28 playback with playback over HDMI
- Video calling implemented using SimpleWebRTC.
aplay -l output:
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
Subdevices: 0/1
Subdevice #0: subdevice #0
Code that starts <audio> playback:
addAudio(audio) {
this.ringAudio = new Audio();
this.ringSource = document.createElement("source");
this.ringSource.type = "audio/mpeg";
this.ringSource.src = audio;
this.ringAudio.appendChild(this.ringSource);
this.ringAudio.play();
}
Solution 1:[1]
I've been struggling with this issue for long time. Aks many people in linux commmunity and try many code in my Terminal. Until I got this trick.
It's seem simple, but works for me. No need write: sudo...
Just open Terminal and write:
alxamixer
It's not about your browser, just need a bit configuration in system.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | ahm |
