Commit graph

2128 commits

Author SHA1 Message Date
Michael Sevakis
9b65f8e658 Fix 6e211ab errors and warnings.
If target has HW tone controls but no HW prescaler (non-implemented or
non-existent), audiohw_set_prescaler() should, for now, do nothing.

Change-Id: If1b1a36970dca82fda1c350fbaa4d6ce068a6d32
2013-05-23 14:58:57 -04:00
Michael Sevakis
6e211ab3ac Remove dsp_callback because DSP is now library code, not app code.
Yep, nope, not necessary anymore. Just call functions directly.

Change-Id: I21dc35f8d674c2a9c8379b7cebd5613c1f05b5eb
2013-05-23 14:25:37 -04:00
Michael Sevakis
b210a3a8cb Fix FS#12860 - iPod 5g line out silent
Conversion from centibels to register values was left out of
audiohw_set_lineout_volume().

Credit goes to Dave Marsh for providing the fix.

Just another little oversight from sound/audiohw rework.

Change-Id: I7f8b1c5fb575ac95b5d595c2f4824fbb5ebbd3c8
2013-05-09 15:37:56 -04:00
Andrew Ryabinin
fa4e1baa83 Introduce HiFi E.T MA9 port.
Change-Id: I79aadc958fd5222f26f91ed127f8c6fb2c465dc2
2013-05-06 14:09:24 +04:00
Michael Sevakis
fd00d3cf48 Fix FS#12859 - Bass/Treble not doing anything in new builds
Just one more SNAFU after redoing sound.c. Software bass/treble controls
in the DSP expect .1 dB gain increments but the gains were being set as
1 dB increments because that's what the AUDIOHW_SETTING specifies. Just
x10 the gains given to audiohw_set_bass/treble.

Change-Id: Id5296f93908ec0036a5605d3a60a2cb5eec91bb5
2013-05-04 22:46:18 -04:00
Michael Sevakis
08199cd6cb Provide high resolution volume and prescaler to hosted targets.
HAVE_SW_VOLUME_CONTROL is required and at this time only affects the
SDL targets using pcm-sdl.c.

Enables balance control in SDL targets, unless mono volume is in use.

Compiles software volume control as unbuffered when
PCM_SW_VOLUME_UNBUFFERED is defined. This avoids the overhead and
extra latency introduced by the double buffer when it is not needed.
Use this config when the target's PCM driver is buffered and sufficient
latency exists to perform safely the volume scaling.

Simulated targets that are double-buffered when made as native targets
remain so in the sim in order to run the same code.

Change-Id: Ifa77d2d3ae7376c65afecdfc785a084478cb5ffb
Reviewed-on: http://gerrit.rockbox.org/457
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
2013-04-27 06:59:27 +02:00
andypotter
ecaa401660 Add Serial Port 1 support for iPod Photo/Color/4G/Mini2G
Based on FS#9920 by Ryan Press with changes to selection logic so
that it works on my iPod Photo. Should also work on iPod Color/4G
and Mini2G. Moved all target specific code from
firmware/drivers/serial.c into new file
firmware/target/arm/pp/uart-pp.c in the same manner as other
target specific uart code.
Update to fix build error on ipodmini2g by adding defines in config file.
Removed unwanted whitespace
Tested on iPod Photo.

Change-Id: Ia5539563966198e06372d70b5adf2ef78882f863
Reviewed-on: http://gerrit.rockbox.org/455
Reviewed-by: andypotter <liveboxandy@gmail.com>
Tested-by: andypotter <liveboxandy@gmail.com>
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2013-04-25 21:02:09 +02:00
Michael Sevakis
4f2c0c1ed2 Oops. Revert a pointless change.
Change-Id: I082411145a411ca7d41b359dea419ef8190d70ce
2013-04-22 20:55:47 -04:00
Michael Sevakis
e61e9c61d0 Do some cleanup, adjustment and a couple fixes to recent sound changes.
* SOUND_x enum can be generated by audiohw_settings.h along with settings
entries and sound_val2phys.

* VOLUME_MIN and VOLUME_MAX are no longer necessary within sound.c. If
you need them, they are for target-defined purposes.

* Fix up SDL volume implementation in sdl.c. Move sim volume calculation
code to pcm-sdl.c.

* Min trigger tresholds were based upon VOLUME_MIN for some reason.
These setting have nothing to do with playback volume. Since it is no
longer present, set these at -89dB which is the minimum peak meter
sensitivity setting.

