Skip to content

9647 playback cannot be resumed - #9690

Merged
luapmartin merged 8 commits into
audacity:masterfrom
luapmartin:luapmartin/9647-playback-cannot-be-resumed
Oct 22, 2025
Merged

luapmartin merged 8 commits into
audacity:masterfrom
luapmartin:luapmartin/9647-playback-cannot-be-resumed

Conversation

@luapmartin

@luapmartin luapmartin commented Oct 17, 2025 •

Copy link
Copy Markdown
Contributor

Resolves: #9647

metering only enabled when in stop mode

  • I signed CLA
  • The title of the pull request describes an issue it addresses
  • If changes are extensive, then there is a sequence of easily reviewable commits
  • Each commit's message describes its purpose and effects
  • There are no behavior changes unnecessary for the stated purpose of the PR

Recommended:

  • Each commit compiles and runs on my machine without known undesirable changes of behavior

QA:

  • With mic metering enabled, check the input monitoring option: input monitoring should work

  • Autobot test cases have been run

@luapmartin luapmartin self-assigned this Oct 17, 2025
@luapmartin
luapmartin marked this pull request as ready for review October 17, 2025 12:09
Comment thread au3/libraries/lib-audio-io/AudioIO.cpp Resolved
Comment thread au3/libraries/lib-audio-io/AudioIO.cpp Resolved
Comment thread au3/libraries/lib-audio-io/AudioIO.cpp Resolved
@luapmartin
luapmartin force-pushed the luapmartin/9647-playback-cannot-be-resumed branch from 4dda4c9 to b239474 Compare October 20, 2025 12:43
@luapmartin
luapmartin force-pushed the luapmartin/9647-playback-cannot-be-resumed branch from b239474 to 2493f8c Compare October 20, 2025 13:14
Comment thread au3/libraries/lib-audio-io/AudioIO.cpp Resolved
}
}
}
gAudioIO->StopMonitoring(); // TODO Inject and use IAudioEngine instead

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't venture trying to injecting an interface defined in Au4:

  • looks like you'd have to solve an circular dependency problem,
  • although at the moment in au3audio, IAudioEngine will probably have to emancipate from au3 when its implementation is another audio engine.
  • you might be opening a Pandora box: AudioIO is used as such in plenty of places. Where to stop?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there much less direct AudioIO access thanks to this PR, at some point there will be none.
let's see if we find an alternative to the injection (maybe with actions or something)

@saintmatthieu saintmatthieu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a problem with the recent changes in the body of Au3AudioInput::audioEngineShouldBeMonitoring. Once that is addressed, the PR could move to QA where I'm concerned, the rest being minor comments.
Thanks for the clean-ups!

@luapmartin
luapmartin force-pushed the luapmartin/9647-playback-cannot-be-resumed branch from 58d6885 to 1597667 Compare October 21, 2025 08:24

@saintmatthieu saintmatthieu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll wait for my comment about the mutable to be addressed or to be explained why it's necessary before I approve. I don't think that should block this ticket from going to QA, though, please feel free.

@luapmartin
luapmartin force-pushed the luapmartin/9647-playback-cannot-be-resumed branch from 1597667 to 91468c4 Compare October 21, 2025 09:54
Comment thread src/au3audio/iaudioengine.h Outdated
@@ -22,7 +22,12 @@ class IAudioEngine : MODULE_EXPORT_INTERFACE
virtual bool isBusy() const = 0;

virtual int startStream(const TransportSequences& sequences, double startTime, double endTime, double mixerEndTime, // Time at which mixer stops producing, maybe > endTime
const AudioIOStartStreamOptions& options) = 0;
AudacityProject& project, bool isDefaultPlayTrackPolicy, int projectRate) = 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd keep the sample rate a double: even if I don't think there's real use for it at project level, it still can be used in DSP and then then we'd keep consistent with the type of AudioIO::GetRate().

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming: it's not correct that it's the project rate. I think that's the rate that we'll ask to PortAudio, right? I'd say playbackRate or playbackSampleRate.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optionRate?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's the value coming from ProjectRate::Get(project).GetRate(); that's why I named that projectRate as it's the one the project is setup with then yes this rate is packed into the playback options (sometimes is just the rate of one track see au3record code, other time it's project rate) those options will be created by the audioengine and sent to audioIO then internally audioIO will use those options to configure the playback end eventually setup the PortAudio stream which will negotiate this rate for setting up the playback stream

@saintmatthieu saintmatthieu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename the projectRate argument as commented or explain why it is correct this way before merging. Otherwise LGTM.

9647 move Meters handling in AudioIOBase

9647 cleanup Meters handling in AudioIO
9647 make sure monitoring update when opening the input popup

9647 make sure every stop from the audio engine waits for engine to stop

affects not only Au3Player::stop() but also the missing wait in Au3Record::stop()

9647 use audioEngine instead of AudioIO

9647 rename shouldStartMonitoring as audioEngineShouldBeMonitoring

9647 clarify Monitoring logic
…n audioEngineShouldBeMonitoring

9647 remove wrongly added emit

9647 typos

9647 some const correctness

9647 check engine when starting Monitoring mPortStreamV19 is checked inside IsMonitoring() and the stream token in IsBusy()
…back there too.

getting rid of MonitoringChangeReason
re-adjust the audioEngineShouldBeMonitoring and updateAudioEngineMonitoring logic
store inputMonitoring in AudioIOStartStreamOptions
9647 use double, rename projectRate

9647 fix formating and some const correctness cleanup on audioengine

9647 fix monitoring not updating when already metering

9647 remove mutable for the inputMonitoring AudioIOBase member

9647 const correctness

9647 remove useless emits
@luapmartin
luapmartin force-pushed the luapmartin/9647-playback-cannot-be-resumed branch from e9add22 to 91a2cc0 Compare October 22, 2025 10:52
@luapmartin
luapmartin merged commit 18ed7a8 into audacity:master Oct 22, 2025
@luapmartin
luapmartin deleted the luapmartin/9647-playback-cannot-be-resumed branch February 26, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Playback Cannot be Resumed Switching vertical playback meter's visibility on/off can be a bit laggy on slower machines

3 participants