Commit graph

1019 commits

Author SHA1 Message Date
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
Andree Buschmann
1b94cbc1ef Remove 'set but not used' warning by GCC 4.6.1.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30416 a1c6a512-1295-4272-9138-f99709370657
2011-09-03 10:49:10 +00:00
Michael Sevakis
4db3e89652 Shuffle some functions around so that interfacing with playback.c in particular isn't required. Though playback does finish the audio init, pcm doesn't care who does it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30403 a1c6a512-1295-4272-9138-f99709370657
2011-09-01 12:15:43 +00:00
Thomas Martitz
8a701e5488 Fix errors and warnings.
The buffer_offset paramter of audio_init_recording() is removed as it
was unused in both implementations.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30310 a1c6a512-1295-4272-9138-f99709370657
2011-08-14 15:37:05 +00:00
Thomas Martitz
d1322b7159 GSoC/Buflib: Replace all direct accesses to audiobuf with buffer API functions.
Namely, introduce buffer_get_buffer() and buffer_release_buffer().
buffer_get_buffer() aquires all available and grabs a lock, attempting to
call buffer_alloc() or buffer_get_buffer() while this lock is locked will cause
a panicf() (doesn't actually happen, but is for debugging purpose).
buffer_release_buffer() unlocks that lock and can additionally increment the
audiobuf buffer to make an allocation. Pass 0 to only unlock if buffer was
used temporarily only.
buffer_available() is a replacement function to query audiobuflen, i.e. what's
left in the buffer.
Buffer init is moved up in the init chain and handles ipodvideo64mb internally.

Further changes happened to mp3data.c and talk.c as to not call the above API
functions, but get the buffer from callers. The caller is the audio system
which has the buffer lock while mp3data.c and talk mess with the buffer.
mpeg.c now implements some buffer related functions of playback.h, especially
audio_get_buffer(), allowing to reduce #ifdef hell a tiny bit.

audiobuf and audiobufend are local to buffer.c now.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30308 a1c6a512-1295-4272-9138-f99709370657
2011-08-14 15:13:00 +00:00
Frank Gevaerts
68e066f400 #ifdef hell makes effectively suppressing this warning impossible, so stop trying
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30238 a1c6a512-1295-4272-9138-f99709370657
2011-08-01 20:21:34 +00:00
Frank Gevaerts
038a608bb7 Move the "warning suppression" down, so it comes after the last write to "remote", to ensure better warning avoidance
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30237 a1c6a512-1295-4272-9138-f99709370657
2011-08-01 20:13:43 +00:00
Frank Gevaerts
bd3056cb38 Suppress a "variable 'remote' set but not used" warning that some gcc versions (rightly) emit for the m:robe 100 sim. The "correct" solution would be to add about twenty five more #ifdefs to a function that already has way too many of them, or to rewrite the entire function.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30236 a1c6a512-1295-4272-9138-f99709370657
2011-08-01 20:07:05 +00:00
Michael Sevakis
22b6def065 Use playback channel directly for peakmeters and plugins using peak calculation. Also, for now, don't allow mixer playback to overlap recording, even if full duplex works.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30119 a1c6a512-1295-4272-9138-f99709370657
2011-07-02 11:55:38 +00:00
Michael Sevakis
a2b6703a36 Commit FS#12150 - Fully-functional audio mixer - and finally whip old limitations about playback of voice and other sounds when paused. Channels are independent in state and amplitude. Fade on stop/pause is handled by the channel's volume control rather than global volume which means it now works from anywhere. Opens up the possibility of plugin sounds during music playback by merely adding an additional channel enum. If any PCM drivers were not properly modified, see one of the last comments in the task for a description of the simple change that is expected. Some params are tunable in firmware/export/pcm-mixer.h as well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30097 a1c6a512-1295-4272-9138-f99709370657
2011-06-29 06:37:04 +00:00
Nils Wallménius
3b04a85245 Remove a couple of dead inits and assignments found by the clang-static-analyzer.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29996 a1c6a512-1295-4272-9138-f99709370657
2011-06-12 22:17:45 +00:00
Peter D'Hoye
82f4c60db4 Make the histogram code usable for playback as well. Move the recording histogram code to peakmeter, rename it to remove the recording reference, and rename anything referring to it as well. Change the drawing code so there are more options to position them. This may change your histogram settings, so check after upgrading.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29969 a1c6a512-1295-4272-9138-f99709370657
2011-06-05 12:36:27 +00:00
Jonathan Gordon
b58d3656d7 FS#11925 - Add a proper system to keep track of the current screen/activity to make %cs far more useful
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29944 a1c6a512-1295-4272-9138-f99709370657
2011-06-01 14:41:49 +00:00
Andree Buschmann
e75018ad66 Fix several 'variable set but not used' warnings reported from GCC 4.6.0.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29805 a1c6a512-1295-4272-9138-f99709370657
2011-05-01 11:42:41 +00:00
Rafaël Carré
8c3fc23ae6 remove set but unused variable
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29659 a1c6a512-1295-4272-9138-f99709370657
2011-03-28 21:44:36 +00:00
Marcin Bukat
2e4259e497 recording.c
1) fix bug in fmt_gain()
2) take into account steps field of sound_settings_info struct when inc/dec gain

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29593 a1c6a512-1295-4272-9138-f99709370657
2011-03-15 22:35:04 +00:00
Thomas Martitz
cc889e9d60 Change the thread api a bit.
* Remove THREAD_ID_CURRENT macro in favor of a thread_self() function, this allows thread functions to be simpler.
* thread_self_entry() shortcut for kernel.c.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29521 a1c6a512-1295-4272-9138-f99709370657
2011-03-05 17:48:06 +00:00
Thomas Martitz
cab6ac2240 Fix warning in android build.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29440 a1c6a512-1295-4272-9138-f99709370657
2011-02-27 21:09:36 +00:00
Michael Sevakis
6510973223 Give playback engine better control over the codec. Codec simply follows commands and doesn't concern itself with audio state. Get track change notification in on the actual last buffer insert of the track because now audio simply waits for a track change notify from PCM on the last track and it must be sent reliably. This is still at an intermediate stage but works. Codecs and plugins become incompatible.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29387 a1c6a512-1295-4272-9138-f99709370657
2011-02-23 14:31:13 +00:00
Andree Buschmann
57ca48458f Fix test plugin build.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29277 a1c6a512-1295-4272-9138-f99709370657
2011-02-10 20:20:12 +00:00
Thomas Martitz
f577a6a22c Embedded album art support in MP3/ID3v2 tags.
- Support is limited to non-desync jpeg in id3v2 tags. Other formats (hopefully) follow in the future.
- Embedded album art takes precedence over files in album art files.
- No additional buffers are used, the jpeg is read directly from the audio file.

Flyspray: FS#11216
Author: Yoshihisa Uchida and I

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29259 a1c6a512-1295-4272-9138-f99709370657
2011-02-09 20:13:13 +00:00
Andree Buschmann
5d849a963e Clean up multiple definitions of RAM size. Remove -DMEM (make) and MEM (code), use the already defined MEMORYSIZE instead.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29189 a1c6a512-1295-4272-9138-f99709370657
2011-02-02 17:43:32 +00:00
Thomas Martitz
c402519e31 Fix yellow
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29165 a1c6a512-1295-4272-9138-f99709370657
2011-01-29 15:14:23 +00:00
Jonathan Gordon
261c56ba59 FS#11867 - Add 2 new tags to allow skins to display themed peakmeters
%pL for the left channel, %pR for the right channel... usable as a value, conditional or bar (exactly the same as %pv/%bl/etc)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29043 a1c6a512-1295-4272-9138-f99709370657
2011-01-13 06:48:39 +00:00
Teruaki Kawashima
47f670d3c2 FS#11725: fix duplicationg slash indicating root in filename.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28705 a1c6a512-1295-4272-9138-f99709370657
2010-11-29 12:51:44 +00:00