* Fix an oversight in wm8758.c. I forgot to add the dB->register
conversion to audiohw_set_volume.

Change-Id: Ie1df33f1793eee75e6793f16bc7bddd16edb7f75
2013-04-22 20:38:17 -04:00
Michael Sevakis
333f4f52be Fix final error from 0c7b787 in Player sim.
Change-Id: Ifeebed8f594fc56acbbd2439fb8186566cc04de8
2013-04-15 15:19:39 -04:00
Michael Sevakis
5261b19bdf Still at it for 0c7b787. Might be done now.
Change-Id: Idf45731dc6554954747f6036dc6dfcd4b63981a1
2013-04-15 14:58:00 -04:00
Michael Sevakis
9e71fd16a5 Keep fixing 0c7b787 stuff
Change-Id: I0678d3307fbcad32156f9f4e0f8b90eed5a20d92
2013-04-15 14:00:48 -04:00
Michael Sevakis
bbd991ad63 Fix some more errors and warnings from 0c7b787.
Change-Id: Ib67d0ab344e36964cadbcc982dc2afe35733770b
2013-04-15 13:24:29 -04:00
Michael Sevakis
0971f57634 Hopefully knock out most of the red and yellow from 0c7b787.
Change-Id: Ib8dd0d011b11ee3eded3025308f19ddb5d151b59
2013-04-15 12:39:04 -04:00
Michael Sevakis
0c7b787398 Straighten out the mad twisted state of sound.c and related areas.
This is going right in since it's long overdue. If anything is goofed,
drop me a line or just tweak it yourself if you know what's wrong. :-)

Make HW/SW codec interface more uniform when emulating HW functionality
on SWCODEC for functions such as "audiohw_set_pitch". The firmware-to-
DSP plumbing is in firmware/drivers/audiohw-swcodec.c. "sound_XXX"
APIs are all in sound.c with none in DSP code any longer.

Reduce number of settings definitions needed by each codec by providing
defaults for common ones like balance, channels and SW tone controls.

Remove need for separate SIM code and tables and add virtual codec header
for hosted targets.

Change-Id: I3f23702bca054fc9bda40f49824ce681bb7f777b
2013-04-15 12:02:05 -04:00
Marcin Bukat
fd6ab02912 rk27xx: do not attenuate signal twice in analog bypass mode
Change-Id: I108091adaa05e53ccb8bbe3d60ca35e2191a39fd
2013-04-12 21:43:17 +02:00
Andrew Ryabinin
6be8097651 hm60x/hm801: Fix balance by enabling sw volume control.
Change-Id: I8760b58d5b801409f35370d812d72f8d578d2889
2013-04-12 10:11:54 +04:00
Michael Sevakis
2dd1f37a10 Fix f5a5b94 errors. Employ SW volume for select targets on SIM.
Onda VX747 sim was missing a limits #define; #include limits.h in
pcm_sw_volume.h.

Simply use the software volume control for the SIM volume control
rather than the SDL volume control when the target would have it
natively.

Change-Id: I8e924a2ff1b410f602452d2ea9b691efb82c931e
2013-04-11 19:00:23 -04:00
Amaury Pouly
a924df8d6d rk27xx: implement radio support
Change-Id: I59d3905e9b2a3df8aa235e424c7a6e0eff6d73e9
Reviewed-on: http://gerrit.rockbox.org/427
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
Tested-by: Marcin Bukat <marcin.bukat@gmail.com>
2013-04-11 11:18:23 +02:00
Bertrik Sikken
9b8f11d94a Fix LV24020 tuner chip volume level definition (found by cppcheck)
Change-Id: I328cfbd7c9fc6295db2e62f6174f8f4405e281a8
2013-03-24 16:03:31 +01:00
Thomas Martitz
bd67f3dc6b bitmap drawing: Support alpha blend if image over the framebuffer contents.
If DRMODE_FG now the alpha channel in bitmaps can be used to draw the bitmap
over the framebuffer, so that e.g. a line selector isn't cleared for
for transparent bitmap pixels.

Change-Id: I09d59a09d2f3c90450a0fe2b83c6c59d757b686b
2013-02-12 10:37:13 +01:00
Thomas Martitz
68d3ce2acd bitmap drawing: use temp vars to help gcc opmize loops.
By saving current_vp fields into temp vars just before the loop gcc can
put them into registers. This yields ~15% speedup for drawing anti-aliased fonts.

