Commit graph

1043 commits

Author SHA1 Message Date
Thomas Martitz
ce8aef737c bmp loader: Fix loading of monochrome/greyscale BMPs with newer headers.
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-11 14:19:43 +01:00
Thomas Martitz
2f4a94189d bmp.c: Undo debug stuff that got in by accident.
Change-Id: Ic37658ab8d81405e28a4097d38785900fd0951cd
2014-01-05 19:37:48 +01:00
Thomas Martitz
281d1fadb3 Do not include kernel.h in system.h.
system.h doesn't need it on its own and this change makes it less
dependant on Rockbox internals.

Change-Id: I4e1e4108a52a7b599627a829204eb82b392fc6d6
2014-01-05 19:35:23 +01:00
Thomas Martitz
042d8bf9eb Revert "Fix data abort introduced by ef92ed4a."
This reverts commit 61a096499b.

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-05 01:19:44 +01:00
Frank Gevaerts
61a096499b Fix data abort introduced by ef92ed4a.
Change-Id: I3e1bf2434238835d2d2b8f5f2a8f44b0df97b33d
2014-01-04 22:15:02 +01:00
Thomas Martitz
a56837b46d recording: Fix sloppy return value check. This caused an OOM panic.
Change-Id: I30bbc5623d81ad7cbbee52a439fb5909af2761b7
2013-12-24 10:20:13 +01:00
Thomas Martitz
ec6258f936 fix some reds.
Change-Id: Iecb1305dbd1519434e0f476d2199e728b96091f9
2013-12-23 12:35:52 +01:00
Thomas Martitz
22e802e800 playback,talk: Share audiobuffer via core_alloc_maximum().
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-23 12:17:38 +01:00
Thomas Martitz
9f878b105d Fix errors introduced by a62bd92.
Change-Id: I3f65ca5347d08e1b77196c73ccb3a0951f14c850
2013-12-22 21:05:54 +01:00
Thomas Martitz
a62bd9282e Fix warning and re-order code a bit.
Change-Id: I1d733b3d0bd17cc541218f9a2b7712712ad314dd
2013-12-22 20:15:03 +01:00
Thomas Martitz
ef92ed4a6a Support GIMP bmp files.
Change-Id: I7380ceeaf696b67e1641d24e7b932e3d74770932
2013-12-22 19:55:55 +01:00
Roman
1fa3f5906e Swap over a position of cursor while reaching the end of filename in keyboard
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-09 18:43:10 +02:00
Michael Sevakis
5f0692b98c SWCODEC recording: Boost CPU frequency before doing flush on stop
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-09 07:36:22 -04:00
Michael Sevakis
f9e47c6886 19b289a somehow missed one last LANG_RECORDING_FREQUENCY.
Did grep fail me?

Change-Id: Id8254aa542d57204e265ef06829b4e034f032137
2013-07-06 17:37:08 -04:00
Michael Sevakis
bb87590e05 Temporarily disable keyclick in recording screen.
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-30 20:14:06 -04:00
Michael Sevakis
59abdb5190 Fix strlcpy warnings in 4888131.
Change-Id: Ibd355ee1cf39d1a4b07def94634f0316468bf727
2013-06-29 19:27:21 -04:00
Michael Sevakis
4888131972 Update software recording engine to latest codec interface.
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-30 00:40:27 +02:00
Michael Sevakis
a9ea1a4269 Fix some whitespace in files changed in following commit.
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-06-30 00:40:09 +02:00
Michael Sevakis
344b9d0986 Some corrections after 5857c44.
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-31 04:13:39 -04:00
Michael Sevakis
5857c44017 Refactor audio thread to run both recording and playback.
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-31 03:20:35 -04:00
Michael Sevakis
df6e1bcce5 pcm_record: Track initialization state
It should not access audio hardware and change settings unless it has
been initialized first and given control of it.

