GithubHelp home page GithubHelp logo

idoleat / mikey Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 8 KB

A loopback device that receives audio playback and outputs it to other applications as if it were a microphone

Makefile 2.43% C 97.57%

mikey's Introduction

🎙️Mikey, an audio loopback, virtual linux soundcard driver.

Warning

This is a work-in-progress project.

Inspired by v4l2loopback, Mikey functions as a loopback device that is capable of receiving audio playback and outputting it to other applications as if it were a microphone. It can be used to test userspace audio programs as well, which is a common use of virtual drivers.

In-tree kernel module snd_aloop has richer functionality, but I think I can do it in a simpler way so that anyone can grab the code and modify it. Mikey is a work-in-progress project that takes some references from in-tree snd_pcmtest module and vsnd. Currently a playback device and a capture device can be listed from aplay -l and arecord -l after inserting the module.

Testing

This kernel module is not battle-tested yet so I recommend using a virtual environment like vritme-ng to test it until it is reliable enough. If snd_pcm module has not been loaded, use modprobe snd_pcm to load it first. Test Mikey with aplay -D plughw:CARD=mikey,DEV=0 /path/to/audio/file.

ToDo

  • Use timer interrupt to simulate hardware interrupt for updating substream buffer (Currently it would hang the kernel)
  • Loopback pcm data
  • Make capture and playback device share the same buffer (SPSC queue) to reduce data copying
  • Accept control options through ioctl

Writing an ALSA soundcard driver

Since there is a lack of materials on this topic on the internet, here is my note on writing Mikey. Notice that it may not be as complete as a document like the one in kernel, but it should be more beginner friendly.

(To be continued...)

mikey's People

Contributors

idoleat avatar

Watchers

Lucian avatar  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.