q-p / SoundPusher

Virtual audio device, real-time encoder and SPDIF forwarder for macOS
MIT License
153 stars 15 forks source link

Debugging #10

Closed weepy closed 4 years ago

weepy commented 5 years ago

Hiya - how can I go about debugging the audio driver ?

q-p commented 5 years ago

The notes from BackgroundMusic on debugging should be applicable here as well, so you probably need to disable system integrity protection (SIP).

weepy commented 5 years ago

Hey - thanks - is that how you do it or are u on an earlier mac-os ?

On Mon, Jul 1, 2019 at 11:31 AM Daniel Vollmer notifications@github.com wrote:

The notes from BackgroundMusic https://github.com/kyleneideck/BackgroundMusic/blob/master/DEVELOPING.md on debugging should be applicable here as well, so you probably need to disable system integrity protection (SIP).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/q-p/SoundPusher/issues/10?email_source=notifications&email_token=AAAAGNH7F2ST273GBV2OQJTP5HMJ5A5CNFSM4H4Q3IE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY5WRMY#issuecomment-507209907, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAAGNDS3SZZR4TLVYNOGV3P5HMJ5ANCNFSM4H4Q3IEQ .

q-p commented 5 years ago

I mainly did "classic" printf debugging and didn't attempt to attach a debugger...

weepy commented 5 years ago

Hey thanks!

I got the driver running ok.

I wanted to be able to set the main output to be "Loopback Audio" and it to come out of the main speakers. Do you know how I might achieve that ? Do I need to run the app as well to do that ?

thanks

Jonah

On Mon, Jul 1, 2019 at 11:35 AM Daniel Vollmer notifications@github.com wrote:

I mainly did "classic" printf debugging and didn't attempt to attach a debugger...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/q-p/SoundPusher/issues/10?email_source=notifications&email_token=AAAAGNHZX3PRPXQCHS4ZODTP5HMVVA5CNFSM4H4Q3IE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY5WYAY#issuecomment-507210755, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAAGNBSOSB3INDL7ZFAXXTP5HMVVANCNFSM4H4Q3IEQ .

q-p commented 5 years ago

Yes, SoundPusher.app reads from Loopback Audio and sends the (encoded) data to the default digital output device.

weepy commented 5 years ago

Cool - thanks! I got the Pusher app and the driver running ok! I hope you don't mind me asking - do you have any ideas about how to output the sound from Loopback Audio to the main output ?

On Mon, Jul 1, 2019 at 12:49 PM Daniel Vollmer notifications@github.com wrote:

Yes, SoundPusher.app reads from Loopback Audio and sends the (encoded) data to the default digital output device.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/q-p/SoundPusher/issues/10?email_source=notifications&email_token=AAAAGNBR73FUR76M6GHIKPLP5HVKXA5CNFSM4H4Q3IE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY535BY#issuecomment-507231879, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAAGNDAWIX5EQWTY4FVG53P5HVKXANCNFSM4H4Q3IEQ .

weepy commented 5 years ago

... I don't have a digital output - so the Pusher app doesn't get into most of the App code.

Am I right in thinking that I need it to do something like :


 *const* *auto* &inDevice = loopbackDevices.front();

    *const* *auto* &outDevice = *outDeviceIt;

    *const* *auto* &outStream = outDevice._streams[attempt.outStreamIndex];

    *try*

    { *// create and start-up first*

      *auto* newChain = std::make_unique<ForwardingChain>(attempt,
inDevice._device, inDevice._streams.front()._stream,

        outDevice._device, outStream._stream, outStream._formats.front(),
kAudioChannelLayoutTag_AudioUnit_5_1);

      newChain->_output.SetUpmix(_enableUpmix);

      newChain->_input.Start();

      newChain->_output.Start();

      *// and only add if everything worked so far*

      _chains.emplace_back(std::move(newChain));

    }

Currently outStream is the Digital devices ... maybe I want to change it to System output ?

On Tue, Jul 2, 2019 at 9:03 AM Jonah Fox jonahfox@gmail.com wrote:

Cool - thanks! I got the Pusher app and the driver running ok! I hope you don't mind me asking - do you have any ideas about how to output the sound from Loopback Audio to the main output ?

On Mon, Jul 1, 2019 at 12:49 PM Daniel Vollmer notifications@github.com wrote:

Yes, SoundPusher.app reads from Loopback Audio and sends the (encoded) data to the default digital output device.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/q-p/SoundPusher/issues/10?email_source=notifications&email_token=AAAAGNBR73FUR76M6GHIKPLP5HVKXA5CNFSM4H4Q3IE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY535BY#issuecomment-507231879, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAAGNDAWIX5EQWTY4FVG53P5HVKXANCNFSM4H4Q3IEQ .

q-p commented 5 years ago

I think you'll have to change many small assumptions strewn throughout the code (and I have no personal interest in doing that).

You would probably be better off looking at apps that don't make the "encoded digital output" assumption to start with, such as Soundflower or Loopback.

weepy commented 5 years ago

Yes of course I wouldn't expect you to do that !

I think your code seems fairly straightforward. I've managed to enumerate the non digital outputs and compile it without the encoding libraries.

I'm guess that DigitalOutputContext will not be used.

Any idea if ForwardingChainIdentifier and ForwardingInputTap are only relevant to digital output ?

J

On Tue, Jul 2, 2019 at 9:39 AM Daniel Vollmer notifications@github.com wrote:

I think you'll have to change many small assumptions strewn throughout the code (and I have no personal interest in doing that).

You would probably be better off looking apps that don't make the "encoded digital output" assumption to start with, such as Soundflower https://github.com/mattingalls/Soundflower or Loopback https://rogueamoeba.com/loopback/.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/q-p/SoundPusher/issues/10?email_source=notifications&email_token=AAAAGNETCQKMDEQCAXC7YFTP5MH5BA5CNFSM4H4Q3IE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZAQ4IQ#issuecomment-507579938, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAAGNHP3CRFDBOLJUVJN43P5MH5BANCNFSM4H4Q3IEQ .

q-p commented 5 years ago

You still need something that reads input (from Loopback Audio) and forwards it to the actual output device, and the ForwardingInputTap is (currently) does this job.

The ForwardingChainIdentifier is a mapping from which input device's data is sent to which output device.

malikAr commented 4 years ago

How to pass my socket data to loopback driver instead from microphone.