View Issue Details

IDProjectCategoryView StatusLast Update
0000409Gameplay + OpenGL[All Projects] Bugpublic2017-04-21 08:07
Assigned ToGraf Zahl 
Status resolvedResolutionfixed 
PlatformLinuxOSUbuntuOS Version16.04
Summary0000409: loop_start tags do not work with OpenAL backend
DescriptionIf an OGG music track contains a loop_start tag, and you are using the OpenAL backend, the loop_start tag is ignored, and the song is repeated from the beginning.
Steps To Reproduce1. Use one of Xeotroid's music packs.
2. Listen to one of the songs until the end, and you may notice the song doesn't loop correctly. The incorrect looping may not be noticeable on some songs.
TagsNo tags attached.



Graf Zahl

Graf Zahl

2017-03-09 11:41

administrator   ~0000921

Known issue. The entire tagging implementation heavily depends on FMod and isn't easily transferrable to OpenAL.

This will require some research, but right now there's simply far more pressing issues than fixing this.
Graf Zahl

Graf Zahl

2017-04-01 14:41

administrator   ~0001202

Added for music. Sound effects should also read these tags but that will require interaction with the OpenAL backend. For music it could be done outside.
Graf Zahl

Graf Zahl

2017-04-02 12:33

administrator   ~0001221

The change for sound effects is put on hold for the time being.
Major Cooke

Major Cooke

2017-04-20 14:20

reporter   ~0001482

Last edited: 2017-04-20 14:20

View 2 revisions

I can confirm on my end this happens too. Can this be considered before 3.0 is released?

Happens on Windows too.

Graf Zahl

Graf Zahl

2017-04-20 14:32

administrator   ~0001484

Sorry, but I really have no idea what I need to do for sound effects to make them look. For streamed music it was easy because it happens on the ZDoom side.

This needs to be handled within OpenAL so it will require a quite different approach.


2017-04-20 17:29

developer   ~0001488

The main issue I see is that the sndfile and mpg123 decoders don't read the tags from the file. OpenAL can utilize loop points with the AL_SOFT_loop_points extension, and the LoadSoundRaw() method already utilizes it, so it's just a matter of getting the decoders to read those tags and provide them through the SoundDecoder interface.
Graf Zahl

Graf Zahl

2017-04-20 19:38

administrator   ~0001490

ZDoom never supported MP3 tags. For Ogg and FLAC I added a brute force tag reader because I couldn't find any efficient code example that does it properly, only heavily bloated libraries.

For music I added a client side streaming class analogous to the other music players where it was easy enough to check the tag data. That gets already converted to sample indices, so can I just pass these values to AL_LOOP_POINTS_SOFT?


2017-04-20 22:06

developer   ~0001492

Graf Zahl wrote

That gets already converted to sample indices, so can I just pass these values to AL_LOOP_POINTS_SOFT?

For the sound effects, yes. Music/streaming can't use the buffer's AL_LOOP_POINTS_SOFT property since it uses a queue of multiple buffers that are regularly updated with the next chunk of audio. The client-side streaming class would still be needed to do what it currently is for music, while the LoadSound method can get those sample indices and pass them to AL_LOOP_POINTS_SOFT for sound effects.

You could put the brute-force tag reader code into SndFileDecoder::open, store the converted sample indices in the class, then add a method for callers to retrieve them (perhaps through getInfo with the other properties?). That way would have a common interface to retrieve the loop points through the decoder regardless if it's music or sfx, and allow any future decoders to provide loop points as well.

I can try to do it and make a pull request, though I'm not sure of a mod that uses loop points on ogg/flac sfx to test it.
Graf Zahl

Graf Zahl

2017-04-21 05:34

administrator   ~0001503

Ok, all done. I do not have any sounds using this feature so I'd appreciate if someone could test it and report back.
Major Cooke

Major Cooke

2017-04-21 08:07

reporter   ~0001504

They work, but now there's console errors.

Issue History

Date Modified Username Field Change
2017-03-09 11:31 Talon1024 New Issue
2017-03-09 11:41 Graf Zahl Status new => confirmed
2017-03-09 11:41 Graf Zahl Note Added: 0000921
2017-04-01 14:41 Graf Zahl Note Added: 0001202
2017-04-02 12:33 Graf Zahl Assigned To => Graf Zahl
2017-04-02 12:33 Graf Zahl Status confirmed => on hold
2017-04-02 12:33 Graf Zahl Note Added: 0001221
2017-04-20 14:20 Major Cooke Note Added: 0001482
2017-04-20 14:20 Major Cooke Note Edited: 0001482 View Revisions
2017-04-20 14:32 Graf Zahl Note Added: 0001484
2017-04-20 17:29 Chris Note Added: 0001488
2017-04-20 19:38 Graf Zahl Note Added: 0001490
2017-04-20 22:06 Chris Note Added: 0001492
2017-04-21 05:34 Graf Zahl Status on hold => resolved
2017-04-21 05:34 Graf Zahl Resolution open => fixed
2017-04-21 05:34 Graf Zahl Note Added: 0001503
2017-04-21 08:07 Major Cooke Note Added: 0001504