Git Product home page Git Product logo

audiomirror's Introduction

This driver isn't finished and has a few quirks. If you want a build and ship ready solution this is sadly not what you were looking for.

You've been warned.

An audio driver for Windows 10 (only tested on x64) that works as a virtual audio cable. Adds a virtual speaker that routes all played audio into a virtual microphone device.

As for documentation ... there's not much out there, at least I couldn't find it.

  1. it's derived from the sysvad sample drivers with quite a bit of refactoring
  2. as for actual documentation that's not examples - the only good source seemed to be the Microsoft Docs which are actually really good with explaining the most important concepts

For development I mostly used a virtual machine to see if the driver worked or crashed and to debug the code. Here's the basic installation process I used to install the driver during development (basically just devcon): alt text

audiomirror's People

Contributors

jannesp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

audiomirror's Issues

While building release version getting the following linker issues

Build started...
1>------ Build started: Project: AudioMirror, Configuration: Release x64 ------
1>Building 'AudioMirror' with toolset 'WindowsKernelModeDriver10.0' and the 'Universal' target platform.
1>Stamping x64\Release\AudioMirror.inf
1>Stamping [Version] section with DriverVer=05/06/2021,5.33.21.519
1>C:\audiomirror\AudioMirror\AudioMirror\AudioMirror.inf(5-5): warning 1324: [Version] section should specify PnpLockdown=1.
1>AdapterCommon.obj : error LNK2019: unresolved external symbol __imp_PcGetPhysicalDeviceObject referenced in function "public: virtual long __cdecl AdapterCommon::Init(struct _IRP *,struct _DEVICE_OBJECT *)" (?Init@AdapterCommon@@UEAAJPEAU_IRP@@PEAU_DEVICE_OBJECT@@@z)
1>AdapterCommon.obj : error LNK2019: unresolved external symbol "public: __cdecl CUnknown::CUnknown(struct IUnknown *)" (??0CUnknown@@qeaa@PEAUIUnknown@@@z) referenced in function "public: static long __cdecl AdapterCommon::Create(struct IUnknown * *,struct _GUID const &,struct IUnknown *,enum _POOL_TYPE,struct _DEVICE_OBJECT *,struct _IRP *)" (?Create@AdapterCommon@@SAJPEAPEAUIUnknown@@AEBU_GUID@@PEAU2@W4_POOL_TYPE@@PEAU_DEVICE_OBJECT@@PEAU_IRP@@@z)
1>MiniportTopology.obj : error LNK2001: unresolved external symbol "public: __cdecl CUnknown::CUnknown(struct IUnknown *)" (??0CUnknown@@qeaa@PEAUIUnknown@@@z)
1>MiniportWaveRT.obj : error LNK2001: unresolved external symbol "public: __cdecl CUnknown::CUnknown(struct IUnknown *)" (??0CUnknown@@qeaa@PEAUIUnknown@@@z)
1>AdapterCommon.obj : error LNK2019: unresolved external symbol "public: virtual __cdecl CUnknown::~CUnknown(void)" (??1CUnknown@@UEAA@XZ) referenced in function "public: virtual __cdecl AdapterCommon::~AdapterCommon(void)" (??1AdapterCommon@@UEAA@XZ)
1>MiniportTopology.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl CUnknown::~CUnknown(void)" (??1CUnknown@@UEAA@XZ)
1>MiniportWaveRT.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl CUnknown::~CUnknown(void)" (??1CUnknown@@UEAA@XZ)
1>MiniportWaveRTStream.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl CUnknown::~CUnknown(void)" (??1CUnknown@@UEAA@XZ)
1>AdapterCommon.obj : error LNK2001: unresolved external symbol "public: virtual unsigned long __cdecl CUnknown::NonDelegatingAddRef(void)" (?NonDelegatingAddRef@CUnknown@@UEAAKXZ)
1>MiniportTopology.obj : error LNK2001: unresolved external symbol "public: virtual unsigned long __cdecl CUnknown::NonDelegatingAddRef(void)" (?NonDelegatingAddRef@CUnknown@@UEAAKXZ)
1>MiniportWaveRT.obj : error LNK2001: unresolved external symbol "public: virtual unsigned long __cdecl CUnknown::NonDelegatingAddRef(void)" (?NonDelegatingAddRef@CUnknown@@UEAAKXZ)
1>MiniportWaveRTStream.obj : error LNK2001: unresolved external symbol "public: virtual unsigned long __cdecl CUnknown::NonDelegatingAddRef(void)" (?NonDelegatingAddRef@CUnknown@@UEAAKXZ)
1>AdapterCommon.obj : error LNK2001: unresolved external symbol "public: virtual unsigned long __cdecl CUnknown::NonDelegatingRelease(void)" (?NonDelegatingRelease@CUnknown@@UEAAKXZ)
1>MiniportTopology.obj : error LNK2001: unresolved external symbol "public: virtual unsigned long __cdecl CUnknown::NonDelegatingRelease(void)" (?NonDelegatingRelease@CUnknown@@UEAAKXZ)
1>MiniportWaveRT.obj : error LNK2001: unresolved external symbol "public: virtual unsigned long __cdecl CUnknown::NonDelegatingRelease(void)" (?NonDelegatingRelease@CUnknown@@UEAAKXZ)
1>MiniportWaveRTStream.obj : error LNK2001: unresolved external symbol "public: virtual unsigned long __cdecl CUnknown::NonDelegatingRelease(void)" (?NonDelegatingRelease@CUnknown@@UEAAKXZ)
1>Driver.obj : error LNK2019: unresolved external symbol __imp_PcInitializeAdapterDriver referenced in function DriverEntry
1>Driver.obj : error LNK2019: unresolved external symbol __imp_PcDispatchIrp referenced in function "long __cdecl PnpHandler(struct _DEVICE_OBJECT *,struct _IRP *)" (?PnpHandler@@YAJPEAU_DEVICE_OBJECT@@PEAU_IRP@@@z)
1>Driver.obj : error LNK2019: unresolved external symbol __imp_PcAddAdapterDevice referenced in function "long __cdecl AddDevice(struct _DRIVER_OBJECT *,struct _DEVICE_OBJECT *)" (?AddDevice@@YAJPEAU_DRIVER_OBJECT@@PEAU_DEVICE_OBJECT@@@z)
1>SubdeviceHelper.obj : error LNK2019: unresolved external symbol __imp_PcRegisterSubdevice referenced in function "private: long __cdecl SubdeviceHelper::InstallSubdevice(struct _IRP *,unsigned short *,unsigned short ,struct _GUID const &,struct _GUID const &,long (__cdecl)(struct IUnknown * *,struct _GUID const &,struct IUnknown *,enum _POOL_TYPE,struct IUnknown *,void *,struct _ENDPOINT_MINIPAIR *),unsigned long,struct _SYSVAD_DEVPROPERTY const *,void *,struct _ENDPOINT_MINIPAIR *,struct IResourceList *,struct _GUID const &,struct IUnknown * *,struct IUnknown * *,struct IUnknown * *)" (?InstallSubdevice@SubdeviceHelper@@AEAAJPEAU_IRP@@PEAG1AEBU_GUID@@2P6AJPEAPEAUIUnknown@@2PEAU4@W4_POOL_TYPE@@4PEAXPEAU_ENDPOINT_MINIPAIR@@@ZKPEBU_SYSVAD_DEVPROPERTY@@67PEAUIResourceList@@2333@Z)
1>SubdeviceHelper.obj : error LNK2019: unresolved external symbol __imp_PcRegisterPhysicalConnection referenced in function "private: long __cdecl SubdeviceHelper::ConnectTopologies(struct IUnknown *,struct IUnknown *,struct _PHYSICALCONNECTIONTABLE *,unsigned long)" (?ConnectTopologies@SubdeviceHelper@@AEAAJPEAUIUnknown@@0PEAU_PHYSICALCONNECTIONTABLE@@k@Z)
1>SubdeviceHelper.obj : error LNK2019: unresolved external symbol __imp_PcNewPort referenced in function "private: long __cdecl SubdeviceHelper::InstallSubdevice(struct _IRP *,unsigned short *,unsigned short ,struct _GUID const &,struct _GUID const &,long (__cdecl)(struct IUnknown * *,struct _GUID const &,struct IUnknown *,enum _POOL_TYPE,struct IUnknown *,void *,struct _ENDPOINT_MINIPAIR *),unsigned long,struct _SYSVAD_DEVPROPERTY const *,void *,struct _ENDPOINT_MINIPAIR *,struct IResourceList *,struct _GUID const &,struct IUnknown * *,struct IUnknown * *,struct IUnknown * *)" (?InstallSubdevice@SubdeviceHelper@@AEAAJPEAU_IRP@@PEAG1AEBU_GUID@@2P6AJPEAPEAUIUnknown@@2PEAU4@W4_POOL_TYPE@@4PEAXPEAU_ENDPOINT_MINIPAIR@@@ZKPEBU_SYSVAD_DEVPROPERTY@@67PEAUIResourceList@@2333@Z)
1>SubdeviceHelper.obj : error LNK2019: unresolved external symbol __imp_PcNewMiniport referenced in function "private: long __cdecl SubdeviceHelper::InstallSubdevice(struct _IRP *,unsigned short *,unsigned short ,struct _GUID const &,struct _GUID const &,long (__cdecl)(struct IUnknown * *,struct _GUID const &,struct IUnknown *,enum _POOL_TYPE,struct IUnknown *,void *,struct _ENDPOINT_MINIPAIR *),unsigned long,struct _SYSVAD_DEVPROPERTY const *,void *,struct _ENDPOINT_MINIPAIR *,struct IResourceList *,struct _GUID const &,struct IUnknown * *,struct IUnknown * *,struct IUnknown * *)" (?InstallSubdevice@SubdeviceHelper@@AEAAJPEAU_IRP@@PEAG1AEBU_GUID@@2P6AJPEAPEAUIUnknown@@2PEAU4@W4_POOL_TYPE@@4PEAXPEAU_ENDPOINT_MINIPAIR@@@ZKPEBU_SYSVAD_DEVPROPERTY@@67PEAUIResourceList@@2333@Z)
1>C:\audiomirror\AudioMirror\x64\Release\AudioMirror.sys : fatal error LNK1120: 12 unresolved externals
1>Done building project "AudioMirror.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Issue when starting driver

