With threads disabled, the sound is working fine in 32 bits. In 64, there is no sound at all, then it crashes a few random frames later.
I started added traces in all functions that could be related to the sound or the main loop. Here's initialization and the first frame.
Code: Select all
10-08 10:51:56.543 11594 11594 E ZgeAndroid: InitChannels: Initializing channels
10-08 10:51:56.543 11594 11594 E ZgeAndroid: InitChannels: Initializing channel 0
10-08 10:51:56.543 11594 11594 E ZgeAndroid: InitChannels: Channel 0 set to active with Volume = 0.5 and DelayLength = 0.1
10-08 10:51:56.543 11594 11594 E ZgeAndroid: InitChannels: Allocated 705600 bytes for DelayBuffer of channel 0
10-08 10:51:56.544 11594 11594 E ZgeAndroid: InitChannels: DelayBuffer of channel 0 initialized to 0
10-08 10:51:56.544 11594 11594 E ZgeAndroid: InitChannels: Initializing channel 1
10-08 10:51:56.544 11594 11594 E ZgeAndroid: InitChannels: Channel 1 set to active with Volume = 0.5 and DelayLength = 0.1
10-08 10:51:56.544 11594 11594 E ZgeAndroid: InitChannels: Allocated 705600 bytes for DelayBuffer of channel 1
10-08 10:51:56.544 11594 11594 E ZgeAndroid: InitChannels: DelayBuffer of channel 1 initialized to 0
10-08 10:51:56.544 11594 11594 E ZgeAndroid: InitChannels: Initializing channel 2
10-08 10:51:56.544 11594 11594 E ZgeAndroid: InitChannels: Allocated 705600 bytes for DelayBuffer of channel 2
10-08 10:51:56.544 11594 11594 E ZgeAndroid: InitChannels: DelayBuffer of channel 2 initialized to 0
10-08 10:51:56.544 11594 11594 E ZgeAndroid: InitChannels: Initializing channel 3
10-08 10:51:56.544 11594 11594 E ZgeAndroid: InitChannels: Allocated 705600 bytes for DelayBuffer of channel 3
10-08 10:51:56.545 11594 11594 E ZgeAndroid: InitChannels: DelayBuffer of channel 3 initialized to 0
10-08 10:51:56.545 11594 11594 E ZgeAndroid: InitChannels: Initializing channel 4
10-08 10:51:56.545 11594 11594 E ZgeAndroid: InitChannels: Allocated 705600 bytes for DelayBuffer of channel 4
10-08 10:51:56.545 11594 11594 E ZgeAndroid: InitChannels: DelayBuffer of channel 4 initialized to 0
10-08 10:51:56.545 11594 11594 E ZgeAndroid: InitChannels: Initializing channel 5
10-08 10:51:56.545 11594 11594 E ZgeAndroid: InitChannels: Allocated 705600 bytes for DelayBuffer of channel 5
10-08 10:51:56.545 11594 11594 E ZgeAndroid: InitChannels: DelayBuffer of channel 5 initialized to 0
10-08 10:51:56.545 11594 11594 E ZgeAndroid: InitChannels: Initializing channel 6
10-08 10:51:56.545 11594 11594 E ZgeAndroid: InitChannels: Allocated 705600 bytes for DelayBuffer of channel 6
10-08 10:51:56.546 11594 11594 E ZgeAndroid: InitChannels: DelayBuffer of channel 6 initialized to 0
10-08 10:51:56.546 11594 11594 E ZgeAndroid: InitChannels: Initializing channel 7
10-08 10:51:56.546 11594 11594 E ZgeAndroid: InitChannels: Allocated 705600 bytes for DelayBuffer of channel 7
10-08 10:51:56.549 11594 11594 E ZgeAndroid: InitChannels: DelayBuffer of channel 7 initialized to 0
10-08 10:51:56.549 11594 11594 E ZgeAndroid: InitChannels: Initializing channel 8
10-08 10:51:56.549 11594 11594 E ZgeAndroid: InitChannels: Allocated 705600 bytes for DelayBuffer of channel 8
10-08 10:51:56.549 11594 11594 E ZgeAndroid: InitChannels: DelayBuffer of channel 8 initialized to 0
10-08 10:51:56.549 11594 11594 E ZgeAndroid: InitChannels: Initializing channel 9
10-08 10:51:56.549 11594 11594 E ZgeAndroid: InitChannels: Allocated 705600 bytes for DelayBuffer of channel 9
10-08 10:51:56.550 11594 11594 E ZgeAndroid: InitChannels: DelayBuffer of channel 9 initialized to 0
10-08 10:51:56.550 11594 11594 E ZgeAndroid: InitChannels: Initializing channel 10
10-08 10:51:56.550 11594 11594 E ZgeAndroid: InitChannels: Allocated 705600 bytes for DelayBuffer of channel 10
10-08 10:51:56.550 11594 11594 E ZgeAndroid: InitChannels: DelayBuffer of channel 10 initialized to 0
10-08 10:51:56.550 11594 11594 E ZgeAndroid: InitChannels: Initializing channel 11
10-08 10:51:56.550 11594 11594 E ZgeAndroid: InitChannels: Allocated 705600 bytes for DelayBuffer of channel 11
10-08 10:51:56.551 11594 11594 E ZgeAndroid: InitChannels: DelayBuffer of channel 11 initialized to 0
10-08 10:51:56.551 11594 11594 E ZgeAndroid: InitChannels: Initializing channel 12
10-08 10:51:56.551 11594 11594 E ZgeAndroid: InitChannels: Allocated 705600 bytes for DelayBuffer of channel 12
10-08 10:51:56.551 11594 11594 E ZgeAndroid: InitChannels: DelayBuffer of channel 12 initialized to 0
10-08 10:51:56.551 11594 11594 E ZgeAndroid: InitChannels: Initializing channel 13
10-08 10:51:56.551 11594 11594 E ZgeAndroid: InitChannels: Allocated 705600 bytes for DelayBuffer of channel 13
10-08 10:51:56.552 11594 11594 E ZgeAndroid: InitChannels: DelayBuffer of channel 13 initialized to 0
10-08 10:51:56.552 11594 11594 E ZgeAndroid: InitChannels: Initializing channel 14
10-08 10:51:56.552 11594 11594 E ZgeAndroid: InitChannels: Allocated 705600 bytes for DelayBuffer of channel 14
10-08 10:51:56.552 11594 11594 E ZgeAndroid: InitChannels: DelayBuffer of channel 14 initialized to 0
10-08 10:51:56.552 11594 11594 E ZgeAndroid: InitChannels: Initializing channel 15
10-08 10:51:56.552 11594 11594 E ZgeAndroid: InitChannels: Allocated 705600 bytes for DelayBuffer of channel 15
10-08 10:51:56.553 11594 11594 E ZgeAndroid: InitChannels: DelayBuffer of channel 15 initialized to 0
10-08 10:51:56.553 11594 11594 E ZgeAndroid: InitChannels: All channels initialized
10-08 10:51:56.556 11594 11594 E ZgeAndroid: /storage/emulated/0
10-08 10:51:56.556 11594 11594 E ZgeAndroid: /data/user/0/com.txori.omeganaut/files/
10-08 10:51:56.556 11594 11594 E ZgeAndroid: /data/app/~~WzM-AujtO1JGB9Ob-MXTag==/com.txori.omeganaut-Fbs6WlbwCDCfFzz6L_NppQ==/lib/arm64/
10-08 10:51:56.557 11594 11594 E ZgeAndroid: TSound.Create: Initializing TSound object
10-08 10:51:56.557 11594 11594 E ZgeAndroid: DefineProperties: Entering function
10-08 10:51:56.557 11594 11594 E ZgeAndroid: DefineProperties: Length property added
10-08 10:51:56.557 11594 11594 E ZgeAndroid: DefineProperties: Volume property added
10-08 10:51:56.557 11594 11594 E ZgeAndroid: DefineProperties: BaseNoteNr property added
10-08 10:51:56.557 11594 11594 E ZgeAndroid: DefineProperties: Osc1 properties added
10-08 10:51:56.557 11594 11594 E ZgeAndroid: DefineProperties: Osc2 properties added
10-08 10:51:56.557 11594 11594 E ZgeAndroid: DefineProperties: HardSync property added
10-08 10:51:56.557 11594 11594 E ZgeAndroid: DefineProperties: Filter properties added
10-08 10:51:56.557 11594 11594 E ZgeAndroid: DefineProperties: Pan property added
10-08 10:51:56.557 11594 11594 E ZgeAndroid: DefineProperties: Modulation properties added for index 0
10-08 10:51:56.557 11594 11594 E ZgeAndroid: DefineProperties: Modulation properties added for index 1
10-08 10:51:56.557 11594 11594 E ZgeAndroid: DefineProperties: Modulation properties added for index 2
10-08 10:51:56.557 11594 11594 E ZgeAndroid: DefineProperties: Modulation properties added for index 3
10-08 10:51:56.557 11594 11594 E ZgeAndroid: DefineProperties: Envelope properties added for index 0
10-08 10:51:56.557 11594 11594 E ZgeAndroid: DefineProperties: Envelope properties added for index 1
10-08 10:51:56.557 11594 11594 E ZgeAndroid: DefineProperties: Lfo properties added for index 0
10-08 10:51:56.557 11594 11594 E ZgeAndroid: DefineProperties: Lfo properties added for index 1
10-08 10:51:56.557 11594 11594 E ZgeAndroid: DefineProperties: SampleRepeatPosition and UseSampleHz properties added
10-08 10:51:56.557 11594 11594 E ZgeAndroid: DefineProperties: Exiting function
10-08 10:51:56.557 11594 11594 E ZgeAndroid: TSound.Create: Initialization completed
10-08 10:51:56.558 11594 11594 E ZgeAndroid: TZApplication.Run: Starting application run.
10-08 10:51:56.558 11594 11594 E ZgeAndroid: TZApplication.Run: Initializing application...
10-08 10:51:56.599 11594 11594 E ZgeAndroid: TZApplication.Run: Skipping initial tree update to avoid triggering AppState.OnStart.
10-08 10:51:56.599 11594 11594 E ZgeAndroid: TZApplication.Run: Executing OnLoaded commands...
10-08 10:51:56.599 11594 11594 E ZgeAndroid: TExpAddToPointer.Execute: Starting execution
10-08 10:51:56.599 11594 11594 E ZgeAndroid: TExpAddToPointer.Execute: Popped value V: 32
10-08 10:51:56.599 11594 11594 E ZgeAndroid: TExpAddToPointer.Execute: Popped pointer P: 411B7A00
10-08 10:51:56.599 11594 11594 E ZgeAndroid: TExpAddToPointer.Execute: Incremented pointer P: 411B7A20
10-08 10:51:56.599 11594 11594 E ZgeAndroid: TExpAddToPointer.Execute: Pushed updated pointer back to stack
10-08 10:51:56.599 11594 11594 E ZgeAndroid: PLAY SOUND COMPONENT
10-08 10:51:56.599 11594 11594 E ZgeAndroid: TZApplication.Run: Running main application loop...
10-08 10:51:56.599 11594 11594 E ZgeAndroid: TZApplication.Run: Application run completed.
10-08 10:51:56.599 11594 11635 E ZgeAndroid: Audio callback started
10-08 10:51:56.599 11594 11594 E ZgeAndroid: GLBase: 1.1
10-08 10:51:56.599 11594 11635 E ZgeAndroid: AudioTrack class found
10-08 10:51:56.599 11594 11635 E ZgeAndroid: getMinBufferSize method found
10-08 10:51:56.599 11594 11635 E ZgeAndroid: AudioRate: 44100, Params: 3, 2
10-08 10:51:56.811 11594 11636 E ZgeAndroid: TZApplication.Main: Current time: 0.8118079901
10-08 10:51:56.812 11594 11636 E ZgeAndroid: TZApplication.Main: Frame processing initiated
10-08 10:51:56.812 11594 11636 E ZgeAndroid: TZApplication.Main: UpdateTime called
10-08 10:51:56.812 11594 11636 E ZgeAndroid: MainSlice: Starting main update cycle
10-08 10:51:56.812 11594 11636 E ZgeAndroid: MainSlice: No current music to update
10-08 10:51:56.812 11594 11636 E ZgeAndroid: MainSlice: No current state to update
10-08 10:51:56.812 11594 11636 E ZgeAndroid: MainSlice: Executing OnUpdate commands
10-08 10:51:56.812 11594 11636 E ZgeAndroid: TExpAddToPointer.Execute: Starting execution
10-08 10:51:56.812 11594 11636 E ZgeAndroid: TExpAddToPointer.Execute: Popped value V: 32
10-08 10:51:56.812 11594 11636 E ZgeAndroid: TExpAddToPointer.Execute: Popped pointer P: 411B7B00
10-08 10:51:56.812 11594 11636 E ZgeAndroid: TExpAddToPointer.Execute: Incremented pointer P: 411B7B20
10-08 10:51:56.812 11594 11636 E ZgeAndroid: TExpAddToPointer.Execute: Pushed updated pointer back to stack
10-08 10:51:56.812 11594 11636 E ZgeAndroid: Frame 0
10-08 10:51:56.812 11594 11636 E ZgeAndroid: MainSlice: Updating renderers
10-08 10:51:56.812 11594 11636 E ZgeAndroid: MainSlice: Updating models
10-08 10:51:56.812 11594 11636 E ZgeAndroid: MainSlice: Updating collisions
10-08 10:51:56.812 11594 11636 E ZgeAndroid: MainSlice: Emitting sounds from the AudioPlayer
10-08 10:51:56.812 11594 11636 E ZgeAndroid: EmitSoundsInEmitList: Start emitting sounds
10-08 10:51:56.812 11594 11636 E ZgeAndroid: EmitSoundsInEmitList: Emitting note
10-08 10:51:56.812 11594 11636 E ZgeAndroid: EmitSoundsInEmitList: EmitList cleared after processing
10-08 10:51:56.812 11594 11636 E ZgeAndroid: EmitSoundsInEmitList: Mutex released
10-08 10:51:56.812 11594 11636 E ZgeAndroid: EmitSoundsInEmitList: Finished emitting sounds
10-08 10:51:56.813 11594 11636 E ZgeAndroid: MainSlice: No net results to flush
10-08 10:51:56.813 11594 11636 E ZgeAndroid: MainSlice: Wheel delta reset
10-08 10:51:56.813 11594 11636 E ZgeAndroid: MainSlice: Finished main update cycle
10-08 10:51:56.813 11594 11636 E ZgeAndroid: TZApplication.Main: MainSlice executed
10-08 10:51:56.813 11594 11636 E ZgeAndroid: TZApplication.UpdateScreen: Starting screen update
10-08 10:51:56.813 11594 11636 E ZgeAndroid: TZApplication.UpdateScreen: Render Pass: 0
10-08 10:51:56.813 11594 11636 E ZgeAndroid: TZApplication.UpdateScreen: Updating viewport
10-08 10:51:56.813 11594 11636 E ZgeAndroid: TZApplication.UpdateScreen: Applying camera transform
10-08 10:51:56.813 11594 11636 E ZgeAndroid: TZApplication.ApplyCameraTransform: Starting camera transform
10-08 10:51:56.813 11594 11636 E ZgeAndroid: TZApplication.ApplyCameraTransform: Setting up view and camera
10-08 10:51:56.813 11594 11636 E ZgeAndroid: TZApplication.ApplyCameraTransform: Setting perspective with FOV: 45, Viewport Ratio: 2.055555582, Clip Near: 0.1000000015, Clip Far: 100
10-08 10:51:56.813 11594 11636 E ZgeAndroid: TZApplication.ApplyCameraTransform: Applying camera rotation: X: 0, Y: 0, Z: 0
10-08 10:51:56.813 11594 11636 E ZgeAndroid: TZApplication.ApplyCameraTransform: Translating camera to position: X: 0, Y: 0, Z: -14
10-08 10:51:56.813 11594 11636 E ZgeAndroid: TZApplication.ApplyCameraTransform: Camera transform completed
10-08 10:51:56.813 11594 11636 E ZgeAndroid: TZApplication.UpdateScreen: Clearing screen with ClearScreenMode = csmClear and CurrentRenderTarget = nil
10-08 10:51:56.813 11594 11636 E ZgeAndroid: TZApplication.UpdateScreen: ClearColor - R: 0.501960814, G: 0, B: 0.501960814, A: 1
10-08 10:51:56.813 11594 11636 E ZgeAndroid: TZApplication.UpdateScreen: Screen cleared successfully.
10-08 10:51:56.813 11594 11636 E ZgeAndroid: TZApplication.UpdateScreen: Setting ambient light color
10-08 10:51:56.814 11594 11636 E ZgeAndroid: TZApplication.UpdateScreen: No lights found, using default light position
10-08 10:51:56.814 11594 11636 E ZgeAndroid: TZApplication.UpdateScreen: Rendering models and application
10-08 10:51:56.814 11594 11636 E ZgeAndroid: TZApplication.UpdateScreen: Rendering models
10-08 10:51:56.814 11594 11636 E ZgeAndroid: TZApplication.UpdateScreen: Rendering application
10-08 10:51:56.814 11594 11636 E ZgeAndroid: TZApplication.UpdateScreen: Removing lights
10-08 10:51:56.814 11594 11636 E ZgeAndroid: TZApplication.UpdateScreen: Flushing OpenGL commands
10-08 10:51:56.827 11594 11636 E ZgeAndroid: TZApplication.UpdateScreen: Swapping buffers
10-08 10:51:56.827 11594 11636 E ZgeAndroid: TZApplication.UpdateScreen: Screen update completed
10-08 10:51:56.827 11594 11636 E ZgeAndroid: TZApplication.Main: UpdateScreen executed
10-08 10:51:56.827 11594 11636 E ZgeAndroid: TZApplication.Main: Garbage collecting, Alloc Count: 2
10-08 10:51:56.827 11594 11636 E ZgeAndroid: TZApplication.Main: Terminating status: False
10-08 10:51:56.828 11594 11636 E ZgeAndroid: TZApplication.Main: Current time: 0.8286730051
10-08 10:51:56.828 11594 11636 E ZgeAndroid: TZApplication.Main: Frame processing initiated
10-08 10:51:56.828 11594 11636 E ZgeAndroid: TZApplication.Main: UpdateTime called
10-08 10:51:56.828 11594 11636 E ZgeAndroid: MainSlice: Starting main update cycle
10-08 10:51:56.828 11594 11636 E ZgeAndroid: MainSlice: No current music to update
10-08 10:51:56.828 11594 11636 E ZgeAndroid: MainSlice: No current state to update
10-08 10:51:56.828 11594 11636 E ZgeAndroid: MainSlice: Executing OnUpdate commands
10-08 10:51:56.828 11594 11636 E ZgeAndroid: TExpAddToPointer.Execute: Starting execution
10-08 10:51:56.828 11594 11636 E ZgeAndroid: TExpAddToPointer.Execute: Popped value V: 32
10-08 10:51:56.828 11594 11636 E ZgeAndroid: TExpAddToPointer.Execute: Popped pointer P: 411B7B00
10-08 10:51:56.828 11594 11636 E ZgeAndroid: TExpAddToPointer.Execute: Incremented pointer P: 411B7B20
10-08 10:51:56.828 11594 11636 E ZgeAndroid: TExpAddToPointer.Execute: Pushed updated pointer back to stack
10-08 10:51:56.828 11594 11636 E ZgeAndroid: Frame 1
Then it crashes randomly after a few frames. And not always at the same place in the code.
And here's the crash dump that goes with it:
Code: Select all
********** Crash dump: **********
Build fingerprint: 'google/sargo/sargo:12/SP2A.220505.008/8782922:user/release-keys'
#00 0x000000000059f89c /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::ScopedCheck::Check(art::ScopedObjectAccess&, bool, char const*, art::(anonymous namespace)::JniValueType*) (.__uniq.99033978352804627313491551960229047428)+1812) (BuildId: 1ee2c234829500686eefa384068e67c8)
#01 0x000000000059f0a8 /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::CheckJNI::CheckCallArgs(art::ScopedObjectAccess&, art::(anonymous namespace)::ScopedCheck&, _JNIEnv*, _jobject*, _jclass*, _jmethodID*, art::InvokeType, art::(anonymous namespace)::VarArgs const*) (.__uniq.99033978352804627313491551960229047428)+76) (BuildId: 1ee2c234829500686eefa384068e67c8)
#02 0x00000000005a46f4 /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::CheckJNI::CallMethodV(char const*, _JNIEnv*, _jobject*, _jclass*, _jmethodID*, std::__va_list, art::Primitive::Type, art::InvokeType) (.__uniq.99033978352804627313491551960229047428)+232) (BuildId: 1ee2c234829500686eefa384068e67c8)
#03 0x00000000005a74d8 /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::CheckJNI::CallStaticIntMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list) (.__uniq.99033978352804627313491551960229047428.llvm.10145813973330161544)+76) (BuildId: 1ee2c234829500686eefa384068e67c8)
#04 0x000000000004509c /data/app/~~WzM-AujtO1JGB9Ob-MXTag==/com.txori.omeganaut-Fbs6WlbwCDCfFzz6L_NppQ==/lib/arm64/libzgeandroid.so (ZPLATFORM_$$_AUDIOCALLBACK$POINTER$$INT64+828) (BuildId: 6b98f8eb685bb8a66253ffd117f31d2cd5ced61a)
Crash dump is completed
The only weird thing that I see is the definition in ZPlatform.pas:
TDesignerAudioCallback = procedure(P : pointer; FrameCount : integer);
The pointer is called P, while I wrote Data in my changes to 64 bits, a mistake:
{$IFDEF CPU64}
function AudioCallback(Data : pointer) : Int64;
{$ELSE}
function AudioCallback(P : pointer): LongInt;
{$ENDIF}
But naming them both to P doesn't change a thing, as it doesn't seems to be used afterwards.