aws-samples / amazon-polly-metahumans

This Unreal Engine sample project demonstrates how to bring Epic Games' MetaHuman digital characters to life using the Amazon Polly text-to-speech service from AWS. Use this project as a starting point for creating your own Unreal Engine applications that leverage Amazon Polly to give voice to your MetaHumans.
MIT No Attribution
178 stars 67 forks source link

USpeechComponent crash on mac #12

Closed KingStorm closed 2 years ago

KingStorm commented 2 years ago

System setup

machine: M1 mac pro build aws-sdk-cpp: cmake "$SDK_REPO_DIR" -DCMAKE_INSTALL_PREFIX="$SDK_INSTALL_DIR" -DBUILD_ONLY="polly" -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DCMAKE_OSX_ARCHITECTURES=x86_64 (have to switch off -DCUSTOM_MEMORY_MANAGEMENT=ON to PASS the build) UE version: 4.27.2


how I trigger the bug

It successfully start the UE, and I can see the metahuman and the scene, and I can do "Play", there is a text box to input text. When I input some text, no speech is generated. Then I end the "Play", it cratshes:


log

LoginId:1df5aecc93402662665fcead18debcbe EpicAccountId:c1550b314dfc4ca8b5464c64c553cfc6

Caught signal

Aws::Client::AWSClient::AttemptExhaustively(Aws::Http::URI const&, Aws::AmazonWebServiceRequest const&, Aws::Http::HttpMethod, char const, char const, char const) const Address = 0x1c889e19d (filename not found) [in libaws-cpp-sdk-core.dylib] Aws::Client::AWSClient::MakeRequestWithUnparsedResponse(Aws::Http::URI const&, Aws::AmazonWebServiceRequest const&, Aws::Http::HttpMethod, char const, char const, char const) const Address = 0x1c88a3c55 (filename not found) [in libaws-cpp-sdk-core.dylib] Aws::Polly::PollyClient::SynthesizeSpeech(Aws::Polly::Model::SynthesizeSpeechRequest const&) const Address = 0x1c7d29b5e (filename not found) [in libaws-cpp-sdk-polly.dylib] PollyClient::SynthesizeSpeech(Aws::Polly::Model::SynthesizeSpeechRequest const&) Address = 0x1c7b0ae28 [/Users/test/repo/amazon-polly-metahumans/Source/AmazonPollyMetaHuman/Private/PollyClient.cpp, line 36] [in UE4Editor-AmazonPollyMetaHuman.dylib] USpeechComponent::SynthesizeAudio(FString const&, EVoiceId) Address = 0x1c7b0c113 (filename not found) [in UE4Editor-AmazonPollyMetaHuman.dylib] USpeechComponent::GenerateSpeechSync(FString, EVoiceId) Address = 0x1c7b0bf8f [/Users/test/repo/amazon-polly-metahumans/Source/AmazonPollyMetaHuman/Private/SpeechComponent.cpp, line 118] [in UE4Editor-AmazonPollyMetaHuman.dylib] UE4Function_Private::TFunctionRefCaller<FGenerateSpeechAction::FGenerateSpeechAction(FLatentActionInfo const&, USpeechComponent, FString const&, EVoiceId const&, EGenerateSpeechExecPins&)::$_0, void ()>::Call(void) Address = 0x1c7b0a711 [/Users/Shared/Epic Games/UE_4.27/Engine/Source/Runtime/Core/Public/Templates/Function.h, line 548] [in UE4Editor-AmazonPollyMetaHuman.dylib] TGraphTask::ExecuteTask(TArray<FBaseGraphTask, TSizedDefaultAllocator<32> >&, ENamedThreads::Type) Address = 0x10cfb5d3c (filename not found) [in UE4Editor-Core.dylib] FTaskThreadAnyThread::ProcessTasks() Address = 0x10cf987ca (filename not found) [in UE4Editor-Core.dylib] FTaskThreadAnyThread::ProcessTasksUntilQuit(int) Address = 0x10cf97818 (filename not found) [in UE4Editor-Core.dylib] FTaskThreadAnyThread::Run() Address = 0x10cf976c9 (filename not found) [in UE4Editor-Core.dylib] FRunnableThreadPThread::Run() Address = 0x10d0c9a18 (filename not found) [in UE4Editor-Core.dylib] FRunnableThreadPThread::_ThreadProc(void) Address = 0x10d03ab84 (filename not found) [in UE4Editor-Core.dylib] _pthread_start Address = 0x7ff81a5194e1 (filename not found) [in libsystem_pthread.dylib] thread_start Address = 0x7ff81a514f6b (filename not found) [in libsystem_pthread.dylib]

cwalkere commented 2 years ago

That error message leads me to believe the aws sdk isn't installed properly. "(filename not found) [in libaws-cpp-sdk-core.dylib]"

Did you run this script? https://github.com/aws-samples/amazon-polly-metahumans/blob/main/Source/AmazonPollyMetaHuman/ThirdParty/AwsSdk/BuildAwsSdkMac.sh

Try running that script or fully going through it manually if you want - cmake is not the only step.

KingStorm commented 2 years ago

@cwalkere

Thanks for your reply. YES, I run that BuildAwsSdkMac.sh script. let me try to manually build it.

