Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/keinos/dockerfile_of_speaker-test-for-machost
✅ Just plays a test sound of ALSA from the macOS host's speaker in Docker container. (Debian slim base image)
https://github.com/keinos/dockerfile_of_speaker-test-for-machost
alsa dockerfile macos sound
Last synced: 4 days ago
JSON representation
✅ Just plays a test sound of ALSA from the macOS host's speaker in Docker container. (Debian slim base image)
- Host: GitHub
- URL: https://github.com/keinos/dockerfile_of_speaker-test-for-machost
- Owner: KEINOS
- License: mit
- Created: 2019-07-28T02:35:28.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-16T02:08:05.000Z (almost 5 years ago)
- Last Synced: 2024-10-29T14:40:48.665Z (about 2 months ago)
- Topics: alsa, dockerfile, macos, sound
- Language: Shell
- Homepage: https://hub.docker.com/r/keinos/speaker-test
- Size: 13.7 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![](https://images.microbadger.com/badges/image/keinos/speaker-test.svg)](https://microbadger.com/images/keinos/speaker-test "View image details on microbadger.com")
[![](https://img.shields.io/docker/cloud/automated/keinos/speaker-test)](https://hub.docker.com/r/keinos/speaker-test "View on Docker Hub")
[![](https://img.shields.io/docker/cloud/build/keinos/speaker-test)](https://hub.docker.com/r/keinos/speaker-test/builds "View on Docker Hub")# Speaker-Test for macOS Host
This Docker image just plays the [ALSA](https://en.wikipedia.org/wiki/Advanced_Linux_Sound_Architecture)'s test sound in the container from the macOS host's speaker.
```bash
curl -L https://git.io/Jvihu -o run-test-local.sh && chmod +x "$_"
./run-test-local.sh
``````bash
docker pull keinos/speaker-test
```## Requirements
- `pulseaudio` must be installed on your macOS host. Using [Homebrew](https://brew.sh/) is the easiest way.
```shellsession
$ # Install pulseaudio
$ brew install pulseaudio
...
```## How to use
### The Easy Way
Download the shell script from https://git.io/Jvihu and run.
```shellsession
$ # Download the script
$ cd ~/
$ curl -L https://git.io/Jvihu -o run-test-local.sh && chmod +x "$_"
$ # Run the script
$ ./run-test-local.sh
```- **NOTE:**
- It might be asked for a permission to let PalseAudio access your host.
- https://git.io/Jvihu is an alias of https://KEINOS.github.io/Dockerfile_of_Speaker-Test-for-MacHost/run-test-local.sh### The Proper Way
1. Be sure that `pulseaudio` is running on host's (macOS') backgroud as a daemon.
```shellsession
$ # Run pulseaudio daemon
$ pulseaudio --load=module-native-protocol-tcp --exit-idle-time=-1 --daemon
...
```2. `pull` or `build` the image.
```shellsession
$ docker pull keinos/speaker-test
```Or clone the repo and build it locally. Try if your architecture is not x86_64 and get errors.
```shellsession
$ cd ~/
$ git clone https://github.com/KEINOS/Dockerfile_of_Speaker-Test-for-MacHost.git speaker-test
$ cd "$_"
$ docker build --no-cache -t keinos/speaker-test .
```3. Run the container.
```bash
docker run --rm -it -v ~/.config/pulse:/home/pulseaudio/.config/pulse keinos/speaker-test
```Be sure that `~/.config/pulse` directory exists in your host and contains files such like below:
```shellsession
$ ls ~/.config/pulse
YourMachineName.local-card-database.x86_64-apple-darwin18.0.0.simple
YourMachineName.local-default-sink
YourMachineName.local-default-source
YourMachineName.local-device-volumes.x86_64-apple-darwin18.0.0.simple
YourMachineName.local-runtime
YourMachineName.local-stream-volumes.x86_64-apple-darwin18.0.0.simple
```3. If you hear "Front, left. Front, right" then it works.
## TIPS
- How to check if the `pulseaudio` daemon is running.
```shellsession
$ # Results if the daemon is running
$ pulseaudio --check -v
W: [] caps.c: Normally all extra capabilities would be dropped now, but that's impossible because PulseAudio was built without capabilities support.
I: [] main.c: Daemon running as PID 18848$ # Results if the daemon is NOT running
$ pulseaudio --check -v
W: [] caps.c: Normally all extra capabilities would be dropped now, but that's impossible because PulseAudio was built without capabilities support.
I: [] main.c: Daemon not running
```## Tested Machines
- [List of env info that worked](https://github.com/KEINOS/Dockerfile_of_Speaker-Test-for-MacHost/issues/1)