microsoft / MixedReality-UXTools-Unreal

UX tools and components for developing Mixed Reality applications in UE4.
https://microsoft.github.io/MixedReality-UXTools-Unreal/
MIT License
315 stars 87 forks source link

Sound doesn't appear to work in packaged UE5.1.1 for Hololens 2 #69

Open sirenum01 opened 1 year ago

sirenum01 commented 1 year ago

Hello,

I'm actually a team member from a different area of Microsoft. We're working on a hololens project right now using the toolset you created, however we've built the project in 5.1 and while everything else appears to be working, the sound doesn't! I actually am unable to even get the sample project you provided on github to produce any sound when touching the button-actor, and so I don't believe it has something to do with the project we set up. My email is v-rutkowskid@microsoft.com if you could help us out a bit! Thanks so much!

18084409850 commented 1 year ago

我也遇到了同样的问题 请问你解决了吗

Deltajom commented 1 year ago

For the longest time I was getting errors related to UxtHandInteractionActor.h and UxtTooltipSpawnerComponent.h, it turns out the 5.1 beta branch was missing imports in both, and as a result, UXTools would only work in the editor. I've managed to get this fixed now, but I have run into a similar issue to yours @sirenum01. I've included a snippet of the errors I get from the HoloLens logs here, are they similar to what you had? And have you found a solution?

[2023.06.01-00.09.02:963][ 0]LogAudioMixer: Display: Starting AudioMixerPlatformInterface::RunInternal(), InstanceID=1 [2023.06.01-00.09.02:963][ 0]LogAudioMixer: Display: FMixerPlatformXAudio2::SubmitBuffer() called for the first time. InstanceID=1 [2023.06.01-00.09.02:983][ 0]LogAudio: Error: Attempt to access the DDC when there is none available on sound 'SoundWave /UXTools/Slider/Audio/A_Slider_Grab.A_Slider_Grab', format = FSoundWaveProxy_InvalidFormat_1000_StreamCache_Ver5027_MEM_65536MaxChnkSize_-10483224128. Should have been cooked. [2023.06.01-00.09.02:983][ 0]LogAudio: Error: Attempt to access the DDC when there is none available on sound 'SoundWave /UXTools/Slider/Audio/A_Slider_Release.A_Slider_Release', format = FSoundWaveProxy_InvalidFormat_1000_StreamCache_Ver5027_MEM_65536MaxChnkSize_-10483224128. Should have been cooked. [2023.06.01-00.09.02:983][ 0]LogAudio: Error: Attempt to access the DDC when there is none available on sound 'SoundWave /UXTools/Slider/Audio/A_Slider_Pass_Notch.A_Slider_Pass_Notch', format = FSoundWaveProxy_InvalidFormat_1000_StreamCache_Ver5027_MEM_65536MaxChnkSize_-10483224128. Should have been cooked. [2023.06.01-00.09.02:983][ 0]LogAudio: Error: Attempt to access the DDC when there is none available on sound 'SoundWave /UXTools/Buttons/HoloLens2/S_ButtonPressed_Mono_01.S_ButtonPressed_Mono_01', format = FSoundWaveProxy_InvalidFormat_1000_StreamCache_Ver5027_MEM_65536MaxChnkSize_-10483224128. Should have been cooked. [2023.06.01-00.09.02:983][ 0]LogAudio: Error: Attempt to access the DDC when there is none available on sound 'SoundWave /UXTools/Buttons/HoloLens2/S_ButtonReleased_Mono_01.S_ButtonReleased_Mono_01', format = FSoundWaveProxy_InvalidFormat_1000_StreamCache_Ver5027_MEM_65536MaxChnkSize_-10483224128. Should have been cooked. [2023.06.01-00.09.02:983][ 0]LogInit: FAudioDevice initialized. [2023.06.01-00.09.02:983][ 0]LogAudio: Warning: Can't increase MaxChannels past MaxSources [2023.06.01-00.09.02:983][ 0]LogCsvProfiler: Display: Metadata set : largeworldcoordinates="1" [2023.06.01-00.09.02:993][ 0]LogAudio: Warning: Can't increase MaxChannels past MaxSources [2023.06.01-00.09.03:003][ 0]LogChaos: FPhysicsSolverBase::AsyncDt:-1.000000 [2023.06.01-00.09.03:013][ 0]LogAudio: Display: Audio Device (ID: 1) registered with world 'Untitled'.

I'll take a look into this for now, but worst case I might just remove all audio

Deltajom commented 1 year ago

Update - Nothing I did solve the audio errors I found in the log file above, I switched the binary configuration to DebugGame and set Auto-Detect Windows 10 SDK under hololens packaging settings to true and now it loads to the headset. The only issue now is the lack of sound when pressing and releasing buttons.

I am moving off this issue for now because I need to get QR Code scanning working for my project. I can provide more logs / different logs for the rest of this month but will then be on a different project.

Wulkop commented 1 year ago

I'm not sure if it helps anybody. I had the problem that the whole application on HoloLens was crashing when trying to play any audio (including the sound cues from UXTools). However I have to mention that this happend to me with Unreal Engine 5.2. So take this with a grain of salt. In my case the solution was to:

  1. (For all relevant sound assets) Set Loading Behaviour Override to Force Inline
  2. (In Project Settings -> Engine -> Audio) Set Default Audio Compression Type to PCM since Bink Audio library is not build for HoloLens target platform by Unreal Engine
greenwoodms06 commented 10 months ago

@Deltajom What issues did you end up fixing? Things work for me (it seems) on 5.1 until I add a Blueprint which has a UXTPressableButton actor (via a ChildActor). In editor things are fine but packaged projects that have it will not open on the Hololens 2. Remove the offending button and voila, it works again... No errors or warnings in the Output Log...

Ideas?

Olli1080 commented 2 months ago

You can workaround the issue of crashing by replacing check(Buffer->DecompressionState); with

UE_LOG(LogAudioMixer, Warning, TEXT("FMixerBuffer::CreateRealTimeBuffer failed Buffer->DecompressionState"))

in Engine/Source/Runtime/AudioMixer/Private/AudioMixerBuffer.cpp.

Deltajom commented 2 months ago

@greenwoodms06 I haven't tried @Wulkop 's solution but it looks like its a good place to start. I had a method like @Olli1080 and logged it instead of having a check. You have to edit the files based on what is erroring. Also, I'm finally responding because I passed my master's thesis!