Hello,

I have issue when starting driver. Do you have idea what should I check?

image

Thanks in advance!

Best regards,
Filip

Some questions about next steps

Hi. Thanks for your sharing.

I build this project and find it can pass audio from speaker driver to mic driver ,very cool. I want to add more functions to it ,just like Loopback on Mac . But I am new to windows driver, could you please give me some advice? These are some my questions.

  1. How to play sound when audio passed to speaker driver?
  2. How to get audio from dirver which connects to hardware?

Driver not working properly

@JannesP Thank you for your sharing.
I built your code, but I got a new error relate to certificate
image

I installed .cer file
image

Can you help me to check it? Thank you!

License?

What's the license for this project?

dynamic function!

Can it support dynamic creation or deletion of virtual audio drivers?

Getting this error only during building for Release x64

Hi James,

C:\Users\Downloads\AudioMirror-master (1)\AudioMirror-master\AudioMirror\AdapterCommon.cpp(112,96): error C2220: the following warning is treated as an error

For this line of code
if (!NT_SUCCESS(ntStatus)) DPF(D_TERSE, ("PcGetPhysicalDeviceObject failed, 0x%x", ntStatus));

I have tried to compile with (/WX-) along with /W3

5.1 / 7.1 support?

Hello, great project!

I was wondering if you could provide some advice on how to extend the number of channels to support 5.1/7.1 surround? I have tried changing the MAX_CHANNELS, avgBytesPerSecond, and KSAUDIO_SPEAKER values in SpeakerWaveProperties.h and MicrophoneWaveProperties.h but this results in a broken driver. Are there any other parts of the code you would recommend looking at?