Change-Id: I4c0c9f5ff7a7f084e2eb08c4ed874176b1f9832c
2013-02-12 10:34:49 +01:00
Thomas Martitz
1430b07894 bitmap drawing: Use extra bit in mask to avoid nested if() in switch-cases.
Speeds up alpha bitmap drawing by up to 10%. mono bitmap drawing is also a tiny bit faster.

Change-Id: I5a9379740c1a0091de9c621aabbe57d767ce2905
2013-02-12 10:34:48 +01: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
Amaury Pouly
224c6d68f1 stfm1000: comment static unused function
Change-Id: Ie918a07c72bf9086508731faf658d57a286d922a
2013-01-15 19:49:52 +00:00
Amaury Pouly
f7132e4044 Fix copyright headers
Change-Id: Ie65920b1192e9b737fcc2554d280fbcedfa39800
2012-12-29 01:40:35 +01:00
Ryan Hitchman
bece6cb9da si4700: fix typo
Change-Id: I3ebeaf8188fc330921089a148cac1f3ea5740e23
Reviewed-on: http://gerrit.rockbox.org/370
Reviewed-by: Bertrik Sikken <bertrik@sikken.nl>
2012-12-09 15:21:36 +01:00
Jonathan Gordon
685cf59008 9 segment bitmap drawing:
Use %x9(id) to draw an image in the whole current viewport using the
9 segment drawer (which draws the corners as normal and *tiles*
the middle segments to the needed width/height).

Future work is to make it scale instead of tile

Change-Id: Ic3ed1cad93f96091694801eb442e0da5a2401203
2012-12-09 17:11:19 +11:00
Bertrik Sikken
1272e85299 Fix uninitialized variable in decoding of RDS radio text
Change-Id: Ifc678166ac70cc8fc76897c76ccbc4bc3f88cc14
2012-11-09 19:09:39 +01:00
Marcin Bukat
ad46064b83 rk27xx codec: simplify startup
Change-Id: I8b610363e67ec640664aa0d03488e430ec461244
2012-07-11 00:28:44 +02:00
Marcin Bukat
676f72a0f4 rk27xx codec: Fix volume setting
Change-Id: If57e0225fed4a9f87dff9661b21b2e06fa3d341e
2012-07-10 20:09:21 +02:00
Amaury Pouly
f8aa5c4ec0 Fix red
Change-Id: Ifa8b360c97bb1036210b2563cfb87be2630eaab6
2012-05-31 19:20:02 +02:00
Amaury Pouly
f7b2e3153b rds: implement more robust PS/RT parsing
Our current PS and RT parser is very strict: it requires
all segments to be received in order. This is too strong
of an assumption even when the reception in good, particularly
for long RT messages. This parser handles segments in any order
and completes a message only when all segments are present. To
avoid keeping obsolete segments, each segment has an associated
timeout and is trashed if not updated for a certain period.

Change-Id: I79841bb5ab1f838c7702d8281044e226f6510199
Reviewed-on: http://gerrit.rockbox.org/237
Tested-by: Bertrik Sikken <bertrik@sikken.nl>
Reviewed-by: Bertrik Sikken <bertrik@sikken.nl>
2012-05-31 19:04:38 +02:00
Lorenzo Miori
3cad5573b6 ypr0: This patch adds radio support to Samsung YP-R0
Basically it uses the default SI4700 radio chip driver, the only thing that's different is the I2C access,
written specifically to interact with my kernel module.
Next things to add are:
- RDS support!

Change-Id: I0ed125641e00f93124d7a34f90dd508e7f1db5a4
Signed-off-by: Lorenzo Miori <memorys60@gmail.com>
2012-05-28 19:39:14 +02:00
Bertrik Sikken
fca9e7bf8d zenxfi3: RTC is used in same was as in fuze+, using seconds-since-1970 plus an offset
Change-Id: Iab2e6e15c790c26d3bf2679e9f965a409d162783
2012-05-27 00:16:40 +02:00
Jonas Wielicki
028c5e35ee Add identify() call to reset procedures
This change is motivated by the ATA specs, section 9.2 Software reset protocol
(quote):
    A host should issue an IDENTIFY DEVICE and/or IDENTIFY PACKET DEVICE
    command after the software reset protocol has completed to determine the
    current status of features implemented by the device(s).

This indeed fixes a local issue with an SSD in an iriver h320. No other tests
were carried out.

