kcat / openal-soft

OpenAL Soft is a software implementation of the OpenAL 3D audio API.
Other
2.23k stars 536 forks source link

ios sound not playing #1036

Closed hsdk123 closed 3 months ago

hsdk123 commented 3 months ago

Hi, apologies for not being able to find more detailed info, but I notice that my build on ios isn't playing sounds. (whereas windows, android, etc. are fine)

I notice

Audio renderer: OpenAL Soft by OpenAL Community
OpenAL version: 1.1 ALSOFT 1.23.1

in the logs, hence it seems I am using openal soft - would anyone know what else I might be able to diagnose?

kcat commented 3 months ago

A trace log would help, if you're able to generate one on iOS (set the ALSOFT_LOGLEVEL environment variable to 3, and capture stderr to a file, or also set the ALSOFT_LOGFILE env var to a path+filename the process can write to).

Are any errors generated from alGenBuffers, alBufferData, alGenSources, alSourcePlay, etc?

hsdk123 commented 3 months ago

@kcat

set the ALSOFT_LOGLEVEL environment variable to 3

The only openal related logs I seem to see would be below. What do you think?

[ALSOFT] (II) Initializing library v1.23.1-0ee47a1 master
[ALSOFT] (II) Supported backends: core, null, wave
[ALSOFT] (II) Loading config /etc/openal/alsoft.conf...
[ALSOFT] (II) Loading config /etc/xdg/alsoft.conf...
[ALSOFT] (II) Loading config /private/var/mobile/Containers/Data/Application/997FB03D-D7FC-414D-89CA-866B80725461/.alsoftrc...
[ALSOFT] (II) Loading config /private/var/mobile/Containers/Data/Application/997FB03D-D7FC-414D-89CA-866B80725461/.config/alsoft.conf...
[ALSOFT] (II) Got binary: "", ""
[ALSOFT] (II) Extensions: +NEON
[ALSOFT] (II) Initialized backend "core"
[ALSOFT] (II) Added "core" for playback
[ALSOFT] (II) Added "core" for capture
[ALSOFT] (II) Opening playback device "OpenAL Soft"
[ALSOFT] (II) Created device 0x10575c000, "CoreAudio Default"
[ALSOFT] (II) Pre-reset: Stereo, Float32, 48000hz, 960 / 2880 buffer
[ALSOFT] (II) Post-reset: Stereo, Float32, 48000hz, 960 / 2880 buffer
[ALSOFT] (II) Stereo rendering
[ALSOFT] (II) Channel config, Main: 3, Real: 2
[ALSOFT] (II) Allocating 5 channels, 20480 bytes
[ALSOFT] (II) Enabling single-band first-order ambisonic decoder
[ALSOFT] (II) Max sources: 256 (255 + 1), effect slots: 64, sends: 2
[ALSOFT] (II) Dithering disabled
[ALSOFT] (II) Output limiter disabled
[ALSOFT] (II) Fixed device latency: 0ns
[ALSOFT] (II) Post-start: Stereo, Float32, 48000hz, 960 / 2880 buffer
[ALSOFT] (II) Increasing allocated voices to 256
[ALSOFT] (II) Created context 0x106026800
Audio renderer: OpenAL Soft by OpenAL Community
OpenAL version: 1.1 ALSOFT 1.23.1
[ALSOFT] (II) Increasing allocated voice properties to 32
kcat commented 3 months ago

That would indicate it's at least opening the device and starting playback without any apparent problem. Are you able to check to see what output the app may be connected to, with some kind of audio connection viewer? To make sure it's playing on the expected output.

The CoreAudio API has always looked somewhat obtuse and confusing, like how on OSX, it uses kAudioUnitSubType_DefaultOutput or kAudioUnitSubType_HALOutput, while on iOS or tvOS, it uses kAudioUnitSubType_RemoteIO, with no explanation as to why it needs to be a different audio unit subtype (does iOS/tvOS not have a concept of a default output? how does RemoteIO differ from the default or HAL output subtypes, and what are the consequences of that difference?). Not having a way to easily test it on non-Apple devices doesn't help.

hsdk123 commented 3 months ago

Thanks for all the help! Realised it was just due to my phone being on silent mode (...). Seems Unity, Unreal, etc. have the same problem.