Tried to compile but I am getting spectre mitigated libs error

Hi, I am kinda new but as I was attempting to compile this on my windows VM using VS 2022. It is throwing an error telling me that Spectre Mitigated libraries missing or something along the lines. But i did install it and its still giving me the error. Is there anything I am missing ? :)

Solution builds successfully, installs successfully but devices are not showing up in "Device Manager"

Hi @JannesP
Hope you give a look at it.
I'm on Windows 10 (x64) trying to install the driver. Driver gets installed successfully but when i check the Device Manager, no device related to this driver shows up.
However, when i directly install ".sys" file using a tool, i can see the device(AudioMirror) in "Devicetree" tool but it still doesn't show up in Windows Device Manager.
Is there any configuration i need to do ?
Any help on this would be much appreciated.
Thanks!

apis to create and destroy AudioMirror Virtual Audio Device?

Hi, I struggled to compile and install AudioMirror (new to Windows and Windows Driver), it worked ok now.
I'd like to know if I can create AudioMirror and destroy it by some apis in C++? something like this:

// include AudioMirror api header file

// somewhere in my project
{
    if (bCreate) createAudioMirror();
    ......
    if (bDestroy) destroyAudioMirror();
}

thank you very much.

Environment:
Windows 10, Visual Studio 2019, SDK18362, WDK18362, in C++
(Currently, I just disable enforcement through startup settings to install the unsigned driver)

How this Driver work?

I installed your driver but unlike sysvad no recording file is recorded and the mic and speaker are not working, can I edit which part to record sound as well as use mic. Thanks you

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.