BTW, is this related to my turning off "-DCUSTOM_MEMORY_MANAGEMENT=ON", because when I turn on this custom memory management flag, the build fail at last (seems passed all tests):

[----------] Global test environment tear-down [==========] 475 tests from 76 test cases ran. (9975 ms total) [ PASSED ] 475 tests. /Users/test/repo/amazon-polly-metahumans/Source/AmazonPollyMetaHuman/ThirdParty/AwsSdk/aws-sdk-cpp/aws-cpp-sdk-core-tests/RunTests.cpp:40: Failure Expected equality of these values: memorySystem.GetCurrentOutstandingAllocations() Which is: 16 0ULL Which is: 0 /Users/test/repo/amazon-polly-metahumans/Source/AmazonPollyMetaHuman/ThirdParty/AwsSdk/aws-sdk-cpp/aws-cpp-sdk-core-tests/RunTests.cpp:40: Failure Expected equality of these values: memorySystem.GetCurrentBytesAllocated() Which is: 1440 0ULL Which is: 0 /Users/test/repo/amazon-polly-metahumans/Source/AmazonPollyMetaHuman/ThirdParty/AwsSdk/aws-sdk-cpp/aws-cpp-sdk-core-tests/RunTests.cpp:40: Failure Value of: memorySystem.IsClean() Actual: false Expected: true aws-cpp-sdk-core-tests(19543,0x201374600) malloc: error for object 0x600002ce87f0: pointer being freed was not allocated aws-cpp-sdk-core-tests(19543,0x201374600) malloc: set a breakpoint in malloc_error_break to debug /bin/sh: line 1: 19543 Abort trap: 6 ./aws-cpp-sdk-core-tests --gtest_shuffle --gtest_repeat=3 make[2]: [aws-cpp-sdk-core-tests/aws-cpp-sdk-core-tests] Error 134 make[2]: Deleting file `aws-cpp-sdk-core-tests/aws-cpp-sdk-core-tests' make[1]: [aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/all] Error 2 make: [all] Error 2

KingStorm commented 2 years ago

Tried manually building,.... still got no luck.

The speaker does not speak.

截屏2022-06-28 12 37 23

cwalkere commented 2 years ago

when you manually built, did you copy the built .dlls, .pdbs, and .lib files into the correct folder?

Also - did you configure your aws credentials?

Can you go to Window -> Developer Tools -> Output Log and tell me if you see any errors?

cwalkere commented 2 years ago

@KingStorm please take a look at the other issue.

I found that the issue is "-DCUSTOM_MEMORY_MANAGEMENT=ON" must be specified or you get a problem. I was able to get mine to work on windows by modifying the script to pull down the aws-sdk version 1.9.0, seems the latest aws sdk might have changed something with this.

KingStorm commented 2 years ago

Okay, thanks, let me try to use aws-sdk 1.9.0, I am working on Mac, haven't tried it on Windows.

KingStorm commented 2 years ago

with "-DCUSTOM_MEMORY_MANAGEMENT=ON", still build failed.


Build failed on mac:

[----------] Global test environment tear-down [==========] 475 tests from 76 test cases ran. (7633 ms total) [ PASSED ] 475 tests. /repo/aws_downloads/aws-sdk-cpp/aws-cpp-sdk-core-tests/RunTests.cpp:40: Failure Expected equality of these values: memorySystem.GetCurrentOutstandingAllocations() Which is: 16 0ULL Which is: 0 /repo/aws_downloads/aws-sdk-cpp/aws-cpp-sdk-core-tests/RunTests.cpp:40: Failure Expected equality of these values: memorySystem.GetCurrentBytesAllocated() Which is: 1440 0ULL Which is: 0 /repo/aws_downloads/aws-sdk-cpp/aws-cpp-sdk-core-tests/RunTests.cpp:40: Failure Value of: memorySystem.IsClean() Actual: false Expected: true aws-cpp-sdk-core-tests(10932,0x102cac580) malloc: error for object 0x6000038f8858: pointer being freed was not allocated aws-cpp-sdk-core-tests(10932,0x102cac580) malloc: set a breakpoint in malloc_error_break to debug /bin/sh: line 1: 10932 Abort trap: 6 ./aws-cpp-sdk-core-tests --gtest_shuffle --gtest_repeat=3 make[2]: [aws-cpp-sdk-core-tests/aws-cpp-sdk-core-tests] Error 134 make[2]: Deleting file `aws-cpp-sdk-core-tests/aws-cpp-sdk-core-tests' make[1]: [aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/all] Error 2 make: [all] Error 2 mkdir: /repo/aws_downloads/Mac: File exists cp: /repo/aws_downloads/aws-sdk-cpp/_install/include: No such file or directory ls: /repo/aws_downloads/aws-sdk-cpp/_install/lib/*.dylib: No such file or directory

cmake version 3.24.0-rc2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

KingStorm commented 2 years ago

Seems, the AWS SDK cannot successfully get audio file:

LogPollyMsg: Error: Polly failed to generate audio file. Error: curlCode: 6, Couldn't resolve host name LogPollyMsg: Error: Failed to start speech. GenerateSpeech must be invoked before StartSpeech.

KingStorm commented 2 years ago

Cause: cannot link to official AWS endpoint. (cannot ping that address)