Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hum when volume is turned down #1

Open
foxacid opened this issue Aug 14, 2020 · 2 comments
Open

Hum when volume is turned down #1

foxacid opened this issue Aug 14, 2020 · 2 comments

Comments

@foxacid
Copy link

foxacid commented Aug 14, 2020

Hey there and thanks for sharing this project!

I am experiencing some issues with the volume control and play state. When the volume is turned low past the threshold, there's a grainy hum coming from the speaker while playback is not stopped.

Also, while STATE.DAT is being updated, the player does not continue where it left off after a power cycle but instead plays the first track in the first folder.

Any ideas?

@foxacid
Copy link
Author

foxacid commented Oct 4, 2020

Ok, so both issues seem to be related. I deleted STATE.DAT from the SD card (it was a 1.1 MB file?) which successfully eliminated the hum at minimum volume/standby. The file got recreated automatically but the play state is still not read correctly, i.e. when in standby mode playback simply continues in the background and after a battery cycle it always starts at track 1 in playlist 0.

I'm having trouble understanding the writePlayState and readPlayState functions but I'm puzzled why more than one playstate is written to the card. Shouldn't it be a single playstate that is updated every ten seconds?

@foxacid
Copy link
Author

foxacid commented Oct 4, 2020

I've uploaded the sketch from commit 2e54242 and the hum is gone. It is related to the changes in the handleVolume() function. Of course there's no 'stop at low volume' functionality anymore but I've simply repurposed the forward button and turned it into a pause button:

// Toggle playback (pause/resume)
void pause() {
  if (! musicPlayer.paused()) {
    musicPlayer.pausePlaying(true);
  } else { 
    musicPlayer.pausePlaying(false);
  }
}

The EEPROM stored playback resume from that earlier commit also works without a hitch. It's missing the track position marker functionality but starting from the beginning of a track is perfectly fine.

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

No branches or pull requests

1 participant