summaryrefslogtreecommitdiffstats
path: root/firmware/target/hosted/android
AgeCommit message (Collapse)AuthorFilesLines
2022-03-03Fix Red SDL, Android mounting root directory, and all the yellow tooWilliam Wilgus1-27/+0
Change-Id: Ic5077140fdcb1e3168111336bc428c27a782123c
2022-03-03Fix Red SDL, Android mounting root directoryWilliam Wilgus1-0/+27
Not actually used in either atm Change-Id: I40e0143fdde1970ac485bf664962c62d4c493d57
2021-07-25pcm: Remove unused function pcm_play_dma_get_peak_buffer()Aidan MacDonald1-7/+0
Change-Id: Ifd20fb14a22489cdb99154c01f69809a1e70d0c5
2020-11-12pcm: Further cleanup of unused bits of the PCM ACPI:Solomon Peachy1-5/+0
* pcm_get_bytes_remaining() * pcm_calculate_peaks() * pcm_get_peak_buffer() Nothing in-tree uses these at all (except for the lua plugin wrapper) Change-Id: I971b7beed6760250c8b1ce58f401a601e1e2d585
2020-10-31fix red introduced in the android pcm driver (rev fe2d52c)Solomon Peachy1-1/+1
Change-Id: I2fa160fd39842a5434cf11573b50061786e610ca
2020-10-31pcm: Get rid of pcm_play_pause() and associated APIsSolomon Peachy1-10/+5
Nothing in the core has used it for some time. It's exported to the plugin API but the last plugins to use it were switched to the mixer API back in 2011. This allows us to get rid of pcm_play_dma_pause() from all audio drivers Change-Id: Ic3fa02592316f84963e41d792d1cabb436d1ff6b
2020-10-26LCD core move buf ptr and address look up function viewport structWilliam Wilgus1-2/+2
I'm currently running up against the limitations of the lcd_draw functions I want these functions to be able to be used on any size buffer not just buffers with a stride matching the underlying device [DONE] allow the framebuffer to be decoupled from the device framebuffer [DONE need examples] allow for some simple blit like transformations [DONE] remove the device framebuffer from the plugin api [DONE}ditto remote framebuffer [DONE] remove _viewport_get_framebuffer you can call struct *vp = lcd_set_viewport(NULL) and vp->buffer->fb_ptr while remote lcds may compile (and work in the sim) its not been tested on targets [FIXED] backdrops need work to be screen agnostic [FIXED] screen statusbar is not being combined into the main viewport correctly yet [FIXED] screen elements are displayed incorrectly after switch to void* [FIXED] core didn't restore proper viewport on splash etc. [NEEDS TESTING] remote lcd garbled data [FIXED] osd lib garbled screen on bmp_part [FIXED] grey_set_vp needs to return old viewport like lcd_set_viewport [FIXED] Viewport update now handles viewports with differing buffers/strides by copying to the main buffer [FIXED] splash on top of WPS leaves old framebuffer data (doesn't redraw) [UPDATE] refined this a bit more to have clear_viewport set the clean bit and have skin_render do its own screen clear scrolling viewports no longer trigger wps refresh also fixed a bug where guisyncyesno was displaying and then disappearing [ADDED!] New LCD macros that allow you to create properly size frame buffers in you desired size without wasting bytes (LCD_ and LCD_REMOTE_) LCD_STRIDE(w, h) same as STRIDE_MAIN LCD_FBSTRIDE(w, h) returns target specific stride for a buffer W x H LCD_NBELEMS(w, h) returns the number of fb_data sized elemenst needed for a buffer W x H LCD_NATIVE_STRIDE(s) conversion between rockbox native vertical and lcd native stride (2bitH) test_viewports.c has an example of usage [FIXED!!] 2bit targets don't respect non-native strides [FIXED] Few define snags Change-Id: I0d04c3834e464eca84a5a715743a297a0cefd0af
2015-02-02iBasso DX50/DX90: Major code cleanup and reorganization.Udo Schläpfer14-3705/+2
Reorganization - Separated iBasso devices from PLATFORM_ANDROID. These are now standlone hosted targets. Most device specific code is in the firmware/target/hosted/ibasso directory. - No dependency on Android SDK, only the Android NDK is needed. 32 bit Android NDK and Android API Level 16. - Separate implementation for each device where feasible. Code cleanup - Rewrite of existing code, from simple reformat to complete reimplementation. - New backlight interface, seperating backlight from touchscreen. - Rewrite of device button handler, removing unneeded code and fixing memory leaks. - New Debug messages interface logging to Android adb logcat (DEBUGF, panicf, logf). - Rewrite of lcd device handler, removing unneeded code and fixing memory leaks. - Rewrite of audiohw device handler/pcm interface, removing unneeded code and fixing memory leaks, enabling 44.1/48kHz pthreaded playback. - Rewrite of power and powermng, proper shutdown, using batterylog results (see http://gerrit.rockbox.org/r/#/c/1047/). - Rewrite of configure (Android NDK) and device specific config. - Rewrite of the Android NDK specific Makefile. Misc - All plugins/games/demos activated. - Update tinyalsa to latest from https://github.com/tinyalsa/tinyalsa. Includes - http://gerrit.rockbox.org/r/#/c/993/ - http://gerrit.rockbox.org/r/#/c/1010/ - http://gerrit.rockbox.org/r/#/c/1035/ Does not include http://gerrit.rockbox.org/r/#/c/1007/ due to new backlight interface and new option for hold switch, touchscreen, physical button interaction. Rockbox needs the iBasso DX50/DX90 loader for startup, see http://gerrit.rockbox.org/r/#/c/1099/ The loader expects Rockbox to be installed in /mnt/sdcard/.rockbox/. If /mnt/sdcard/ is accessed as USB mass storage device, Rockbox will exit gracefully and the loader will restart Rockbox on USB disconnect. Tested on iBasso DX50. Compiled (not tested) for iBasso DX90. Compiled (not tested) for PLATFORM_ANDROID. Change-Id: I5f5e22e68f5b4cf29c28e2b40b2c265f2beb7ab7
2015-01-12Get rid of stupid _backlight_* function namesMarcin Bukat2-8/+8
_remote_backlight_* and _buttonlight_* are cleaned as well Change-Id: I73653752831bbe170c26ba95d3bc04c2e3a5cf30
2014-12-20DX 50: Fix file descriptor leak on errorThomas Jarosch1-0/+2
Unimportant change, still good style. cppcheck reported: [rockbox/firmware/target/hosted/android/dx50/button-dx50.c:92]: (error) Resource leak: fd [rockbox/firmware/target/hosted/android/dx50/button-dx50.c:98]: (error) Resource leak: fd Change-Id: Ic1831382219c44e7bef71cb2391646c9910d2369
2014-10-18Enable battery charging detection for iBasso DX50/DX90.Udo Schläfer1-3/+28
This changes iBasso DX50/DX90 config from CHARGING_SIMPLE (Simple, hardware controlled charging (CPU cannot read charger state but may read when power is plugged-in) to CHARGING_MONITOR (Hardware controlled charging with monitoring (CPU is able to read HW charging state and when power is plugged-in)). Not really usefull at the moment, since USB connection (charging) is not (yet) gracefully handled for iBasso devices. Change-Id: I55da81b10637d4de88d713ea5eba08eb59bc629f Reviewed-on: http://gerrit.rockbox.org/1010 Reviewed-by: Michael Giacomelli <giac2000@hotmail.com>
2014-09-18Introducing Targets iBasso DX50 & iBasso DX90Simon Rothen14-2/+3678
The port to for this two targets has been entirely developped by Ilia Sergachev (alias Il or xzcc). His source can be found at https://bitbucket.org/isergachev/rockbox . The few necesary modifications for the DX90 port was done by headwhacker form head-fi.org. Unfortunately i could not try out the final state of the DX90 port. The port is hosted on android (without java) as standalone app. The official Firmware is required to run this port. Ilia did modify the source files for the "android" target in the rockbox source to make the DX port work. The work I did was to separate the code for DX50 (&DX90) from the android target. On this Target Ilia used source from tinyalsa from AOSP. I did not touch that part of the code because I do not understand it. What else I changed from Ilias sources besides the separation from the target "android": * removed a dirty hack to keep backlight off * changed value battery meter to voltage battery meter * made all plugins compile (named target as "standalone") and added keymaps * i added the graphics for the manual but did not do anything else for the manual yet * minor optimizations known bugs: * timers are slowed donw when playback is active (tinyalsa related?) * some minor bugs Things to do: * The main prolem will be how to install the app correctly. A guy called DOC2008 added a CWM (by androtab.info) to the official firmware and Ilia made a CWM installation script and a dualboot selector (rbutils/ibassoboot, build with ndk-build). We will have to find a way to install rockbox in a proper way without breaking any copyrights. Maybe ADB is an option but it is not enable with OF by default. Patching the OF is probably the way to go. * All the wiki and manual to build: needed: android ndk installed, android sdk installed with additional build-tools 19.1.0 installed ./tools/configure select iBasso DX50 or iBasso DX90 make -j apk the content of rockbox.zip/.rockbox needs to be copied to /system/rockbox/app_rockbox/rockbox/ (rockbox app not needed) the content of libs/armeabi to /system/rockbox/lib/ (rockbox app needed) The boot selector is needed as /system/bin/MangoPlayer and the iBasso app as /system/bin/MangoPlayer_original. There is also the "vold" file. The one from OF does not work with DX50 rockbox (DX90 works!?), the one from Ilia is necessary. Until we have found a proper way to install it, it can only be installed following the instructions of Ilia on his bitbucket page, using the CWM-OF and his installation script package. Change-Id: Ic4faaf84824c162aabcc08e492cee6e0068719d0 Reviewed-on: http://gerrit.rockbox.org/941 Tested: Chiwen Chang <rock1104.tw@yahoo.com.tw> Reviewed-by: Michael Giacomelli <giac2000@hotmail.com>
2014-03-09android: Get the port up and running againThomas Martitz1-34/+30
The build system needed fixes because the tools paths changed and one tool that we used (apkbuilder) was removed entirely. Recent NDKs don't ship gcc 4.4.3 anymore, therefore switch to 4.6. The code itself needed a fix for a jni reference bug that was uncovered by KitKat. The port now builds with latest sdk (r22) and ndk (r9d). Change-Id: Id74fa54ba93bbb0ee30373fbe79e92c5ff03201d
2014-03-03Fix hostfs_init() return value.Thomas Martitz1-1/+2
Change-Id: Ic8048e3fa0075de234e8879ba9faad101168bf09
2014-02-23RaaA: Move directory related stuff from filesystem-unix.c into rbpaths.c.Thomas Martitz1-46/+0
Part of this change is to align sdlapp builds to other application targets in that the sim_* wrappers are not used anymore (except for sim_read/write). Path mangling is now done in rbpaths.c as well. Change-Id: I9726da73b50a83d9e1a1840288de16ec01ea029d
2014-02-23storage: Add STORAGE_HOSTFSThomas Martitz1-0/+12
CONFIG_STORAGE & STORAGE_HOSTFS allows to use parts of the storage_* API to be compiled for application targets without compiling storage.c or performing actually raw storage access. This is primarily to enable application targets to implement HAVE_MULTIVOMULE/HAVE_HOTSWAP (in a later commit). SIMULATOR uses the same mechanism without explicitely defining STORAGE_HOSTFS (how to add a bit to an existing preprocessor token?). Change-Id: Ib3f8ee0d5231e2ed21ff00842d51e32bc4fc7292
2014-01-05Do not include kernel.h in system.h.Thomas Martitz1-1/+2
system.h doesn't need it on its own and this change makes it less dependant on Rockbox internals. Change-Id: I4e1e4108a52a7b599627a829204eb82b392fc6d6
2013-09-05touch devices: Disable touch on softlock.Jean-Louis Biasini1-0/+5
Target that have a touchpad/touchscreen should disable it while being locked (In order to avoid LCD to drain battery power due to "key locked" constant reporting messages. If they a have a keylock button this was already handled at driver level. If not (e.g. fuze+), they will have to implement a switch at driver level that action.c can operate on softlock. This patch does the following for any target having a touchpad or a touchscreen and no HAS_BUTTON_HOLD (ie any softlock target) 1) it implements the code to call button_enable_touch(bool en) in action.c. 2) button_enable_touch is implemented in button.c and call either touchpad_enable or touchscreen_enable 3) those two function are implemented respectively in touchscreen.c and a new touchpad.c file. They provide a generic way to silents touch's device and call a function at driver level where target specific code can be implemented if possible/needed (for power saving for instance). Those function name are touchpad_enable_device and touchscreen_enable_device 4) we implement an empty function at driver level of targets that need it to have them still being able to compiled. Change-Id: I9ead78a25bd33466a8533f5b9f259b395cb5ce49 Reviewed-on: http://gerrit.rockbox.org/569 Reviewed-by: Thomas Martitz <kugel@rockbox.org> Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2013-04-01android: Rewrite PCM playback without OnPlaybackPositionUpdateListener.Thomas Martitz1-8/+12
The old way actually mis-used the API (I misunderstood the docs) because it specified the marker position as a "low buffer watermark" but instead of a future playback head position. The replacement is a simple thread that writes the data regardless of the filling level of the buffer (write() will just block) and polls the playback state periodically. Change-Id: If29237cee4ce78dc42f5a8320878bab0cafe78f7 Reviewed-on: http://gerrit.rockbox.org/422 Tested-by: Dominik Riebeling <Dominik.Riebeling@gmail.com> Reviewed-by: Thomas Martitz <kugel@rockbox.org>
2012-04-05touchscreen: Fix kinetic scrolling when the statusbar is off.Thomas Martitz2-3/+1
The scrolling code cannot differentiate between the BUTTON_TOUCHSCREEN post from normal touches and the one posted in the timeout callback. To fix introduce a global special button (BUTTON_REDRAW) that results in the desired redraw. This existed already as a local kludge for android and is now generalized. Change-Id: I6bfa6c66431c48f5042fcd8fce2ea72cd3457f58
2012-03-30android: implement system_exception_wait and system_reboot, so that the ↵Thomas Martitz1-2/+12
panicf() screen can be exited. Change-Id: I1fb095a7ae01a99c84722eeec199b1007b0f6088
2012-03-22android: lcd_update/_rect() changesThomas Martitz1-17/+35
* rename some java methods (to update(), initialize()) * re-create the ByteBuffer object from the framebuffer on every update. This is needed now since 2c71aa9 added the possiblity for lcd_framebuffer to change. * do so, along with the creation of the dirty Rect object, in native code. Change-Id: Id39ea8e4b6148987c5f216a87e0ff3c8e7babe92
2012-03-22android: Add facility for java code to wait native code to be ready.Thomas Martitz5-2/+62
Especially when unzipping rockbox.zip, the native code can be initialized a lot later than the java code. The java code needs to be prevented from accessing rockbox structures (e.g. current_tick, event queues) before they're ready. This commit adds wait_rockbox_ready() and fixes dodgy behavior of starting rockbox via widget play button, headset remote buttons or multimedia keys. Also fixes wrong small list items before first redraw. Change-Id: I1caf925e829a9c1c6bb6e0016d5c80574574c91e
2012-03-04Tweak some PCM drivers for less typecasting with the data pointer.Michael Sevakis1-4/+4
Yeah, sizeof (void) here with GCC is 1. If something has a problem with that, we'll set it straight. Change-Id: I9ad3eee75dd440f6404a04a501d1533c8bc18ba9
2012-03-03android: drop copied lcd_blit_yuv() and use generic one.Thomas Martitz1-205/+0
Change-Id: I1b9728b138c05c59867ba06370186b2fa5a7c9fd
2012-03-03Revise the PCM callback system after adding multichannel audio.Michael Sevakis1-8/+8
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-02-28lcd drivers: Convert lcd_[remote_]framebuffer to a pointerJonathan Gordon1-3/+3
Change all lcd drivers to using a pointer to the static framebuffer instead of directly accessing the static array. This will let us later do fun things like dynamic framebuffer sizes (RaaA) or ability to use different buffers for different layers (dynamic skin backdrops!) Change-Id: I0a4d58a9d7b55e6c932131b929e5d4c9f9414b06
2012-01-22Create fimrware/asm directory for assembly optimized stuff.Thomas Martitz1-4/+1
This dir is suitable for stuff that doesn't fit the target tree, e.g. because it also builds on hosted or otherwise. It also has a generic subfolder for fallback C implementations so that not all archs need to provide asm files. SOURCES should only contain "foo.c" where foo.c includes the specific <arch>/foo.c files from the subdirs using the preprocessor. This way automatic selection of asm versions or generic C verion is possible. For the start, the thread support files are moved, since ASM threads can be used on hosted platforms as well. Since core_sleep() remains platform specific it's moved to the corresponding system.h headers. Change-Id: Iebff272f3407a6eaafeb7656ceb0ae9eca3f7cb9
2012-01-21android/ypr0: Merge lc-*.c to generic lc-unix.c.Thomas Martitz1-40/+0
Change-Id: Ica76dec903486c32fda8355acdc58f0315c4d384
2012-01-21android/ypr0: Merge fs-*.c to generic filesystem-unix.c.Thomas Martitz2-149/+1
Change-Id: I52e2c29346baf0d282243880477cd149311ce3d1
2012-01-21android/ypr0: Merge kernel-*.c to generic kernel-unix.c.Thomas Martitz2-126/+2
Change-Id: Ife3fceb53829ef4e13bae73d8d2f10d7e56d484d
2012-01-08remove cargo-cult empty i2c-target.hRafaël Carré1-25/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31624 a1c6a512-1295-4272-9138-f99709370657
2012-01-08adc-target.h: cleanupRafaël Carré1-25/+0
move adc_close() prototype to adc.h don't duplicate prototypes of adc.h remove license header and guards for a single include of another file or for empty content git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31623 a1c6a512-1295-4272-9138-f99709370657
2012-01-08button-target.h : move prototypes to button.hRafaël Carré1-7/+0
no need to define BUTTON_REMOTE anymore git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31620 a1c6a512-1295-4272-9138-f99709370657
2012-01-04android: move pcm_shutdown() to audiohw_close() now that it's properly ↵Thomas Martitz1-3/+0
called from powermgmt. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31551 a1c6a512-1295-4272-9138-f99709370657
2012-01-03Rework powermgmt to enable code re-use on appliation and sims.Thomas Martitz2-22/+8
* Introduce CONFIG_BATTERY_MEASURE define, to allow targets (application) to break powermgmt.c's assumption about the ability to read battery voltage. There's now additionally percentage (android) and remaining time measure (maemo). No measure at all also works (sdl app). If voltage can't be measured, then battery_level() is king and it'll be used for power_history and runtime estimation. * Implement target's API in the simulator, i.e. _battery_voltage(), so it doesn't need to implement it's own powermgmt.c and other stubs. Now the sim behaves much more like a native target, although it still changes the simulated battery voltage quickly, * Other changes include include renaming battery_adc_voltage() to _battery_voltage(), for consistency with the new target functions and making some of the apps code aware that voltage and runtime estimation is not always available. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31548 a1c6a512-1295-4272-9138-f99709370657
2011-12-31usb-target.h: removeRafaël Carré1-0/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31498 a1c6a512-1295-4272-9138-f99709370657
2011-12-31move usb_pin_init() declaration to PP's system-target.hRafaël Carré1-25/+0
remove duplicate usb_detect() declaration Remove all content from empty usb-target.h files git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31488 a1c6a512-1295-4272-9138-f99709370657
2011-12-17Commit to certain names for cache coherency APIs and discard the aliases.Michael Sevakis1-0/+4
Wouldn't surprise me a bit to get some non-green. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31339 a1c6a512-1295-4272-9138-f99709370657
2011-09-01Shuffle some functions around so that interfacing with playback.c in ↵Michael Sevakis1-1/+1
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-08-14Fix typo in and clarify comment.Thomas Martitz1-2/+2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30309 a1c6a512-1295-4272-9138-f99709370657
2011-08-14Android: Minor changes in ldebugf.Thomas Martitz1-2/+3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30304 a1c6a512-1295-4272-9138-f99709370657
2011-08-14Remove hosted_get_volume(), as event data is available in button_get_data().Thomas Martitz1-16/+3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30300 a1c6a512-1295-4272-9138-f99709370657
2011-07-22Android: Fix crash on start up.Thomas Martitz1-3/+3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30190 a1c6a512-1295-4272-9138-f99709370657
2011-07-19Android: Change headphone detection to call into native.Thomas Martitz2-15/+25
Making a JNI call from tick tasks is not permitted as the underlying thread is not attached to the Java VM. This is an error and crashes in the emulator (which has stricter JNI checks enabled by default). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30173 a1c6a512-1295-4272-9138-f99709370657
2011-07-18Android: Refactor some of the glue code.Thomas Martitz3-35/+37
* Cleanup RockboxService.java by moving the battery and headphone monitors to separate classes and detaching their instances * Move those monitors and RockboxTelephony.java into a new monitors subdirectory * Call those monitors all the same from native code by creating the objects there git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30160 a1c6a512-1295-4272-9138-f99709370657
2011-06-29Commit FS#12150 - Fully-functional audio mixer - and finally whip old ↵Michael Sevakis1-2/+52
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-05Android: Greatly simplify the pcm callback mechanism on both, the Java and ↵Thomas Martitz1-49/+34
the C side. Should be more reliable now (if the old wasn't already). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29963 a1c6a512-1295-4272-9138-f99709370657
2011-06-04Android: implement headphone detection thus enabling pause on unplug (FS#12097).Dominik Riebeling1-0/+28
Listen to headphone plug events. There are currently two glitches with this: - Android takes a while until it reports the unplug event, so there will be some delay until playback gets paused. This is an Android limitation. - Rockbox debounces headphone state changes for one second. Therefore playback will shortly be routed to the speaker on unplug until Rockbox does the actual pause. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29956 a1c6a512-1295-4272-9138-f99709370657
2011-05-29Fix an implicit declaration warning.Dominik Riebeling1-2/+3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29930 a1c6a512-1295-4272-9138-f99709370657