Change-Id: I5004602d7caa604ded751f6838b792d1ff24b3fb
2013-05-30 18:42:59 -04:00
Thomas Martitz
ca634a0ac0 bitmap drawing: Negate alpha channel to match alpha information format of 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
2013-02-12 10:29:25 +01:00
Michael Sevakis
e189b33ff4 Clean up peak calculating code.
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-05-02 20:53:07 -04:00
Bertrik Sikken
7901aa6f19 Simplify warning suppression for unused argument
Change-Id: If8d6e3669dca3ba8351e949ef901809e87f94366
2012-04-22 16:20:31 +02:00
Michael Sevakis
286a4c5caa Revise the PCM callback system after adding multichannel audio.
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>
2012-03-03 07:23:38 +01:00
Marcin Bukat
01415ad1b7 AGC: respect gain steps defined in audiohw_settings[]
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31387 a1c6a512-1295-4272-9138-f99709370657
2011-12-20 22:02:35 +00:00
Boris Gjenero
fdc29d0ea4 Add more INIT_ATTR and add config.h includes to header files with INIT_ATTR.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31370 a1c6a512-1295-4272-9138-f99709370657
2011-12-19 20:12:52 +00:00
Andree Buschmann
9b920734be Fix bitmap scaling for Coldfire. Closes FS#12411.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31366 a1c6a512-1295-4272-9138-f99709370657
2011-12-19 19:17:13 +00:00
Boris Gjenero
17ed3253fc Add const to global pointers to strings.
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-17 18:31:55 +00:00
Boris Gjenero
8e6030c822 FS#12378 : Remove various unused code, and comment out some unused code and data for reference or future use.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31256 a1c6a512-1295-4272-9138-f99709370657
2011-12-14 21:45:25 +00:00
Michael Sevakis
c2513580cb Closing recording before initializing it the first time isn't needed and may 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-11 00:53:46 +00:00
Michael Sevakis
d2c1ece304 Move the PCMREC_E/W_* defines back to pcm_record.h because they're part of 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-08 21:45:53 +00:00
Michael Sevakis
5af1e2f531 Add a second boost condition to the recording PCM buffer to boost the CPU 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-08 21:30:37 +00:00
Michael Sevakis
e42a3194de AS3525v1/v2:
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-12-08 19:20:00 +00:00
Tomasz Moń
c40f5202a4 Sansa Connect: Add keymap for YesNo dialog and keyboard
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31090 a1c6a512-1295-4272-9138-f99709370657
2011-11-29 11:18:59 +00:00
Boris Gjenero
d51e598335 FS#12412 : Delete old buffer allocation code which has been replaced by 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-29 00:42:27 +00:00
Jonathan Gordon
9e07ef2b0a Use buflib for all skin engine allocations.
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-15 14:11:08 +00:00
Thomas Martitz
caec07be65 Handle 32bit bitmaps with all-zero alpha channel as fully opaque.
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-11 22:03:29 +00:00
Thomas Martitz
312b2a2de7 Document the internal alpha channel format better, and fixes for 32bit alpha 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-11 19:05:11 +00:00
Boris Gjenero
b882f8f4e3 Set alpha_offset to zero when loading a JPEG.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30948 a1c6a512-1295-4272-9138-f99709370657
2011-11-09 23:25:36 +00:00
Thomas Martitz
354015ef28 Fix warning on mrobe100.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30942 a1c6a512-1295-4272-9138-f99709370657
2011-11-08 22:34:35 +00:00
Thomas Martitz
c7b8054714 Adapt the resize-on-load image scalers to support the alpha channel.
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-08 21:39:23 +00:00
Thomas Martitz
f443e7bbf7 Support for transparency in 32bit bitmaps on color targets.
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
2011-11-08 21:36:49 +00:00
Jonathan Gordon
f19f3efb07 Redo r30826 (and hopefully not reintroduce font issues) which cleans up the font API. FONT_UI is deprecated, use screens[screen].getuifont() instead (and .setuifont() to set it after a font has been loaded)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30932 a1c6a512-1295-4272-9138-f99709370657
2011-11-08 10:09:33 +00:00
Björn Stenberg
0942e2a0f7 Changed the FOR_NB_SCREENS macro to always be a for loop that declares its own loop variable. This removes the need to declare this variable in the outer scope.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30756 a1c6a512-1295-4272-9138-f99709370657
2011-10-15 19:35:02 +00:00
Fred Bauer
f301ac05f9 Revert 30754 because the codecs won't build correctly, anyway.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30755 a1c6a512-1295-4272-9138-f99709370657
2011-10-15 00:44:35 +00:00
Fred Bauer
2537e46b0b undef DEBUG in pcm_record.c because it's broken and breaks DEBUG builds
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30754 a1c6a512-1295-4272-9138-f99709370657
2011-10-14 22:41:03 +00:00
Bertrik Sikken
2e58d5935d Make function calc_db in peakmeter.c static
Remove some unneeded #include "peakmeter.h"

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30713 a1c6a512-1295-4272-9138-f99709370657
2011-10-04 21:25:26 +00:00
Jonathan Gordon
aa0f4a4bbe FS#12273 - use buflib for font storage. thanks to the testers :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30589 a1c6a512-1295-4272-9138-f99709370657
2011-09-24 13:19:34 +00:00
Andree Buschmann
29f04cc986 Roll back r30416. A proper fix of this warning will end in an #ifdef-hell.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30417 a1c6a512-1295-4272-9138-f99709370657
2011-09-03 11:04:41 +00:00