Opened 9 years ago
Last modified 3 years ago
#3285 new defect
Sound error when no sound device or disabled
Reported by: | Vladislav Belov | Owned by: | |
---|---|---|---|
Priority: | Must Have | Milestone: | Backlog |
Component: | Music & Sound FX | Keywords: | |
Cc: | Patch: |
Description (last modified by )
If the sound device is disabled then we have next error on start:
ERROR: Sound: AlcInit failed, m_Device=0x0 m_Context=0x0 dev_name=OpenAL Soft err=a004
And in game:
OpenAL error: (null); called from COggData::InitOggFile (line 74) ERROR: Failed to create initial buffer. OpenAL error: (null) ERROR: could not initialize ogg data at audio/voice/latin/civ/civ_male_what_is_it_1.ogg ERROR: OpenAL error: (null); called from COggData::~COggData (line 36) ERROR: OpenAL error: (null); called from COggData::~COggData (line 40) ERROR: OpenAL error: (null); called from COggData::~COggData (line 44) ERROR: OpenAL error: (null); called from CSoundData::~CSoundData (line 37) ERROR: OpenAL error: (null); called from CSoundData::~CSoundData (line 41) ERROR: error loading sound: pathname=audio/voice/latin/civ/civ_male_what_is_it_1.ogg, error=Function failed (no details available)
Second problem, that if we will miss the sound device in game (pull out minijack of headphones) then sound dissapear, and doesn't appear after return headphones on the place.
My suggestions:
- check (nullptr and alc* functions) Device & Context every time when something want to play sound
- show to player nice message that the sound device is missing and sounds will not play.
Change History (9)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
Component: | Core engine → Music & Sound FX |
---|---|
Keywords: | sound removed |
Milestone: | Alpha 19 → Backlog |
comment:3 by , 6 years ago
Description: | modified (diff) |
---|
When disabling sounds by starting 0ad with "--nosound" these errors I also get errors at startup, but none ingame:
ERROR: Sound: AlcInit failed, m_Device=0x0 m_Context=0x0 dev_name=OpenAL Soft err=a004 ERROR: OpenAL error: (null); called from CSoundManager::~CSoundManager (line 277)
Edit: Seems like the whole thing is only broken on windows.
comment:4 by , 6 years ago
Patch: | → Phab:D1481 |
---|
comment:5 by , 5 years ago
Milestone: | Backlog → Alpha 24 |
---|
Duplicate at #3285
Imaroks messages can be reproduced in a windows VM with disabled soundcard.
comment:6 by , 4 years ago
Owner: | set to |
---|
comment:7 by , 3 years ago
For the second part, it happens also on linux since by default OpenAL does not permit to e.g. pulseaudio to switch device on the fly (with some reasons). It should be handled properly in the code in 0ad by polling for a disconnect (or trap the error) and reinitialize.
As a work-around on linux you could edit:
~/.alsoftrc [pulse] allow-moves = true
comment:9 by , 3 years ago
Milestone: | Alpha 24 → Backlog |
---|---|
Owner: | removed |
Patch: | Phab:D1481 |
First part is done, there is no longer endless spamming, now we need a way to hotload soundcards.
I think the old sound manager would attempt to init every time its API was used, if it had previously failed, so that is possibly worth doing.
The other thing is there shouldn't be multiple errors if init fails, as you say, one message would suffice. I guess there are some missing checks in parts of the API.