Giter Club home page Giter Club logo

vpcm's Introduction

vpcm

vpcm is a kernel extension similar to SoundFlower (https://github.com/mattingalls/Soundflower). Unlike SoundFlower, it does not only create virtual sound devices in your computer's GUI, but also entries for virtual devices in your computer's /dev filesystem.

This is is useful in conjunction with existing sound tools from Linux available through Homebrew or MacPorts, or to send audio data over the network using a streaming tool like netcat.

Once vpcm has been installed, a new device entry /dev/vpcmctl exists in the /dev filesystem. Using the echo command, it is possible to send commands to the vpcm controller in order to create or delete virtual sound devices. Reading from /dev/vpcmctl will provide you with an overview of existing vpcm devices. Sending the create command will create a new vpcm:

$ echo create --rate=48000 --buffer-frames=1024 MyDevice >/dev/vpcmctl
$ cat /dev/vpcmctl
vpcm Virtual Audio Device, built Mar 27 2020 22:54:55
Number of device pairs: 1
"MyDevice" -> /dev/vpcm1
  CoreAudio clients: 0
  Device node state: closed
  Configuration:
	--playback
	--rate=48000
	--channels=2
	--buffer-frames=1024
	--latency-msec=0
	--format=float32le
	--overflow=zeros

In your computer's GUI, a new entry "MyDevice" will appear under audio devices. Choosing that for output, audio data will now be available to read from /dev/vpcm1. This will be raw data in the format described by the device options, and may be piped into a command line tool or written to disk:

$ cat /dev/vpcm1 > myaudio.raw

The following options are available when creating a device:

  • --playback or --record to choose the direction into which the device operates.
  • --rate=<sampling rate> to choose the sampling rate.
  • --channels=<number of channels> for the number of playback or recording channels.
  • --buffer-frames=<frames> for the device's internal buffer size in terms of audio frames.
  • --latency-msec=<latency> for the device's nominal latency (used by the system when synchronizing audio and video).
  • --format=<float32|s16> to choose the number format used.
  • --overflow=<zeros|noise|discard> to specify what happens when the device is running out of data.
  • --[no-]eof-on-idle determines whether a pipe or output file is closed as soon as the audio engine side of the device is idle.
  • --raw to omit volume scaling and clipping operations on sample data.
  • --posix-pipe will report EPIPE (broken pipe) to I/O requests if there is no active client on the GUI side. Some command line tools require this to work if data is piped to or from a vpcm device.

Besides the create command, a few other commands are available:

  • delete <GUI name> deletes a device with given GUI name.
  • name <GUI name> provides the device path of the device with the given GUI name on the next read from the vpcmctl device.
  • describe <GUI name> provides the GUI device name, with all options, of the named device. Output will be available on the next read from the vpcmctl device.

Build

  • Open the XCode project at Source/vpcm.xcodeproj/
  • Choose Product->Build For->Running from the XCode menu
  • The kext will be located at Build/InstallerRoot/Library/Extensions/vpcm.kext

Install

To install, copy the kext to /Library/Extensions (not /System/Library/Extensions). Reboot the machine for the installation to take effect.

vpcm's People

Contributors

simulpiscator avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.