Skip to content

✅ Just plays a test sound of ALSA from the macOS host's speaker in Docker container. (Debian slim base image)

License

Notifications You must be signed in to change notification settings

KEINOS/Dockerfile_of_Speaker-Test-for-MacHost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Speaker-Test for macOS Host

This Docker image just plays the ALSA's test sound in the container from the macOS host's speaker.

curl -L https://git.io/Jvihu -o run-test-local.sh && chmod +x "$_"
./run-test-local.sh
docker pull keinos/speaker-test

Requirements

  • pulseaudio must be installed on your macOS host. Using Homebrew is the easiest way.

    $ # Install pulseaudio
    $ brew install pulseaudio
    ...

How to use

The Easy Way

Download the shell script from https://git.io/Jvihu and run.

$ # Download the script
$ cd ~/
$ curl -L https://git.io/Jvihu -o run-test-local.sh && chmod +x "$_"
$ # Run the script
$ ./run-test-local.sh

The Proper Way

  1. Be sure that pulseaudio is running on host's (macOS') backgroud as a daemon.

    $ # Run pulseaudio daemon
    $ pulseaudio --load=module-native-protocol-tcp --exit-idle-time=-1 --daemon
    ...
  2. pull or build the image.

    $ docker pull keinos/speaker-test

    Or clone the repo and build it locally. Try if your architecture is not x86_64 and get errors.

    $ 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.

    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:

    $ 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
  4. If you hear "Front, left. Front, right" then it works.

TIPS

  • How to check if the pulseaudio daemon is running.

    $ # 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

About

✅ Just plays a test sound of ALSA from the macOS host's speaker in Docker container. (Debian slim base image)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published