jlesage / docker-firefox

Docker container for Firefox
MIT License
1.4k stars 266 forks source link

No sound in the container #234

Open kahduyi opened 3 months ago

kahduyi commented 3 months ago

Current Behavior

According to the document, I added the --device /dev/snd option to the docker run command. When I connect to the container with vnc client and open youtube in firefox browser and play a video, no sound is played.

Docker host is centos server version and I connect to container from laptop with vnc client.

Do you think I should do something else? Thank you in advance.

Environment

Container creation

docker run --name mozilla1 -d --rm -p 5953:5800 -p 15953:5900 -e KEEP_APP_RUNNING=1 -e GROUP_ID=3000 --shm-size 512m -v /etc/container/:/etc/firefox/policies:ro -v /var/run/container/50963632-925d-4b80-aaa8-595e3c3d3853:/config/runningInfo -v m_50963632-925d-4b80-aaa8-595e3c3d3853:/config/profile --device /dev/snd jlesage/firefox:latest

Container log

[init        ] container is starting...
[cont-env    ] loading container environment variables...
[cont-env    ] APP_NAME: loading...
[cont-env    ] APP_VERSION: loading...
[cont-env    ] DISPLAY: executing...
[cont-env    ] DISPLAY: terminated successfully.
[cont-env    ] DISPLAY: loading...
[cont-env    ] DOCKER_IMAGE_PLATFORM: loading...
[cont-env    ] DOCKER_IMAGE_VERSION: loading...
[cont-env    ] GTK2_RC_FILES: executing...
[cont-env    ] GTK2_RC_FILES: terminated successfully.
[cont-env    ] GTK2_RC_FILES: loading...
[cont-env    ] GTK_THEME: executing...
[cont-env    ] GTK_THEME: terminated successfully.
[cont-env    ] GTK_THEME: loading...
[cont-env    ] HOME: loading...
[cont-env    ] QT_STYLE_OVERRIDE: executing...
[cont-env    ] QT_STYLE_OVERRIDE: terminated successfully.
[cont-env    ] QT_STYLE_OVERRIDE: loading...
[cont-env    ] TAKE_CONFIG_OWNERSHIP: loading...
[cont-env    ] XDG_CACHE_HOME: loading...
[cont-env    ] XDG_CONFIG_HOME: loading...
[cont-env    ] XDG_DATA_HOME: loading...
[cont-env    ] XDG_RUNTIME_DIR: loading...
[cont-env    ] XDG_STATE_HOME: loading...
[cont-env    ] container environment variables initialized.
[cont-secrets] loading container secrets...
[cont-secrets] container secrets loaded.
[cont-init   ] executing container initialization scripts...
[cont-init   ] 10-certs.sh: executing...
[cont-init   ] 10-certs.sh: terminated successfully.
[cont-init   ] 10-check-app-niceness.sh: executing...
[cont-init   ] 10-check-app-niceness.sh: terminated successfully.
[cont-init   ] 10-clean-logmonitor-states.sh: executing...
[cont-init   ] 10-clean-logmonitor-states.sh: terminated successfully.
[cont-init   ] 10-clean-tmp-dir.sh: executing...
[cont-init   ] 10-clean-tmp-dir.sh: terminated successfully.
[cont-init   ] 10-fontconfig-cache-dir.sh: executing...
[cont-init   ] 10-fontconfig-cache-dir.sh: terminated successfully.
[cont-init   ] 10-init-users.sh: executing...
[cont-init   ] 10-init-users.sh: terminated successfully.
[cont-init   ] 10-nginx.sh: executing...
[cont-init   ] 10-nginx.sh: terminated successfully.
[cont-init   ] 10-openbox.sh: executing...
[cont-init   ] 10-openbox.sh: terminated successfully.
[cont-init   ] 10-pkgs-mirror.sh: executing...
[cont-init   ] 10-pkgs-mirror.sh: terminated successfully.
[cont-init   ] 10-set-tmp-dir-perms.sh: executing...
[cont-init   ] 10-set-tmp-dir-perms.sh: terminated successfully.
[cont-init   ] 10-vnc-password.sh: executing...
[cont-init   ] 10-vnc-password.sh: terminated successfully.
[cont-init   ] 10-web-data.sh: executing...
[cont-init   ] 10-web-data.sh: terminated successfully.
[cont-init   ] 10-x11-unix.sh: executing...
[cont-init   ] 10-x11-unix.sh: terminated successfully.
[cont-init   ] 10-xdg-runtime-dir.sh: executing...
[cont-init   ] 10-xdg-runtime-dir.sh: terminated successfully.
[cont-init   ] 15-cjk-font.sh: executing...
[cont-init   ] 15-cjk-font.sh: terminated successfully.
[cont-init   ] 15-install-pkgs.sh: executing...
[cont-init   ] 15-install-pkgs.sh: terminated successfully.
[cont-init   ] 55-check-snd.sh: executing...
[cont-init   ] 55-check-snd.sh: sound device group 63.
[cont-init   ] 55-check-snd.sh: terminated successfully.
[cont-init   ] 55-firefox.sh: executing...
[cont-init   ] 55-firefox.sh: generating machine-id...
[cont-init   ] 55-firefox.sh: terminated successfully.
[cont-init   ] 56-firefox-set-prefs-from-env.sh: executing...
[cont-init   ] 56-firefox-set-prefs-from-env.sh: terminated successfully.
[cont-init   ] 85-take-config-ownership.sh: executing...
[cont-init   ] 85-take-config-ownership.sh: terminated successfully.
[cont-init   ] 89-info.sh: executing...
    ╭――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――╮
    │                                                                      │
    │ Application:           Firefox                                       │
    │ Application Version:   120.0.1-r0                                    │
    │ Docker Image Version:  24.01.1                                       │
    │ Docker Image Platform: linux/amd64                                   │
    │                                                                      │
    ╰――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――╯
