roymacdonald / ofxSoundObjects-NDI

Additional module for ofxSoundObjects for sending audio over a network using ofxNDI
Other
8 stars 0 forks source link

No sound output NDI- Receiver #2

Open bitSpaz opened 11 months ago

bitSpaz commented 11 months ago

Hi @roymacdonald,

I'm trying to use the ofxSoundobjects-NDI addon on a couple projects I'm working on. I'm having trouble getting the sound to play.

The particulars:

Mac Mini (M1) MacOs 13.4.1 of_v20230717_osx_release Xcode 14.3.1

MacBook Pro (Intel) 13,3,1
of_v20230717_osx_release Xcode 14.3.1

Steps taken during the testing.

The sample code from both the basic and fancy examples were copy/pasted into new projects.

I copied the config.make into the new projects and updated. I checked the audio device number and that the source name matched.

The receiver indicated a connection by displaying the IP address displayed in the receiver project.

In the fancy example the waveforms of the Sine wave and file player don't load into the viewport and toggling mute/unmute on both the sender and receiver don't produce sound either.

Here are the console logs

Receiver:

**2023-07-24 15:29:48.532407-0700 NDI_Reciever_Fancy_SM23Debug[6943:29947216] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x600003f3c340> F8BB1C28-BAE8-11D6-9C31-00039315CD46 2023-07-24 15:29:48.552983-0700 NDI_Reciever_Fancy_SM23Debug[6943:29947216] HALC_ProxyObjectMap.cpp:153 HALC_ProxyObjectMap::_CopyObjectByObjectID: failed to create the local object 2023-07-24 15:29:48.553068-0700 NDI_Reciever_Fancy_SM23Debug[6943:29947216] HALC_ShellDevice.cpp:2606 HALC_ShellDevice::RebuildControlList: couldn't find the control object [notice ] ofxSoundUtils::printOutputSoundDevices: ------- SOUND OUTPUT DEVICES --------- [ 0 ] Apple Inc.: MacBook Pro Speakers API: Unkown API ID: 2 Outputs :2

[warning] ofSoundStreamSettings: Setting IN device with api: Unkown API will override the previously set: Unkown API [warning] ofxNDIReceiverSoundObject::findSourceByIpAndPort: can not find a source by IP if IP is empty [verbose] ofxNDI::listSources: NDI Source Detected : MacMINI (ofxSoundObject NDI Sender),192.168.1.105:5961 2023-07-24 15:29:49.850575-0700 NDI_Reciever_Fancy_SM23Debug[6943:29947216] [Window] Warning: Window GLFWWindow 0x7f9984705910 ordered front from a non-active application and may order beneath the active application's windows. 2023-07-24 15:29:49.852587-0700 NDI_Reciever_Fancy_SM23Debug[6943:29947216] [Window] Warning: Window GLFWWindow 0x7f9984705910 ordered front from a non-active application and may order beneath the active application's windows.**

Sender: 2023-07-24 15:29:57.891505-0700 NDI_Sender_Fancy_SM23Debug[5756:275088] Metal API Validation Enabled 2023-07-24 15:29:58.005811-0700 NDI_Sender_Fancy_SM23Debug[5756:275088] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x6000006f4e00> F8BB1C28-BAE8-11D6-9C31-00039315CD46 2023-07-24 15:29:58.016674-0700 NDI_Sender_Fancy_SM23Debug[5756:275088] HALC_ProxyObjectMap.cpp:153 HALC_ProxyObjectMap::_CopyObjectByObjectID: failed to create the local object 2023-07-24 15:29:58.016713-0700 NDI_Sender_Fancy_SM23Debug[5756:275088] HALC_ShellDevice.cpp:2606 HALC_ShellDevice::RebuildControlList: couldn't find the control object [notice ] ofxSoundUtils::printOutputSoundDevices: ------- SOUND OUTPUT DEVICES --------- [ 0 ] MEI: Panasonic-TV API: Unkown API ID: 0 Outputs :2 [ 1 ] Apple Inc.: Mac mini Speakers API: Unkown API ID: 1 Outputs :2

[notice ] ofxSoundUtils::printInputSoundDevices: ------- SOUND INPUT DEVICES ---------

RtApiCore::getDefaultInputDevice: No default device found!

[warning] ofSoundStreamSettings: Setting IN device with api: Unkown API will override the previously set: Unkown API [ error ] RtApiCore::probeDeviceOpen: the device (0) does not support the requested channel count. 2023-07-24 15:29:58.031259-0700 NDI_Sender_Fancy_SM23Debug[5756:275088] [Window] Warning: Window GLFWWindow 0x132707520 ordered front from a non-active application and may order beneath the active application's windows. 2023-07-24 15:29:58.032504-0700 NDI_Sender_Fancy_SM23Debug[5756:275088] [Window] Warning: Window GLFWWindow 0x132707520 ordered front from a non-active application and may order beneath the active application's windows. 2023-07-24 15:30:21.120592-0700 NDI_Sender_Fancy_SM23Debug[5756:275088] +[CATransaction synchronize] called within transaction [ofxAudioFile] loading /Volumes/POTENTIAL/Achwghâ Ney Wodei - Achwghâ Ney Wodei - 01 Impromptu Razz.mp3 | sample rate : 44100 | channels : 2 | length : 2013696 [verbose] ofxSoundFile::load: file loaded. is mp3 : YES [verbose] ofxSimpleSoundPlayer::initFromSoundFile : Not streaming; Reading whole file into memory! Loading file : /Volumes/POTENTIAL/Achwghâ Ney Wodei - Achwghâ Ney Wodei - 01 Impromptu Razz.mp3 DurationMS : 45662 Channels : 2 SampleRate : 44100 Num Samples : 2013696

