path: root/apps/audio_thread.c
AgeCommit message (Collapse)AuthorFilesLines
2017-12-12Get voice event out of playback.cMichael Sevakis1-0/+11
Purpose: A step in removing all voice references from playback code and prelude to other changes. Change-Id: Ic3ad7f7a33b979693e18a3456ced37eb1d2281a4
2014-02-02talk: Remove superflous call to talk_init().Thomas Martitz1-4/+0
talk_init() is called by settings_apply() already which is called on boot. Doing it again means loading the voicefile a second time which isn't necessary. Change-Id: I4decd16401e63bf87338d3163c99d06d69fe3a3c
2013-06-29SWCODEC Audio: Add some INIT_ATTR's to get a few bytes back.Michael Sevakis1-1/+1
Change-Id: Ie7b04ecf3b3535e0ed45a6e0e8d81af89e38378e
2013-06-30Update software recording engine to latest codec interface.Michael Sevakis1-1/+13
Basically, just give it a good rewrite. Software codec recording can be implemented in a more straightforward and simple manner and made more robust through the better codec control now available. Encoded audio buffer uses a packed format instead of fixed-size chunks and uses smaller data headers leading to more efficient usage. The greatest benefit is with a VBR format like wavpack which needs to request a maximum size but only actually ends up committing part of that request. No guard buffers are used for either PCM or encoded audio. PCM is read into the codec's provided buffer and mono conversion done at that time in the core if required. Any highly-specialized sample conversion is still done within the codec itself, such as 32-bit (wavpack) or interleaved mono (mp3). There is no longer a separate filename array. All metadata goes onto the main encoded audio buffer, eliminating any predermined file limit on the buffer as well as not wasting the space for unused path queue slots. The core and codec interface is less awkward and a bit more sensible. Some less useful interface features were removed. Threads are kept on narrow code paths ie. the audio thread never calls encoding functions and the codec thread never calls file functions as before. Codecs no longer call file functions directly. Writes are buffered in the core and data written to storage in larger chunks to speed up flushing of data. In fact, codecs are no longer aware of the stream being a file at all and have no access to the fd. SPDIF frequency detection no longer requires a restart of recording or plugging the source before entering the screen. It will poll for changes and update when stopped or prerecording (which does discard now-invalid prerecorded data). I've seen to it that writing a proper header on full disk works when the format makes it reasonably practical to do so. Other cases may have incorrect data sizes but sample info will be in tact. File left that way may play anyway. mp3_enc.codec acquires the ability to write 'Info' headers with LAME tags to make it gapless (bonus). Change-Id: I670685166d5eb32ef58ef317f50b8af766ceb653 Reviewed-on: Reviewed-by: Michael Sevakis <> Tested-by: Michael Sevakis <>
2013-05-31Just init audio thread event with Q_NULL instead of SYS_TIMEOUT.Michael Sevakis1-1/+1
What was I thinking? Anyway, it's a little nicer and it's reserved so shouldn't end up as a case value anywhere. Change-Id: If745c24951518608e3f4fc51f7419ef07d7cf2ac
2013-05-31Some corrections after 5857c44.Michael Sevakis1-4/+11
Playback needs to receive a couple of settings-related messages even when not playing. Put the message reply back where it was when loading an encoder for recording. Change-Id: I8cc80f46e42a0afd119991d698510e1ebef38ead
2013-05-31Refactor audio thread to run both recording and playback.Michael Sevakis1-0/+162
Eliminates the pcmrec thread and keeps playback and recording engine operation mutually-exclusive. audio_thread.c contains the audio thread which branches to the correct engine depending upon the request. It also handles the main audio initialization. Moves pcm_init into main.c just before dsp_init because I don't want that one in audio_init in the new file. (Also makes revision df6e1bc pointless ;) Change-Id: Ifc1db24404e6d8dd9ac42d9f4dfbc207aa9a26e1