[cont-init   ] 89-info.sh: terminated successfully.
[cont-init   ] all container initialization scripts executed.
[init        ] giving control to process supervisor.
[supervisor  ] loading services...
[supervisor  ] loading service 'default'...
[supervisor  ] loading service 'app'...
[supervisor  ] loading service 'gui'...
[supervisor  ] loading service 'certsmonitor'...
[supervisor  ] service 'certsmonitor' is disabled.
[supervisor  ] loading service 'nginx'...
[supervisor  ] loading service 'xvnc'...
[supervisor  ] loading service 'openbox'...
[supervisor  ] loading service 'logmonitor'...
[supervisor  ] service 'logmonitor' is disabled.
[supervisor  ] loading service 'logrotate'...
[supervisor  ] all services loaded.
[supervisor  ] starting services...
[supervisor  ] starting service 'xvnc'...
[xvnc        ] Xvnc TigerVNC 1.13.1 - built Dec 21 2023 00:53:33
[xvnc        ] Copyright (C) 1999-2022 TigerVNC Team and many others (see README.rst)
[xvnc        ] See https://www.tigervnc.org for information on TigerVNC.
[xvnc        ] Underlying X server release 12014000
[xvnc        ] Thu Apr  4 09:50:18 2024
[xvnc        ]  vncext:      VNC extension running!
[xvnc        ]  vncext:      Listening for VNC connections on /tmp/vnc.sock (mode 0660)
[xvnc        ]  vncext:      Listening for VNC connections on all interface(s), port 5900
[xvnc        ]  vncext:      created VNC server for screen 0
[supervisor  ] starting service 'nginx'...
[nginx       ] Listening for HTTP connections on port 5800.
[supervisor  ] starting service 'openbox'...
[supervisor  ] starting service 'app'...
[app         ] Mozilla Firefox 120.0.1
[supervisor  ] all services started.
[xvnc        ] Thu Apr  4 09:50:34 2024
[xvnc        ]  Connections: accepted: 172.16.60.150::49362
[xvnc        ]  SConnection: Client needs protocol version 3.8
[xvnc        ]  SConnection: Client requests security type None(1)
[xvnc        ]  VNCSConnST:  Server default pixel format depth 24 (32bpp) little-endian rgb888
[xvnc        ]  VNCSConnST:  Client pixel format depth 6 (8bpp) rgb222
[xvnc        ] Thu Apr  4 09:50:43 2024
[xvnc        ]  VNCSConnST:  Client pixel format depth 24 (32bpp) little-endian rgb888
[xvnc        ] Thu Apr  4 09:56:31 2024
[xvnc        ]  VNCSConnST:  closing 172.16.60.150::49362: Clean disconnection
[xvnc        ]  EncodeManager: Framebuffer updates: 6766
[xvnc        ]  EncodeManager:   RRE:
[xvnc        ]  EncodeManager:     Solid: 5.607 krects, 8.25047 Mpixels
[xvnc        ]  EncodeManager:            109.412 KiB (1:257.986 ratio)
[xvnc        ]  EncodeManager:   Hextile:
[xvnc        ]  EncodeManager:     Bitmap RLE: 11.28 krects, 3.32385 Mpixels
[xvnc        ]  EncodeManager:                 358.503 KiB (1:36.5854 ratio)
[xvnc        ]  EncodeManager:     Indexed RLE: 95.096 krects, 122.821 Mpixels
[xvnc        ]  EncodeManager:                  42.3318 MiB (1:11.0936 ratio)
[xvnc        ]  EncodeManager:     Full Colour: 363.798 krects, 4.82562 Gpixels
[xvnc        ]  EncodeManager:                  8.66781 GiB (1:2.07445 ratio)
[xvnc        ]  EncodeManager:   ZRLE:
[xvnc        ]  EncodeManager:     Bitmap RLE: 218 rects, 1.99364 Mpixels
[xvnc        ]  EncodeManager:                 9.46191 KiB (1:782.841 ratio)
[xvnc        ]  EncodeManager:     Indexed RLE: 302 rects, 3.22833 Mpixels
[xvnc        ]  EncodeManager:                  80.4385 KiB (1:75.721 ratio)
[xvnc        ]  EncodeManager:     Full Colour: 355 rects, 3.99155 Mpixels
[xvnc        ]  EncodeManager:                  1.76151 MiB (1:8.64609 ratio)
[xvnc        ]  EncodeManager:   Total: 476.656 krects, 4.96923 Gpixels
[xvnc        ]  EncodeManager:          8.71141 GiB (1:2.12442 ratio)
[xvnc        ]  Connections: closed: 172.16.60.150::49362
[xvnc        ]  ComparingUpdateTracker: 7.87779 Gpixels in / 5.66053 Gpixels out
[xvnc        ]  ComparingUpdateTracker: (1:1.39171 ratio)
m1kesk commented 3 months ago

have same issue, here is my docker-compose.yml

services:
  firefox:
    image: jlesage/firefox:v24.01.1
    ports:
      - 5800:5800
    volumes:
      - /var/lib/firefox:/config:rw
      - /dev/snd:/dev/snd
    devices:
      - /dev/snd:/dev/snd
jlesage commented 3 months ago

Just to clarify, the sound should be playing on the host itself, not through the browser/VNC client used to access the container.

Support for sound through the browser accessing the container should be available soon.

pesian commented 2 months ago

Just to clarify, the sound should be playing on the host itself, not through the browser/VNC client used to access the container.

Support for sound through the browser accessing the container should be available soon.

this is very nice ,have any update to upload and download direct without use docker volume ?

srcrs commented 2 weeks ago

Just to clarify, the sound should be playing on the host itself, not through the browser/VNC client used to access the container.需要澄清的是,声音应该在主机本身上播放,而不是通过用于访问容器的浏览器/VNC 客户端播放。

Support for sound through the browser accessing the container should be available soon.通过浏览器访问容器的声音支持应该很快就会推出。

Hi, when can I get support?