[verbose] ofxMultiSoundPlayer::load: "/Volumes/POTENTIAL/Achwghâ Ney Wodei - Achwghâ Ney Wodei - 01 Impromptu Razz.mp3" success: true 2023-07-24 15:30:24.851923-0700 NDI_Sender_Fancy_SM23Debug[5756:275088] [default] CGSWindowShmemCreateWithPort failed on port 0

I hope this helps

Thanks

roymacdonald commented 11 months ago

Hi. I have not used this addon for a while. I would need to check. My biggest suspect is the NDI version. I'll let you know how it goes.

roymacdonald commented 11 months ago

Hi! I just checked and it works on my MacBook Pro i7 macos 11.6.8 using OF from github's master branch. having the config.make file actually bothered so I just deleted it. Then I re-generated the project and compiled. Once done I had to copy the libndi.4.dylib from ofxNDI/libs/NDI/lib/osx/x64 into each app's bundle for example into one of the examples /Users/roy/openFrameworks/addons/ofxSoundObjects-NDI/example-ofxNDISender-barebonesVersions/bin/example-ofxNDISender-barebonesVersionsDebug.app/Contents/MacOS/

which branch/version of ofxNDI are you using?

bitSpaz commented 11 months ago

Hi @roymacdonald,

The version I'm using is NDI 2021-03-02 r121634 v4.6.2

I copied the libndi.4.dylib files from and to the folders specified. I deleted the config.make files and regenerated the projects on both machines. They have been compiled but the audio isn't playing on the receiving machine. The sender's help text indicates that the audio is playing but both the position and positionMS Instances displays 0.

Thanks!

roymacdonald commented 11 months ago

if you try the examples on the send machine, do you get any audio?

bitSpaz commented 11 months ago

No I don't.

roymacdonald commented 11 months ago

What about running it on the same machine, both sender and receiver? Try with the examples. You mention that you are using an intel and an M1 mac. Try on both machines to send and receive on the same machine. M1 macs are sometimes a bit finicky. If this works on both then it is a network issue. Notice that you might need to enable metwork access for these apps on the system preferences > privacy..

bitSpaz commented 11 months ago

I tried sender/receiver on the same machine which didn't produce audio. The receiver is displaying the local ip address so they are connected.

It seems to me that PositionMS should be displaying the position in milliseconds as it does on the ofSoundPlayer example. Does it display position on your machine?

roymacdonald commented 11 months ago

Hi. On my machine it displays the current frame. So what I suspect is that you did not choose the correct audio audio device on either side. Make sure you do. Best if it is the built in audio. On the sender, even when it does not output sound to the local sound device it still needs to connect to it in order to clock the sending through NDI

bitSpaz commented 11 months ago

Hi, From the console: ------- SOUND OUTPUT DEVICES --------- [ 0 ] Apple Inc.: MacBook Pro Speakers API: Unkown API ID: 2 Outputs :2

Which corresponds to this line "soundSettings.setOutDevice(outDevices[0]);"
Is this what you're referring to? If so then it's not the issue.

I also experimented with the network successfully sending audio from the Intel to the Mac mini.

Could this be the problem? 2023-08-07 11:00:42.253269-0700 NDI_Sender_SM23Debug[29108:38181835] [default] CGSWindowShmemCreateWithPort failed on port 0

Thanks

roymacdonald commented 11 months ago

you need to have the output set up properly on both computers. In the first post, in the console log for the sender it shows

------- SOUND OUTPUT DEVICES ---------
[ 0 ] MEI: Panasonic-TV

Probably you are connecting to it as teh output. Make sure you connect to the built in audio.

the other error has to do with the window creation and seems unrelated .https://developer.apple.com/forums/thread/727803

bitSpaz commented 10 months ago

I changed the output device to 1 on the mini but that didn't fix the problem.

However, I unearthed a 2015 MacBook Pro running 10.15.7 MacOS. It used openFrameworks 11.2 and it works! The one thing I did differently was to use install info from the ofxNDI readme, Xcode instruction, Build Phases>Copy Files, click the + , add libndi.4.dylib

I tried this method on the intel MacBook Pro mentioned above. I used a fresh download of ofxSoundObjects-NDI, but it still doesn't work.

Thanks

roymacdonald commented 10 months ago

@bitSpaz so did this solve the problems you've got?

bitSpaz commented 10 months ago

Yes! Thanks so much for you're time.