提问人:po.studio 提问时间:8/18/2019 最后编辑:po.studio 更新时间:8/28/2019 访问量:1527
jackd 无法在 docker 容器中使用实时调度
jackd cannot use real-time scheduling within docker container
问:
我一辈子都无法弄清楚如何让 jackd 在 docker 容器中以实时优先级运行。我的目标是在 jackd/gstreamer 的帮助下使用 webrtc 在互联网上获得 SuperCollider 音频流,我相信我需要为 jackd 启用实时调度才能让 SuperCollider 使用它(这可能是一条红鲱鱼,也许 SuperCollider 不需要实时 jackd,但我仍然想尝试这条路)。
我在主机(运行 macOS 10.13.6 的 2014 款 MacBook Air)上没有成功,但我也尝试在运行 64 位 Amazon Linux/2.12.16 的 AWS Docker beanstalk 应用程序上构建映像并运行容器。
下面是指向带有 dockerfile 和一些包含更多详细信息/错误日志的 README 注释的存储库的链接:https://github.com/osetinsky/pulse-streamer/tree/supercollider-example/examples/supercollider
我花了几个小时阅读人们遇到的类似问题,尝试以下几点:
- 设置和在各种 limits.conf 文件中设置在具有相应用户组的各种目录中:http://jackaudio.org/faq/linux_rt_config.html
rtprio
memlock
- 更新了此处建议的所有三种方法的 cgconfig 和 cgrules:https://github.com/jackaudio/jackaudio.github.com/wiki/Cgroups
- 使用 Realtime Scheduler 选项运行 Docker:https://docs.docker.com/config/containers/resource_constraints/#configure-the-realtime-scheduler(使用 --cap-add=sys_nice --cpu-rt-runtime=950000 --ulimit rtprio=99 运行)
最后一种方法似乎很有前途,但当我运行时失败了:
docker run --privileged --ulimit rtprio=99 --ulimit memlock=800000000 --cpu-rt-runtime=950000 --volume=/dev/shm:/dev/shm:rw --user=1000 -it jack-sc bash
docker: Error response from daemon: OCI runtime create failed:
container_linux.go:345: starting container process caused
"process_linux.go:281: applying cgroup configuration for process caused
\"failed to write 950000 to cpu.rt_runtime_us: write /sys/fs/cgroup/cpu/docker/1bc42e297356c9ad6f734726590c7f42450fcae44e0020950
68b8f10bc93d4f3/cpu.rt_runtime_us: invalid argument\"": unknown.
作为记录,我能够使用 Pion(webrtc 的 go 实现)使用 pulseaudio 和 gstreamer 实时流式传输测试音:https://github.com/osetinsky/pulse-streamer
我只想用 SuperCollider 的实时音频替换测试音:)
此处提到的类似问题:
https://github.com/moby/moby/issues/31411
https://bugzilla.redhat.com/show_bug.cgi?id=1178246
(还有很多......
谢谢!
答: 暂无答案
评论