summaryrefslogtreecommitdiff
path: root/src/tangara/audio/audio_fsm.cpp
AgeCommit message (Collapse)Author
2025-04-11fix premature pause at end of last track of queueBe
The SetTrack event is sent when *decoding* finishes, not when *playback* finishes so the decoder can start buffering the next track in advance of its playback to ensure gapless playback. Clearing StreamCues causes Playback::react(const internal::StreamHeartbeat& ev) to transit the Playback FSM to Standby, which sets the IAudioOutput to stop reading from the output buffer. Thus, clearing StreamCues in response to the SetTrack event paused playback with the end of the track stuck waiting in the output buffer. When a new queue was loaded and started playing, the end of the previous track would be played before the new track was played. Fixes https://codeberg.org/cool-tech-zone/tangara-fw/issues/313
2025-04-01Quick fix unmount requests getting dropped when there's no sd cardjacqueline
2025-03-05Allow manually unmounting the SD cardayumi
2025-02-11Only change output mode if the new output mode is differentailurux
2025-02-10Change output mode when bluetooth connects/disconnectsailurux
2025-01-07Improvements to the queue for shuffling/playing all (#170)ailurux
Queue now has a separate 'ready' property to indicate it's ready to be used, which is independent from whether it's still loading tracks in. This also improves the response time for shuffling all tracks (we will initially pick a random track in the first 100 tracks whilst the rest of the tracks are loading). This should also fix issues where one song will start playing and then repeat itself when the queue finishes loading, and hopefully solve #160 as well (though I couldn't actually repro this myself). Co-authored-by: jacqueline <me@jacqueline.id.au> Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/170 Reviewed-by: cooljqln <cooljqln@noreply.codeberg.org> Co-authored-by: ailurux <ailuruxx@gmail.com> Co-committed-by: ailurux <ailuruxx@gmail.com>
2024-12-29suspend playback when headphones disconnectedClayton Craft
I think this is what most folks would expect to happen if BT is disconnected/disabled and the headphones are removed. Also, I think(?) this fixes one situation where the device doesn't idle/ sleep when folks would expect it to (not connected to headphones or bt).
2024-12-10Audio FSM should transit to Standby when BT disconnectailurux
2024-10-08Fixed issue with saving positions, and only auto-resume long-form contentailurux
2024-09-24Record play_count in TrackData, incrementing it when tracks finishjacqueline
2024-09-19Fix commented issuesailurux
2024-09-17Implements seeking to saved position for tracksailurux
2024-09-17Merge branch 'main' into daniel/persistent-positionsailurux
2024-09-13Save positions over 5 minutes, every minuteailurux
2024-09-12WIP: Fixed errors, cleanupailurux
2024-09-12WIP: Add last_position field to track data and start on implementationailurux
2024-09-12Pause and unpause the current audio output in response to TTSjacqueline
2024-09-09Play basic wav files in response to tts promptsjacqueline
It's currently quite limited (no stereo or sample rate conversion, multiple messages clobber each other, only plays if music is playing), but we're getting there!
2024-09-09Merge branch 'main' into jqln/ttsjacqueline
2024-08-28clang-formatjacqueline
2024-08-28Handle the loading state whilst appending many tracks betterjacqueline
1) Update the queue length periodically so that the user can see we're working 2) Clear any previous track and display "loading..." instead
2024-08-28Timeout when writing output samples throughout the audio pipelinejacqueline
This allows the audio pipeline to remain responsive even when the drain buffer has completely filled. This in turn means that you now see the track info in the 'now playing' screen change if the current track changes whilst you are paused. Since I was fucking around a lot in the audio processor anyway, I also added mono->stereo expansion so that playing mono tracks on Bluetooth no longer destroys your ears.
2024-08-26Switch output mode to headphones when plugged inailurux
2024-08-12Make FileGatherer shaped more like a normal iteratorjacqueline
2024-07-30Advance the queue when the current track fails to startjacqueline
2024-07-19WIP initial tts player wiringjacqueline
2024-07-16daniel/playlist-queue (#83)ailurux
Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/83 Reviewed-by: cooljqln <cooljqln@noreply.codeberg.org> Co-authored-by: ailurux <ailuruxx@gmail.com> Co-committed-by: ailurux <ailuruxx@gmail.com>
2024-07-11WIP improve bluetooth api and settings screenjacqueline
2024-07-11Break FatfsStreamFactory's dep on ServiceLocatorjacqueline
2024-07-09Break FatfsStreamFactory's dep on ServiceLocatorjacqueline
2024-07-09Give PcmBuffer pairs a name, and wire them up in the audio stackjacqueline
2024-06-06daniel/bluetooth-avrc (#80)ailurux
Have a squizzy and lemme know if any issues @cooljqln 🐝 Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/80 Co-authored-by: ailurux <ailuruxx@gmail.com> Co-committed-by: ailurux <ailuruxx@gmail.com>
2024-05-31Introduce a PcmBuffer abstraction for handling source drainingjacqueline
2024-05-16Add a stream source that generates a sine wavejacqueline
2024-05-09Fix playback after restoring queue on bootjacqueline
2024-05-08Count samples going in and out of the drain bufferjacqueline
This is a more accurate way of knowing which track is playing when, and also simplifies a lot of fragile logic in audio_fsm
2024-05-07Improve decoder's interface to accept streamsjacqueline
2024-05-03Respond to sd card mounts and unmounts within luajacqueline
Includes no longer blocking the main menu on an sd card being inserted!!
2024-05-02move driver includes into a subdir as welljacqueline
2024-05-02start moving include files into subdirsjacqueline
2024-05-02WIP merge cyclically dependent components into one big componentjacqueline