YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
15 stars 7 forks source link

In-Game: [Ubuntu] audio_sound_get_track_position does not update as often as on other platforms #6317

Open protogenposting opened 2 weeks ago

protogenposting commented 2 weeks ago

Description

Bug Report Example.zip contact package.zip

this is an issue that only showed up for me once i switched to the linux version. I was able to recreate it but it's a little worse in my game somehow

Expected Change

No response

Steps To Reproduce

  1. create a project with an object and a sound
  2. play the sound in the create event of the object and print the sound's track position

How reliably can you recreate this issue using your steps above?

Always

Which version of GameMaker are you reporting this issue for?

2024.600 (Betas)

Which platform(s) are you seeing the problem on?

Ubuntu

Contact Us Package Attached?

Sample Project Added?

AdamBorek commented 2 weeks ago

Can confirm this happens on the windows version as well on 2024.6

YYDan commented 2 weeks ago

Okay, so Adam's comment above was from coincidentally checking a different project and comes from when getting the position of a sound asset you will always get 0. This differs from the manual, which says you should actually be returned the offset value that was used when the audio_play_sound() was called.

The original sample above and the extended one I made, which both capture the instance of the sound that's playing, works fine for us on Windows/macOS in 2024.4.1.202 and also 2024.600.0.605 and Ubuntu in 2024.400 and also 2024.600.0.605, so using your sample we're actually not seeing the issue because you have already worked around it ;)

Updated testing project: audioSoundGetTrackPosition.zip

You can see the bug/the difference here (we're expecting that top line to be stuck on 5, not 0): image

And this is going by the information near the top of https://manual.gamemaker.io/monthly/en/#t=GameMaker_Language%2FGML_Reference%2FAsset_Management%2FAudio%2Faudio_sound_get_track_position.htm

YYDan commented 2 weeks ago

We need to confirm if this is actually intended to be working for assets, or whether this is simply a manual content bug.

toby-yoyo commented 2 weeks ago

We need to confirm if this is actually intended to be working for assets, or whether this is simply a manual content bug.

The behaviour here is intentional:

I think the first point in the manual is trying to express the second point in this comment but could be worded more clearly.

Anyway, I think this issue has been reinterpreted from what the original poster reported. As I understand it, their complaint is that the current playback position of an instance does not update at the same rate on Linux as it does on other platforms. I believe that this is likely down to the audio mix on Linux being less frequent than on other platforms (leading to the context information updating more slowly). The reason it is this way is down to the interface(s) sitting between our own audio context and the output device, and though not a small task we would benefit from dealing with it.

protogenposting commented 2 weeks ago

We need to confirm if this is actually intended to be working for assets, or whether this is simply a manual content bug.

The behaviour here is intentional:

  • The offset argument to any playback function overrides the asset-level offset for that particular sound instance only.
  • The asset-level offset dictates the start offset of that asset for future sound instances, given that it isn't overridden at the call site.
  • The asset-level offset is set by passing an asset index into audio_sound_set_track_position.
  • As no asset-level offset was set, it defaults to zero and so the correct value is being shown.

I think the first point in the manual is trying to express the second point in this comment but could be worded more clearly.

Anyway, I think this issue has been reinterpreted from what the original poster reported. As I understand it, their complaint is that the current playback position of an instance does not update at the same rate on Linux as it does on other platforms. I believe that this is likely down to the audio mix on Linux being less frequent than on other platforms (leading to the context information updating more slowly). The reason it is this way is down to the interface(s) sitting between our own audio context and the output device, and though not a small task we would benefit from dealing with it.

Yeah that's the issue I'm having