Announcement

Collapse
No announcement yet.

Supposed to work on Macs yet?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    I looked at some source code and my brain exploded! I will keep poking around though, and if I dont figure out the issue with source channels then I will have a look for ways of changing which device it chooses to use since hopefully that part of the code is a bit easier to wrap my head around.

    I use the very same audio device with my windows PC & UE4 with new audio mixer without this issue so I think that somewhere the mac-specific code is providing incorrect information about this devices capabilities, or the way the driver/os reports on this stuff is different and not being taken account of. I only use it for standard stereo output and many of the output channels are just virtual ones for use with DAW's, S/PDIF that I dont use etc. But since I dont really understand what the wording 'source channel' actually means in UE4 at this stage of init, and the error is saying only 2 output channels, I'm still missing even some basic pieces of the jigsaw. But certainly as far as my macOS is concerned, despite the device showing 6 ins and 12 outs in the audio control panel, the speaker setup is configured to be simple Stereo with the Left front and Right front speakers set to go to monitor outputs 1 and 2 on the hardware. Perhaps UE4 is picking this bit up properly which is why the error message says 2 outputs, but I dont know where it is getting the 12 from, some other part of the code that see's all 12 outputs instead of just using the stereo os speaker setup perhaps.
    Last edited by SteveElbows; 05-27-2017, 04:57 PM.

    Comment


      #17
      I am slowly becoming more familiar with some of the source code. I have established that there is code there which is successfully determining which audio device is set as the default in macOS, I have not yet established why this information isnt being used properly. I may as well spend a bit more time on this today, since if I can get that bit to work I can probably use soundflower 2-channel virtual device as the audio and then use soundflowerbed to pass the audio from that to my actual sound device, getting round the problem with the Audio Mixer not being able to downmix to a device that has too many streams for the current UE4 code to handle (>8, which is the cause of the crash I've experienced).
      Last edited by SteveElbows; 05-28-2017, 08:46 AM.

      Comment


        #18
        OK the issue with default macOS audio device not being used is caused by InitializeHardware in AudioMixerDevice.cpp. It explicitly sets the device array index to be 0 (unless DefaultDeviceName is set or VR audio is being used). The default device does seem to be 0 on windows but this is not the case on the mac, and this function isnt making use of DefaultDeviceIndex which is set in the core audio-specific code.

        I dont have a proper fix for this at the moment but I know the index of soundflower on my mac so I set that in code instead of 0 and now I can listen to the sounds of the synth on my mac, wahey
        Last edited by SteveElbows; 05-28-2017, 08:49 AM.

        Comment


          #19
          OK I believe I have a proper fix. I think the method used is present in the other platform-specific mixer code already so I suspect it wont break anything for non-mac users but I havent actually checked.

          AudioMixerDevice.cpp (line 115 on 4.16 branch, line 121 on current master branch):

          Was: OpenStreamParams.OutputDeviceIndex = 0; // Default device

          Should be: AudioMixerPlatform->GetDefaultOutputDeviceIndex(OpenStreamParams.OutputDeviceIndex); // Default device

          Like I said before, this problem didnt show up in windows because it seems the default audio device is always first in the array on that platform and all the GetDefaultOutputDeviceIndex is doing on windows is returning 0 anyway, but this is not so for every platform.

          Please try to get this into 4.16.1, sorry that I havent learnt how to do github pull requests yet so am using the forum instead.
          Last edited by SteveElbows; 05-28-2017, 08:43 AM.

          Comment


            #20
            Hi Steve, sorry for the delay in responding - been away. Wow, great detective work! So have you been able to rebuild the engine with this change? Is that even possible?

            Comment


              #21
              Originally posted by echolevel View Post
              Hi Steve, sorry for the delay in responding - been away. Wow, great detective work! So have you been able to rebuild the engine with this change? Is that even possible?
              Yes, thats how I knew it worked. It's trivial to rebuild with this change once familiar with the very basics of downloading a github version of UE4 and compiling using xcode.

              Comment


                #22
                Ah, there's me thrashing around to no avail trying to build the Xcode projects from the source that comes from the Launcher when I should've cloned from the github version. Thanks!

                Comment


                  #23
                  Wow, this is serious work! I have the same problem with the new audio engine and my sound card but I don't have any code skills so I'll wait for an Epic answer ^^
                  Do you know if your solution will be implemented soon?
                  Thanks anyway!

                  Comment


                    #24
                    Originally posted by Tomavatars View Post
                    Wow, this is serious work! I have the same problem with the new audio engine and my sound card but I don't have any code skills so I'll wait for an Epic answer ^^
                    Do you know if your solution will be implemented soon?
                    Thanks anyway!
                    Well there are 2 problems and I only fixed one of them, the other one is beyond my skills to fix.

                    First problem, that I fixed, is the new audio engine on macOS always choosing the first audio device in the system, not the audio device that is actually set to be the default in macOS.

                    But once that is fixed, and it tries to use the correct audio device for your setup, you will almost certainly run into a problem due to the number of audio inputs & outputs that your audio interface supports. I got round this temporarily by using soundflower as my default device and using soundflowerbed to route the 2 channel soundflower virtual audio device to my actual audio device.

                    There has not been any official acknowledgement of my fix for the first issue, so I have no idea about timescale for fixing this stuff in a release version of UE4.

                    Comment


                      #25
                      I am very happy to report that at least on my system, both issues I reported here have been fixed in UE4.17 Preview 1

                      Comment


                        #26
                        Great news, thanks for reporting back Steve! I've switched to an employer-provided PC for my current synth plugin work, but it'll be good to be able to twiddle on Mac in my downtime.

                        Comment


                          #27
                          cool!

                          Originally posted by SteveElbows View Post
                          I am very happy to report that at least on my system, both issues I reported here have been fixed in UE4.17 Preview 1
                          That was me one of the first things I worked on after I joined. Thanks for checking this out!

                          Comment


                            #28
                            Originally posted by Ethan.Geller View Post
                            That was me one of the first things I worked on after I joined. Thanks for checking this out!
                            Welcome, and cool, nice work

                            Comment


                              #29
                              Does anyone know if the new audio engine is working on MacOS yet with the release of 4.17? Or do we have to do the steps that SteveElbows has had to go through.. I know it's still in early access however the UE4 Trello Roadmap does say that MacOS is a targeted platform for 4.17. Thanks for any information!

                              Comment


                                #30
                                Originally posted by Rodnino View Post
                                Does anyone know if the new audio engine is working on MacOS yet with the release of 4.17? Or do we have to do the steps that SteveElbows has had to go through.. I know it's still in early access however the UE4 Trello Roadmap does say that MacOS is a targeted platform for 4.17. Thanks for any information!
                                I am able to instantiate the Modular Synth component without doing any special tricks in 4.17 (other than enabling the necessary plugins). However, often when I start to Play a level that loads the synth, a lot of noise is generated (not white noise like from the synth - more like the audio buffers are getting completely hosed). When I say often, I mean about 80% of the time I get that noise.

                                If I subclass the Synth Component and instantiate the default version of that (just makes a 440hz sine tone), 99% of the time there is no noise, but everyone once and a while there is.

                                Comment

                                Working...
                                X