mirror of
https://github.com/woodchen-ink/docker-firefox.git
synced 2025-07-18 05:42:00 +08:00
Added support for sound.
This commit is contained in:
parent
ef916e2aa5
commit
c2965f4750
@ -37,6 +37,7 @@ Mozilla Firefox is a free and open-source web browser developed by Mozilla Found
|
||||
* [Routing Based on Hostname](#routing-based-on-hostname)
|
||||
* [Routing Based on URL Path](#routing-based-on-url-path)
|
||||
* [Increasing Shared Memory Size](#increasing-shared-memory-size)
|
||||
* [Sound Support](#sound-support)
|
||||
* [Troubleshooting](#troubleshooting)
|
||||
* [Crashes](#crashes)
|
||||
* [Support or Contact](#support-or-contact)
|
||||
@ -434,6 +435,12 @@ size of `/dev/shm` can be done via two method:
|
||||
- By using shared memory of the host, by mapping `/dev/shm` via the parameter
|
||||
`-v /dev/shm:/dev/shm` of the `docker run` command.
|
||||
|
||||
## Sound Support
|
||||
|
||||
For Firefox to be able to use the audio device available on
|
||||
the host, `/dev/snd` must be exposed to the container by adding the
|
||||
`--device /dev/snd` parameter to the `docker run` command.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Crashes
|
||||
|
16
appdefs.xml
16
appdefs.xml
@ -41,6 +41,14 @@ size of `/dev/shm` can be done via two method:
|
||||
`-v /dev/shm:/dev/shm` of the `docker run` command.
|
||||
</content>
|
||||
</section>
|
||||
<section>
|
||||
<title level="2">Sound Support</title>
|
||||
<content>
|
||||
For {{ defs.app.friendly_name }} to be able to use the audio device available on
|
||||
the host, `/dev/snd` must be exposed to the container by adding the
|
||||
`--device /dev/snd` parameter to the `docker run` command.
|
||||
</content>
|
||||
</section>
|
||||
<section>
|
||||
<title level="2">Troubleshooting</title>
|
||||
<content/>
|
||||
@ -100,7 +108,13 @@ details.
|
||||
<!-- Network ports -->
|
||||
<ports/>
|
||||
<!-- Devices -->
|
||||
<devices/>
|
||||
<devices>
|
||||
<device>
|
||||
<path>/dev/snd</path>
|
||||
<description>Optional Linux device to expose to have sound.</description>
|
||||
<include_in_quick_start>false</include_in_quick_start>
|
||||
</device>
|
||||
</devices>
|
||||
<!-- Extra parameters -->
|
||||
<extra_params>
|
||||
<extra_param>
|
||||
|
25
rootfs/etc/cont-init.d/check-snd.sh
Executable file
25
rootfs/etc/cont-init.d/check-snd.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/with-contenv sh
|
||||
|
||||
set -e # Exit immediately if a command exits with a non-zero status.
|
||||
set -u # Treat unset variables as an error.
|
||||
|
||||
log() {
|
||||
echo "[cont-init.d] $(basename $0): $*"
|
||||
}
|
||||
|
||||
SND_DEV="/dev/snd"
|
||||
|
||||
if [ ! -d "$SND_DEV" ]; then
|
||||
log "sound not supported: device $SND_DEV not exposed to the container."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Save the associated group.
|
||||
SND_GRP="$(find "$SND_DEV" -maxdepth 1 -not -type d -exec stat -c "%g" {} \; | sort -u | tail -n1)"
|
||||
log "sound device group $SND_GRP."
|
||||
if [ -f /var/run/s6/container_environment/SUP_GROUP_IDS ]; then
|
||||
echo -n "," >> /var/run/s6/container_environment/SUP_GROUP_IDS
|
||||
fi
|
||||
echo -n "$SND_GRP" >> /var/run/s6/container_environment/SUP_GROUP_IDS
|
||||
|
||||
# vim: set ft=sh :
|
Loading…
x
Reference in New Issue
Block a user