Change-Id: I191444aec3e55f6890020f601c715d0022d09fb6
Reviewed-on: http://gerrit.rockbox.org/218
Reviewed-by: Bertrik Sikken <bertrik@sikken.nl>
Reviewed-by: Linus Nielsen Feltzing <linus@haxx.se>
Reviewed-by: Peter D'Hoye <peter.dhoye@gmail.com>
Tested-by: Peter D'Hoye <peter.dhoye@gmail.com>
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2012-05-19 19:15:04 +02:00
Amaury Pouly
e401683482 zenxfi3&stfm1000: implement fmradio i2c and debug screen
Change-Id: I83dbdee13185d9adcf590dc213da5a8c97adb2ba
2012-05-19 18:04:25 +02:00
Amaury Pouly
b422be9bd0 Add stub STFM1000 tuner driver
Change-Id: I7f82f7b8971de75c92f84d12aaddccc50f3e47b1
2012-05-19 16:10:52 +02:00
Amaury Pouly
deb61e0622 Add the MPR121 (touchbutton chip) driver
Change-Id: I9db97a698ef1c7f0b4f47e406faa1f6c0ec524db
2012-05-19 16:10:52 +02:00
Amaury Pouly
692338629b imx233: move rtc init from drivers/ to firmware/
Change-Id: Id816987a4bb1191d5c9cf8a85c51d75fbb2da7c8
2012-05-19 12:57:42 +02:00
Michael Sevakis
0bda1e1504 Fix a drawing bug where rectangles stop drawing too early.
As far as I can say only one file is affected. The loops needs to
go one more time since the end pointer is on the last pixel, not
beyond it.

Change-Id: Ie629138f8399b927bef7bad3847ef42db37e2fed
2012-05-19 06:05:47 -04:00
Jens Arnold
c736c0e45b Player LCD: Map several punctuation characters in the U+20xx range
This is in preparation of Win-1252 support (gerrit #209).
2012-05-19 00:30:55 +02:00
Nils Wallménius
2dda258f99 Remove STATICIRAM hack
It was only needed by the old arm toolchain that we no longer use or support.

Change-Id: Id0e6c67477f8834a637079b03cde5fbf9da68b1c
Reviewed-on: http://gerrit.rockbox.org/233
Reviewed-by: Nils Wallménius <nils@rockbox.org>
2012-05-08 22:46:12 +02:00
Marcin Bukat
18c016b4e0 Fix test fat failing on 64bit system (second bit of FS#12646)
We use unsigned long/long in number of places in fat.c. When this
is used to cast 32bit fat field it fails on 64bit systems.
This patch introduces explicit types (uint16_t, uint32_t) only
in places which influence how fat structures are interpreted.

Change-Id: I0be44d0b355f9de20b4deb221698d095f55d4bde
Reviewed-on: http://gerrit.rockbox.org/232
Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
Reviewed-by: Torne Wuff <torne@wolfpuppy.org.uk>
2012-05-08 13:00:56 +02:00
Rafaël Carré
65bb8e4452 Remove extraneous parens 2012-05-06 23:13:34 -04:00
Bertrik Sikken
a92a0fecca as3514 rtc: sansa clip zip uses 1970/1/1 base date instead of special AS3525v2 date
Change-Id: I32329c82da93c705a5cb4af8a1a8b4e85a9c9b37
2012-04-17 21:33:59 +02:00
Bertrik Sikken
e92fbb42d7 FS#10345 - Gigabeat: Switch volume buttons in Upside Down mode
Change-Id: If2d5ed52e5b52c48b50e412dda52632bb08b0c8d
2012-04-15 23:27:50 +02:00
Bertrik Sikken
73732f406e si4700 tuner: fix power consumption issue caused by ill-defined power state at startup
Change-Id: I657bc7e3d330f436859cfef2a89b0813bc008c49
2012-04-11 23:31:19 +02:00
Bertrik Sikken
3cb0d71759 si470x tuner: remove obsolete handling of special value 2 for RADIO_SLEEP
Change-Id: I2291a9f402ff0da03fe58933a33d67c2ac4f0332
2012-04-09 13:22:41 +02:00
Frank Gevaerts
416da2260c Call tuner_power(true) from the correct place for lv24020lp.
This fixes radio not working on c200 and e200 (and possibly others),
as reported in FS#12631.

Change-Id: Idd66fa3b74916cc6f2de45ae7dd89b3bfd70f070
2012-04-02 22:14:07 +02:00