Giter Site home page Giter Site logo

q-p / soundpusher Goto Github PK

View Code? Open in Web Editor NEW
140.0 15.0 13.0 878 KB

Virtual audio device, real-time encoder and SPDIF forwarder for macOS

License: MIT License

C 0.13% Objective-C 1.97% Objective-C++ 9.55% C++ 88.33% Shell 0.03%
coreaudio macos real-time ac3 audio driver ffmpeg audioserverplugin

soundpusher's People

Contributors

q-p 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  avatar  avatar  avatar  avatar  avatar

soundpusher's Issues

Hearing popping notification sound when I'm not playing anything in background

Main issue

Hearing some weird popping sounds and twisted output on some content. This only happens when the soundbar is starting to play something.

How to reproduce

Get the audio file

Open any verizon website and open the "chat with us" on bottom right. The pop up sound is not the same as my internal speaker. It's kind of cracked. I believe this is a short audio with high frequency. Not sure

Example website I use: https://www.verizon.com/smartphones
Or you can probably just download from their CDN:
https://lpcdn.lpsnmedia.net/le_unified_window/10.24.1.0-release_5557/resources/audio/kpSoundEffect.wav

How to trigger the popping sound

  1. Make sure nothing is playing in background
  2. Drag/play the file in Google Chrome (Not working in apple music, it's works just fine)
  3. For the first time of playing, I can hear popping sound. The second time it works fine.

If I'm playing music or other content in background, I cannot reproduce the issue.

Potential solution

Add a feature to play some inaudible sound to prevent output device from sleeping.

Devices I use

I'm using a Mac Studio with Soundblaster X4 and connecting to my Sonos Beam using S/PDIF.

Logs might or might not be related

coreaudiod: (libAudioIssueDetector.dylib) [com.apple.coreaudio:aid] IssueReporting.cpp:495   RTAID [ use_case=Generic report_type=RMS Generic Chain clientID=HAL node=-Input issue_detected_sample_time=12543040.000000 ] -- [ -41.296379, -5.939562 ]

What is working

Pretty much everything else is working. I can listen to Apple music with dolby atmos and everything works fine. Stereo upmix is also working, I can hear the difference between on and off.

Change volume of HDMI TVs or DisplayPort monitors with built-in speakers?

I apologize if the question seems absurdly stupid (I'm not exactly a specialist on virtual sound devices):

Does SoundPusher allow to use macOS volume controls on screens with built-in speakers connected through HDMI/DisplayPort, like e.g. Sound Control (https://staticz.com)?

Another very inaccurate example (since it uses DDC/CI rather than virtual audio devices) of such functionality is MonitorControl (https://github.com/the0neyouseek/MonitorControl).

Thanks.

Issue in the soundpusher app

Screenshot 2021-02-03 at 3 02 02 PM

Hi Daniel,

I get caught up in an exception while running the app. Please look at the attached screenshot for it. The driver as well as app builds successfully but app gets caught in this exception. Can you please let me know if there is any specific procedure to this? or is there anything to be added to your code to make the app run?

Best,
Mangesh

OSSpinLock

Hi,

First of all thank you for creating this project. I'm doing some experimentation based on the Loopback driver and am seeing this deprecation notice.
Development/Audio_Drivers/SoundPusher/LoopbackAudio/LoopbackAudio.c:2813:2: 'OSSpinLockUnlock' is deprecated: first deprecated in macOS 10.12 - Use os_unfair_lock_unlock() from <os/lock.h> instead.

I'm going to work on cleaning that up. Can I have you take a look after I'm done.

Random skipping due to overloads

On Catalina I'm experiencing audio skips from SoundPusher, which I use through a Sound Blaster X4 sound card (usb-c). I've been running tests without using an aggregate device in the Audio MIDI Setup app in order to stream audio to SoundPusher only.

Here are the Console messages I see when the skipping happens:

coreaudiod Audio IO Overload inputs: '' outputs: 'AppleUSBAudioEngine:Creative Technology Ltd:Sound Blaster X1:6' cause: 'Unknown' prewarming: no recovering: no

SoundPusher HALC_ProxyIOContext::IOWorkLoop: skipping cycle due to overload

I'm also getting these messages but not necessarily when the skipping happens, so posting in case it's relevant:
Audio MIDI Setup USBMuxHandleDictionary:1437 Adding event 0x6000012db660 to changelist.

coreaudiod	gPTPClockStatistics for 0x3d22fbe058770005
coreaudiod	Grandmaster Identity: 0x3d22fbe058770005
coreaudiod	Clock lock state: Locked
coreaudiod	Rate Ratio: 2199023255552/2199023255552 (1.000000000000)
coreaudiod	Anchors: 40193223614, 40193223614
coreaudiod	Sync Identity: 0x3d22fbe058770005.0

There's also a constant flood of the following whenever SoundPusher is active (numbers differ slightly):
kernel + IOAudioEngineUserClient[<private>]::performWatchdogOutput(<private>, 31519) - (5c6,29e2)

I know the skipping gets worse if I also catch the stream with Loopback or an aggregate device to output the back speakers separately, and it will eventually stop altogether, but this is separate issue where the audio skips even when SoundPusher has only one output.

Take my money!

Daniel,

I've been banging my head against a wall for a few months now trying various mods, devices, and cables to get my Macbook to output to my Sonos in something other than regular stereo. This plus the SoundBlaster X-Fi 5.1 Pro I had lying around output'ing via SPDIF->Sonos SPDIF/HDMI dongle->Sonos HDMI input did the trick. I would happily contribute to you if you provided a funding link! Thanks so much for getting this out there!

License Info & Tutorial Links

Thank you so much for this repo.

Loopback Audio was purchased by a company and I want to make sure this repo is MIT (Free to use and distribute) commercially.

Can you please post tutorial/links for a rookie to start/understand the SOund Pusher.

Thanks you in advance!

Feature request: recompile SoundPusher as a VLC plugin

Just as the title says, would it be possible for you, to rework your SoundPusher as a plugin for VLC, so VLC, with this plugin, could do all the audio stuff such as upconverting to 5.1 from stereo and if the audio is say, DTS, convert to Dolby 5.1 and have vlc itself handle the resultant audio to spdif. So Instead of routing the audio from VLC to SoundPusher Virtual device to spdif.

Saving a step, and more importantly: as such to also prevent the annoying orange dot of showing up in the upper right corner of your screen, on top of everything and especially when playing fullscreen video.

Basic installation- Unable to see audio device

Hi there,

This looks great.

However, I can't get it to work. I'm wondering if I missed a step?

  1. I downloaded SoundPusherAudio.driver.zip and extracted the folder to /Library/Audio/Plug-Ins/HAL
  2. I opened SoundPusher app

Under my Audio Devices, I don't see a new device. Also, the options in SoundPusher are greyed out.

Any ideas? I'm on Intel Mac, 11.5 (big Sur)

Cheers

No (digital) output device on Mojave 10.14.1

I have copy the LoopbackAudio.driver to HAL folder and open the SoundPusher.app on Mojave 10.14.1, unfortunately there is no digital output device, such as follows

screenshot 2018-11-26 at 1 07 46 pm

and I check the Security & Privacy option, such as follows

image

I just want to record the system sound / microphone, the app could support this?

SoundPusher stream dies every 20-30min

On Catalina (10.15), I use SoundPusher to send a 5.1 optical signal from a USB audio sound card (Sound Blaster X4) to an AV receiver and watch movies using VLC.

However, the stream stops every 20-30min and the right sequence to make it come alive again is (1) quit VLC (2) quit SoundPusher (3) restart sound card. SoundPusher freezes a few seconds whenever interacting with it after the stream has died, until it is restarted.

I would like to troubleshoot this to determine whether this is a SoundPusher issue or a sound card issue, but I am not sure where to look.

Sometimes I have the VLC/system output set to an aggregate device that I set up in the Audio Midi app to have both SoundPusher Audio (=SBX4's SPDIF) and the SBX4's analog speakers active in order to connect surround speakers that are far back directly to the sound card, but the problem happens in both setups.

Debugging

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

Missing "com.apple.security.device.microphone" entitlement for SoundPusher

It seems that on the current release of High Sierra (10.13.5 - 17F77) the com.apple.security.device.microphone entitlement is required.

On my computer, and without this entitlement, SoundPusher was not working because many calls to AudioObjectGetPropertyDataSize where returning a zero size (A least in GetNumStreams).

After adding the entitlement and recompiling the app, everything is OK.

System audio not getting to SoundPusher

Love the app! NooB end user here- I was using SoundPusher with great results for a while, and now I can't seem to get any system/app audio to SP. My receiver shows that it's getting a 5.1 signal over SPDIF when SP is active, I can select it as an audio output, but nothing actually comes out.

I've ensured that my SPDIF device is not used by any other app (including disabling multi output devices in Audio Midi Setup) I've granted SP permissions in both Microphone and Accessibility in System security prefs. and I have a full install of ffMpeg.

Not sure if this is a bug or if I'm missing something. can anyone guide me here? many thanks!!

gPlugIn_StateMutex vs. gDevice.Mutex in LoopbackAudio.c

It seems you've moved many of the device-related variables into a Device struct, including the Mutex (gDevice.Mutex). However, the "old" gPlugIn_StateMutex is still there too, and still used in some of the functions, like LoopbackAudio_QueryInterface and LoopbackAudio_AddRef. Is this on purpose, or is it an oversight ?

Using Loopback in a dspPlugin

Hi Q-P thanks for sharing this is an awesome and inspiring solution!
may I use the GitHub channel here to ask some guidance for me to reuse the loopback audio driver, and then I put a small context here:

I have created a virtual audio DSPKernel framework with a concept of opcodes, an encoder and a runtime. all is working perfectly fine and I m able to create dsp solution embedded in external dac like the one from oktoresearch. Also this is running fine with also on linux with alsa loopback :) now I d like to run my opcodes and the runtime interpreter within your loopback audio driver. In other words the loopback would includes my runtime interpreter and then the outputs would be the inputs treated by the custom dsp prog.

my problem is really basic, where do I start to modify your loopback project in Xcode and can I reuse your plist as is ?

if you look in my AVDSP repo, you ll find the linux folder with the also integration and also an osx folder with a dprunosx.c which aims at testing the dsp runtime core but now I need to pass real audio trough it :)

many thanks in advance

License & Tutorial/helpful Links & Debugging info

Thank you so much for this repo.

Loopback Audio was purchased by a company and I want to make sure this repo is MIT (Free to use and distribute) commercially.

Can you please post tutorial/links for a rookie to start/understand the SOund Pusher.

How can I debug soundpusher where it will hit the break points in Xcode? Makes life easier!

Thanks you in advance!

Upmix Stereo Question

When "Upmix Stereo" is enabled what happens when there is already a 5.1 sound source playing?
I have noticed a difference in sound - will the additional surround channels be overridden by the upsampled stereo signal?

I am curious because so far your little program is so promising... My goal is to have different material in a playlist and I would like to have for example stereo material being upsampled, but 6 channel FLACs being passed through as 5.1.

music (stereo) playback not natural when used with soundbars/sonos

when using soundpusher to playback stereo audio such as music or television content, most soundbars and/or Sonos when used in a surround setup, will make some weird surround stage like a 3.1 or 5.1 setup where the connected soundbar/sonos will shunt all voice frequencies from the music to just the centre channel, this is undesirable for most music and other stereo content, this problem can be somewhat mitigated by the Upmix stereo option already present in SoundPusher, but this really only works best on movies and some tv content, I'd like to see an additional option (suggested name: stereo duplication) that duplicates the stereo audio to 2+2 in a 5.1 dolby container which soundpusher then outputs to spdiff, so this would work out like this, LF gets left channel, RF gets right channel, CF: SoundPusher outputs silence, LS: duplicate of left channel input / LF, RS: same but right channel / RF, LFE: silence.

Let's hope this is possible.

R = right
C = center
L = left
F = front
S = surround/rear
Chanel is L/R + position [F/S]

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.