summaryrefslogtreecommitdiff
path: root/apps/recorder
AgeCommit message (Collapse)Author
2016-04-01Fix FS#12981 JPEG decoding problem when entropy data starts with FFBoris Gjenero
This changes JPEG fill and invalid byte handling to be like mozjpeg, and bases entropy data start on SOS marker location. Thanks to Stefan Waldmann and Dean Tersigni for reporting. Change-Id: I3c79cc6ac8d714fdc75c12b57ba427d611c99519 Chaange-Id: Ibc7c17d38d5be63642bdaf6adfd6acc2a6cf4450
2016-01-25Replace SAMSUNG_YH920_PAD with YH92XSebastian Leonhardt
seems more logical to me, and is more consistent, since "SAMSUNG_YH92X_PAD" is already used in the tex files. Change-Id: Ie9a9d850ea86155a7dcf86c88a22a420a10a3837
2014-10-08YH820: Add a forgotten define in aa8ba60.Szymon Dziok
Change-Id: I89a0c21f2ca09f65a4d0b3e06b4b8fed3c07bef6
2014-10-08YH820/YH92X: Properly enable morse input.Szymon Dziok
Change-Id: I6a35d64d0859b7ef429919c260a69974d6fdfafb
2014-08-30Rewrite filesystem code (WIP)Michael Sevakis
This patch redoes the filesystem code from the FAT driver up to the clipboard code in onplay.c. Not every aspect of this is finished therefore it is still "WIP". I don't wish to do too much at once (haha!). What is left to do is get dircache back in the sim and find an implementation for the dircache indicies in the tagcache and playlist code or do something else that has the same benefit. Leaving these out for now does not make anything unusable. All the basics are done. Phone app code should probably get vetted (and app path handling just plain rewritten as environment expansions); the SDL app and Android run well. Main things addressed: 1) Thread safety: There is none right now in the trunk code. Most of what currently works is luck when multiple threads are involved or multiple descriptors to the same file are open. 2) POSIX compliance: Many of the functions behave nothing like their counterparts on a host system. This leads to inconsistent code or very different behavior from native to hosted. One huge offender was rename(). Going point by point would fill a book. 3) Actual running RAM usage: Many targets will use less RAM and less stack space (some more RAM because I upped the number of cache buffers for large memory). There's very little memory lying fallow in rarely-used areas (see 'Key core changes' below). Also, all targets may open the same number of directory streams whereas before those with less than 8MB RAM were limited to 8, not 12 implying those targets will save slightly less. 4) Performance: The test_disk plugin shows markedly improved performance, particularly in the area of (uncached) directory scanning, due partly to more optimal directory reading and to a better sector cache algorithm. Uncached times tend to be better while there is a bit of a slowdown in dircache due to it being a bit heavier of an implementation. It's not noticeable by a human as far as I can say. Key core changes: 1) Files and directories share core code and data structures. 2) The filesystem code knows which descriptors refer to same file. This ensures that changes from one stream are appropriately reflected in every open descriptor for that file (fileobj_mgr.c). 3) File and directory cache buffers are borrowed from the main sector cache. This means that when they are not in use by a file, they are not wasted, but used for the cache. Most of the time, only a few of them are needed. It also means that adding more file and directory handles is less expensive. All one must do in ensure a large enough cache to borrow from. 4) Relative path components are supported and the namespace is unified. It does not support full relative paths to an implied current directory; what is does support is use of "." and "..". Adding the former would not be very difficult. The namespace is unified in the sense that volumes may be specified several times along with relative parts, e.g.: "/<0>/foo/../../<1>/bar" :<=> "/<1>/bar". 5) Stack usage is down due to sharing of data, static allocation and less duplication of strings on the stack. This requires more serialization than I would like but since the number of threads is limited to a low number, the tradoff in favor of the stack seems reasonable. 6) Separates and heirarchicalizes (sic) the SIM and APP filesystem code. SIM path and volume handling is just like the target. Some aspects of the APP file code get more straightforward (e.g. no path hashing is needed). Dircache: Deserves its own section. Dircache is new but pays homage to the old. The old one was not compatible and so it, since it got redone, does all the stuff it always should have done such as: 1) It may be update and used at any time during the build process. No longer has one to wait for it to finish building to do basic file management (create, remove, rename, etc.). 2) It does not need to be either fully scanned or completely disabled; it can be incomplete (i.e. overfilled, missing paths), still be of benefit and be correct. 3) Handles mounting and dismounting of individual volumes which means a full rebuild is not needed just because you pop a new SD card in the slot. Now, because it reuses its freed entry data, may rebuild only that volume. 4) Much more fundamental to the file code. When it is built, it is the keeper of the master file list whether enabled or not ("disabled" is just a state of the cache). Its must always to ready to be started and bind all streams opened prior to being enabled. 5) Maintains any short filenames in OEM format which means that it does not need to be rebuilt when changing the default codepage. Miscellaneous Compatibility: 1) Update any other code that would otherwise not work such as the hotswap mounting code in various card drivers. 2) File management: Clipboard needed updating because of the behavioral changes. Still needs a little more work on some finer points. 3) Remove now-obsolete functionality such as the mutex's "no preempt" flag (which was only for the prior FAT driver). 4) struct dirinfo uses time_t rather than raw FAT directory entry time fields. I plan to follow up on genericizing everything there (i.e. no FAT attributes). 5) unicode.c needed some redoing so that the file code does not try try to load codepages during a scan, which is actually a problem with the current code. The default codepage, if any is required, is now kept in RAM separarately (bufalloced) from codepages specified to iso_decode() (which must not be bufalloced because the conversion may be done by playback threads). Brings with it some additional reusable core code: 1) Revised file functions: Reusable code that does things such as safe path concatenation and parsing without buffer limitations or data duplication. Variants that copy or alter the input path may be based off these. To do: 1) Put dircache functionality back in the sim. Treating it internally as a different kind of file system seems the best approach at this time. 2) Restore use of dircache indexes in the playlist and database or something effectively the same. Since the cache doesn't have to be complete in order to be used, not getting a hit on the cache doesn't unambiguously say if the path exists or not. Change-Id: Ia30f3082a136253e3a0eae0784e3091d138915c8 Reviewed-on: http://gerrit.rockbox.org/566 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested: Michael Sevakis <jethead71@rockbox.org>
2014-06-21Fix some build errors and warnings.Thomas Martitz
Change-Id: I149c00fc6ba47d5134ad4f74c364bffd24079824
2014-06-21lcd-24bit: Introduce a 24-bit mid-level LCD driverThomas Martitz
With LCD driver all calculation will be performed on RGB888 and the hardware/OS can display from our 24bit framebuffer. It is not yet as performance optimized as the existing drivers but should be good enough.The vast number of small changes is due to the fact that fb_data can be a struct type now, while most of the code expected a scalar type. lcd-as-memframe ASM code does not work with 24bit currently so the with 24bit it enforces the generic C code. All plugins are ported over. Except for rockpaint. It uses so much memory that it wouldnt fit into the 512k plugin buffer anymore (patches welcome). Change-Id: Ibb1964545028ce0d8ff9833ccc3ab66be3ee0754
2014-01-11bmp loader: Fix loading of monochrome/greyscale BMPs with newer headers.Thomas Martitz
The code expected the color table at offset 54 (14+size of BITMAPINFOHEADER), which was after the BITMAPINFOHEADER header. However, newer BITMAPINFOHEADER versions exist which have more fields before the color table. Fix this by explicitely seeking to the color table. Change-Id: If1dfc77e7485e5a9e0bc0e7f577152da9358bd71
2014-01-05bmp.c: Undo debug stuff that got in by accident.Thomas Martitz
Change-Id: Ic37658ab8d81405e28a4097d38785900fd0951cd
2014-01-05Do not include kernel.h in system.h.Thomas Martitz
system.h doesn't need it on its own and this change makes it less dependant on Rockbox internals. Change-Id: I4e1e4108a52a7b599627a829204eb82b392fc6d6
2014-01-05Revert "Fix data abort introduced by ef92ed4a."Thomas Martitz
This reverts commit 61a096499b72f82dd8efc782e30cfeb1a31ef400. The original issue was caused by a new structure member which caused bmp_args::buf to be unaligned for 2-byte reads. Enforcing that alignment should be the faster fix. Aligning to cache (while at it) should improve bmp loading times even more. Change-Id: I58a2caaf08c0ce46e2fb9666de628a30a36ea5f4
2014-01-04Fix data abort introduced by ef92ed4a.Frank Gevaerts
Change-Id: I3e1bf2434238835d2d2b8f5f2a8f44b0df97b33d
2013-12-24recording: Fix sloppy return value check. This caused an OOM panic.Thomas Martitz
Change-Id: I30bbc5623d81ad7cbbee52a439fb5909af2761b7
2013-12-23fix some reds.Thomas Martitz
Change-Id: Iecb1305dbd1519434e0f476d2199e728b96091f9
2013-12-23playback,talk: Share audiobuffer via core_alloc_maximum().Thomas Martitz
This fixes the radioart crash that was the result of buffering.c working on a freed buffer at the same time as buflib (radioart uses buffering.c for the images). With this change the buffer is owned by buflib exclusively so this cannot happen. As a result, audio_get_buffer() doesn't exist anymore. Callers should call core_alloc_maximum() directly. This buffer needs to be protected as usual against movement if necessary (previously it was not protected at all which cased the radioart crash), To get most of it they can adjust the willingness of the talk engine to give its buffer away (at the expense of disabling voice interface) with the new talk_buffer_set_policy() function. Change-Id: I52123012208d04967876a304451d634e2bef3a33
2013-12-22Fix errors introduced by a62bd92.Thomas Martitz
Change-Id: I3f65ca5347d08e1b77196c73ccb3a0951f14c850
2013-12-22Fix warning and re-order code a bit.Thomas Martitz
Change-Id: I1d733b3d0bd17cc541218f9a2b7712712ad314dd
2013-12-22Support GIMP bmp files.Thomas Martitz
Change-Id: I7380ceeaf696b67e1641d24e7b932e3d74770932
2013-07-09Swap over a position of cursor while reaching the end of filename in keyboardRoman
In sansa clip + with virtual keyboard you can write/rename a stuff and move your cursor in the filename field. But while your cursor reaches the end/start of filename it just blocks the movement of cursor and beeps if you enabled the "Voice Menu" feature. This patch swaps over cursor to the start/end of filename instead of just blocking movement. Change-Id: I37450df062df60ef4c0d747c13e448d0adbde05b Reviewed-on: http://gerrit.rockbox.org/503 Reviewed-by: Michael Giacomelli <giac2000@hotmail.com>
2013-07-09SWCODEC recording: Boost CPU frequency before doing flush on stopMichael Sevakis
If CPU is not boosted for some reason already, then the stop flush can take longer than it really ought to. Change-Id: I0572cc83067749e9945b3eb825f976db21d914f9
2013-07-0619b289a somehow missed one last LANG_RECORDING_FREQUENCY.Michael Sevakis
Did grep fail me? Change-Id: Id8254aa542d57204e265ef06829b4e034f032137
2013-06-30Temporarily disable keyclick in recording screen.Michael Sevakis
Those who have keyclick enabled and are really eagar to record upon boot can get the samplerate messed up because who gets to set the sample rate last (recording or mixer) is not currently deterministic. Change-Id: Icc43ed789cf23f928ca49657cb146445b0c558cb
2013-06-29Fix strlcpy warnings in 4888131.Michael Sevakis
Change-Id: Ibd355ee1cf39d1a4b07def94634f0316468bf727
2013-06-30Update software recording engine to latest codec interface.Michael Sevakis
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: http://gerrit.rockbox.org/493 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested-by: Michael Sevakis <jethead71@rockbox.org>
2013-06-30Fix some whitespace in files changed in following commit.Michael Sevakis
Change-Id: Ie3f43e43076e0dcae9a10f1b0b9e4698b398acee Reviewed-on: http://gerrit.rockbox.org/492 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested-by: Michael Sevakis <jethead71@rockbox.org>
2013-05-31Some corrections after 5857c44.Michael Sevakis
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 Sevakis
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
2013-05-30pcm_record: Track initialization stateMichael Sevakis
It should not access audio hardware and change settings unless it has been initialized first and given control of it. Change-Id: I5004602d7caa604ded751f6838b792d1ff24b3fb
2013-02-12bitmap drawing: Negate alpha channel to match alpha information format of ↵Thomas Martitz
font files. The comment about the format was actually incorrect. The alpha information is now negated during conversion to native format, according to the corrected comment. Change-Id: Ifdb9ffdf9b55e39e64983eec2d9d60339e570bd9
2012-05-02Clean up peak calculating code.Michael Sevakis
Mixer needn't keep peak data around that will never be used. Just pass pcm_peaks structure to it instead of allocating for every channel. Plugin API becomes incompatible. vu_meter digital mode was still using global peak calculation; switch it to playback channel like the rest. Remove some accumulated soil peaks inside pcm.c and make it more generic. Change-Id: Ib4d268d80b6a9d09915eea1c91eab483c1a2c009
2012-04-22Simplify warning suppression for unused argumentBertrik Sikken
Change-Id: If8d6e3669dca3ba8351e949ef901809e87f94366
2012-03-03Revise the PCM callback system after adding multichannel audio.Michael Sevakis
Additional status callback is added to pcm_play/rec_data instead of using a special function to set it. Status includes DMA error reporting to the status callback. Playback and recording callback become more alike except playback uses "const void **addr" (because the data should not be altered) and recording uses "void **addr". "const" is put in place throughout where appropriate. Most changes are fairly trivial. One that should be checked in particular because it isn't so much is telechips, if anyone cares to bother. PP5002 is not so trivial either but that tested as working. Change-Id: I4928d69b3b3be7fb93e259f81635232df9bd1df2 Reviewed-on: http://gerrit.rockbox.org/166 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested-by: Michael Sevakis <jethead71@rockbox.org>
2011-12-20AGC: respect gain steps defined in audiohw_settings[]Marcin Bukat
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31387 a1c6a512-1295-4272-9138-f99709370657
2011-12-19Add more INIT_ATTR and add config.h includes to header files with INIT_ATTR.Boris Gjenero
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31370 a1c6a512-1295-4272-9138-f99709370657
2011-12-19Fix bitmap scaling for Coldfire. Closes FS#12411.Andree Buschmann
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31366 a1c6a512-1295-4272-9138-f99709370657
2011-12-17Add const to global pointers to strings.Boris Gjenero
When a global pointer is not declared as constant, gcc will put it in memory. Getting the address of the string it points to requires loading the address of the pointer and then loading the pointer. When the pointer is declared constant, the address of the string is loaded directly. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31345 a1c6a512-1295-4272-9138-f99709370657
2011-12-14FS#12378 : Remove various unused code, and comment out some unused code and ↵Boris Gjenero
data for reference or future use. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31256 a1c6a512-1295-4272-9138-f99709370657
2011-12-11Closing recording before initializing it the first time isn't needed and may ↵Michael Sevakis
also interfere with playback. Remove audio_close_recording call upon first entering recording screen. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31209 a1c6a512-1295-4272-9138-f99709370657
2011-12-08Move the PCMREC_E/W_* defines back to pcm_record.h because they're part of ↵Michael Sevakis
the recording engine interface. Leave the low-level DMA error defines in pcm.h. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31184 a1c6a512-1295-4272-9138-f99709370657
2011-12-08Add a second boost condition to the recording PCM buffer to boost the CPU ↵Michael Sevakis
when 75% full or more. This is especially important for small memory when the 1-second condition frequency cannot be reached. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31183 a1c6a512-1295-4272-9138-f99709370657
2011-12-08AS3525v1/v2:Michael Sevakis
Fix problems with volume of recorded material by converting 14-bit samples to 16-bit. Remove duplicate samples from recorded data and support proper samplerate since ADC runs 1/2 the codec clock. Support monitoring mono on both output channels by feeding data manually to I2SOUT under the right conditions. DMA is no longer used for recording since frames must be processed as described above but it does allow full-duplex audio. Miscellaneous change includes a proper constant (HW_SAMPR_DEFAULT) to reset the hardware samplerate when recording is closed. PP5024 and AS3525 have different default recording rates (22kHz and 44kHz respectively) but both have half-speed ADC. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31180 a1c6a512-1295-4272-9138-f99709370657
2011-11-29Sansa Connect: Add keymap for YesNo dialog and keyboardTomasz Moń
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31090 a1c6a512-1295-4272-9138-f99709370657
2011-11-29FS#12412 : Delete old buffer allocation code which has been replaced by ↵Boris Gjenero
core_alloc, and move buffer setup code to core_alloc.c git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31088 a1c6a512-1295-4272-9138-f99709370657
2011-11-15Use buflib for all skin engine allocations.Jonathan Gordon
Massive thanks to Michael Chicoine and other testers for finding the early bugs. This removes all skin memory limitations git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30991 a1c6a512-1295-4272-9138-f99709370657
2011-11-11Handle 32bit bitmaps with all-zero alpha channel as fully opaque.Thomas Martitz
This is what gimp does when opening such a file. Tt saves the alpha channel with all-0xff, but other programs might use 0x00. As a fully transparent image doesn't make sense this should be OK. Also split the 32bit and 24bit case in the bmp reader, they're sufficiently different. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30968 a1c6a512-1295-4272-9138-f99709370657
2011-11-11Document the internal alpha channel format better, and fixes for 32bit alpha ↵Thomas Martitz
bitmaps. For images, rows need to be even (this is not true for anti-aliased font files). Fix stride and size calculation. This makes images that have odd pixel rows display properly and fixes buffer overflows. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30966 a1c6a512-1295-4272-9138-f99709370657
2011-11-09Set alpha_offset to zero when loading a JPEG.Boris Gjenero
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30948 a1c6a512-1295-4272-9138-f99709370657
2011-11-08Fix warning on mrobe100.Thomas Martitz
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30942 a1c6a512-1295-4272-9138-f99709370657
2011-11-08Adapt the resize-on-load image scalers to support the alpha channel.Thomas Martitz
Now 32bit BMPs with alpha channel can be up- and downscaled without losing transparency information. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30938 a1c6a512-1295-4272-9138-f99709370657
2011-11-08Support for transparency in 32bit bitmaps on color targets.Thomas Martitz
This uses the alpha blending capabilities introduced with anti-aliased fonts to draw bitmaps with transparency information. The bmp loader is extended to read this information (pass FORMAT_TRANSPARENT in format). The alpha information will be used when drawing the bitmap. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30937 a1c6a512-1295-4272-9138-f99709370657