Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Clean up Audio code, Add Mono/Stereo switch #20

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

faux123
Copy link
Contributor

@faux123 faux123 commented May 30, 2024

for SX20 or other mono speaker devices, allow user to switch between stereo and mono for better experience audio experience. This PR MUST go with the corresponding PR on the distribution side.

Fix audio stream being held during blank screensaver
the audio streams are constantly being consumed and active thus leading
to 10-25% additional CPU resources consumed. Release AudioManager when
blank screen is active to let those audiostreams go into idle/suspend so the
system can go into proper idle. This saves another 20-25% battery drain during
screensaver event.

Fixes # (issue)

mono speaker not getting audio from left channel from emulators

Type of change

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested Locally?

Tested with PowKiddy SX20, PowKiddy RGB30 and PowKiddy X55 by switch between mono and stereo

Test Configuration:

  • Build OS: latest dev pull
  • Docker (Y/N): N
  • ROCKNIX Branch: latest dev

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

Pull Request Template

@sydarn
Copy link
Collaborator

sydarn commented Jun 8, 2024

Hi faux123, sorry for the delay. Could you separate the audio changes from the performance optimizations?

@faux123 faux123 changed the title Clean up Audio code, Add Mono/Stereo switch and Add energy efficient rendering loop Clean up Audio code, Add Mono/Stereo switch Jun 9, 2024
@faux123
Copy link
Contributor Author

faux123 commented Jun 9, 2024

Hi faux123, sorry for the delay. Could you separate the audio changes from the performance optimizations?

Done. Please review and merge. Thanks.

@sydarn
Copy link
Collaborator

sydarn commented Jun 9, 2024

The sound is barely audible from rgb30 speakers at max volume.

@faux123
Copy link
Contributor Author

faux123 commented Jun 9, 2024

this needs the corresponding PR from distribution, as the platforms have issue with master audio volume.

@sydarn
Copy link
Collaborator

sydarn commented Jun 9, 2024

That's how I tested as well, I did:

gh pr checkout 260
git rebase dev
# pointed ES package.mk to your commit

@sydarn
Copy link
Collaborator

sydarn commented Jun 9, 2024

I updated a current flash, if it is due to that. If it only works on fresh flash you could to put corresponding changes in post-update script so people that update gets the necessary changes.

@@ -545,7 +545,7 @@ void VideoVlcComponent::startVideo()
mMedia = libvlc_media_new_path(mVLC, path.c_str());
if (mMedia)
{
// use : vlc �long-help
// use : vlc �long-help
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you remove this change?

//auto ss_video_mute = std::make_shared<SwitchComponent>(mWindow);
//ss_video_mute->setState(Settings::getInstance()->getBool("ScreenSaverVideoMute"));
//addWithLabel(_("MUTE VIDEO AUDIO"), ss_video_mute);
//addSaveFunc([ss_video_mute] { Settings::getInstance()->setBool("ScreenSaverVideoMute", ss_video_mute->getState()); });
Copy link
Collaborator

Choose a reason for hiding this comment

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

Without any information about commented lines I don't find it very useful to keep them. Can you remove the lines?

// ctlStopMusic->setState(Settings::getInstance()->getBool("EnableSounds"));
// addWithLabel(_("STOP MUSIC ON SCREENSAVER"), ctlStopMusic);
// addSaveFunc([ctlStopMusic] { Settings::getInstance()->setBool("EnableSounds", ctlStopMusic->getState()); });
// }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Without any information about commented lines I don't find it very useful to keep them. Can you remove the lines?

@sydarn
Copy link
Collaborator

sydarn commented Jun 14, 2024

Do I under stand correctly that with these changes, that background music, sounds from video and navigation sounds is now all of them or none of them?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants