NVidia Shield

You might have to use NDK r8b in order to compile FBA.

NDK r9 has many compiler/toolchain regressions it seems.

I would report them to Google if I were you so that they can actually start addressing most of these issues - ever since version NDK r8b more and more internal compiler errors seem to have popped up.

$199 Tegra 4 tabs http://blogs.nvidia.com/blog/2013/09/18/tegra-note/

Looks interesting if they perform anything like the Shield.

You can compile FBA with NDK r9 if you type “export NDK_TOOLCHAIN_VERSION=clang”. Afterwards, I recommend setting NDK_TOOLCHAIN_VERSION to 4.8 to set the compiler back to GCC 4.8.1. It’s sad that we need these hacks to make this work, though, Google really needs to work on getting a stable NDK toolchain to the masses.

Spot on, I changed the NDK to r8b and it worked fine, thanks !

Thanks I’ll give that a try but for now I just switched to the r8b and it built fine

I’m now trying to look at the netplay code, and see how to integrate it with the android build. Of course for now I don’t understand much of the code base, but if you guys have any idea where I should look at it would be helpful.

Am I correct when I assume that the netplay code need to be build in both the core and the libretro api ?

Ok I did some work and I’m getting close:

  • build the native part with the netplay enabled: (btw not sure I needed it too but I saw -DHAVE_NETWORK_CMD) ifeq ($(HAVE_NETPLAY), 1) LOCAL_CFLAGS += -DHAVE_NETPLAY endif

  • updated the UI in prefs.xml: <PreferenceCategory android:title=“Netplay Configuration” > <CheckBoxPreference android:defaultValue=“false” android:key=“netplay_enable” android:summary=“Enable Netplay for 2 Players” android:title=“Enable Netplay” /> <CheckBoxPreference android:key=“is_server” …

  • added the writing of these data in updateConfigFile(): boolean netplayEnabled = prefs.getBoolean(“netplay_enable”, false);

      if (netplayEnabled) {
      	
      	config.setBoolean("is_server", prefs.getBoolean("is_server", true ));
    

Now I have some useful values in /data/data/org.retroarch/retroarch.cfg, I guess I just need to modify the code where this file is parsed before invoking the library so it can pass “-C 10.0.0.1 --port 55435 -F 2 --nick duked” to lib_fba for example.

Squarepusher any clue ?

got the whole thing to build but now it doesnt work :confused:

I get the following message “Failed to init netplay …” that comes from that code: if (g_extern.msg_queue) { msg_queue_push(g_extern.msg_queue, “Failed to init netplay …”, 0, 180); }

Any idea ?

Still can’t get mame139 to build for Android. memory.h fails to compile saying it can’t find the definitions for UINT32 UINT64… etc. Which header are these located in? I tried to grep for it, but I couldn’t seem to find the definitions.

EDIT: Duked, not sure, that snippet doesn’t help too much with diagnosing the problem. Is your code on Github? I wouldn’t mind trying to hack at it to make it work. I’m very interested in Netplay on Android and I own an nVidia Shield too.

Crap, I ran into the same problem again with save files that I had with my s3. I was playing Grandia using PCSX-reARMed and after an hour or so, saved my game, hit the home button and put the Shield to sleep by folding the thing. After 30mins, I decided to continue my save so I opened up retroarch again and instead of continuing whatever was previously running (which I thought is what would happen), the emulator reset and reloaded the game again. My current memcard save was gone too and what was there was my last save which was only 10 minutes into the game, so I basically lost an hour worth of saved gameplay (good thing I didn’t play longer).

I guess this is again because retroarch only writes the save files to memory when you actually exit the emulator after saving? Is retroarch resetting after the shield wakes up from sleep mode also normal?

Finally got that stupid thing to work :wink: I/RetroArch: ( 7938): 100 I/RetroArch: ( 7938): Waiting for client…

Will do some more test tomorrow and clean a bit and will make the apk and source available.

MP2E: I don’t have a github account but I’ll setup one with my changes.

From the android emulator (running itself in a linux VM) to my shield it disconnects often I/RetroArch: ( 9197): Connecting to netplay host… I/RetroArch: ( 9197): Connected to: “Player 1 Android” I/RetroArch: ( 9197): Set audio input rate to: 32040.00 Hz. I/RetroArch [ERROR] :: ( 9197): Failed to open directory: “/data/data/org.retroarch/shaders_glsl/” I/RetroArch: ( 9197): Adjusting aspect ratio to 1.60 I/RetroArch: ( 9197): Video @ 1152x720 I/RetroArch: ( 9197): Starting threaded video driver … I/RetroArch: ( 9197): Initializing context I/RetroArch: ( 9197): [ANDROID/EGL]: EGL version: 1.4 D/ ( 9197): HostConnection::get() New Host Connection established 0x2a2dc578, tid 9263 I/RetroArch: ( 9197): Found GL context: android I/RetroArch: ( 9197): Detecting screen resolution 768x1184. I/RetroArch: ( 9197): gfx_ctx_set_swap_interval(1). I/RetroArch: ( 9197): [GL]: Vendor: Google (VMware, Inc.), Renderer: Android Emulator OpenGL ES Translator (Gallium 0.4 on SVGA3D; build: RELEASE; ). I/RetroArch: ( 9197): Querying GL extension: BGRA8888 => doesn’t exist I/RetroArch [WARN] :: ( 9197): [GL]: GLES implementation does not have BGRA8888 extension. I/RetroArch [WARN] :: ( 9197): 32-bit path will require conversion. I/RetroArch: ( 9197): GL: Using resolution 768x1184 I/RetroArch: ( 9197): [GL]: Using GLSL shader backend. I/RetroArch [WARN] :: ( 9197): [GL]: Stock GLSL shaders will be used. I/RetroArch: ( 9197): Found GLSL vertex shader. I/RetroArch: ( 9197): Found GLSL fragment shader. I/RetroArch: ( 9197): Linking GLSL program. I/RetroArch: ( 9197): Found GLSL vertex shader. I/RetroArch: ( 9197): Found GLSL fragment shader. I/RetroArch: ( 9197): Linking GLSL program. I/RetroArch: ( 9197): Found GLSL vertex shader. I/RetroArch: ( 9197): Found GLSL fragment shader. I/RetroArch: ( 9197): Linking GLSL program. I/RetroArch: ( 9197): GL: Using 4 textures. I/RetroArch: ( 9197): GL: Loaded 1 program(s). I/RetroArch: ( 9197): Using font rendering backend: bitmap. I/RetroArch: ( 9197): Graphics driver did not initialize an input driver. Attempting to pick a suitable driver. I/RetroArch: ( 9197): Setting engine_handle_dpad to ‘Get Axis Value’ (for reading extra analog sticks) I/RetroArch: ( 9197): [RPNG]: Using RPNG loader. I/RetroArch: ( 9197): [RPNG]: Using RPNG loader. I/RetroArch: ( 9197): [RPNG]: Using RPNG loader. I/RetroArch: ( 9197): [CPUID]: NEON: 1 I/RetroArch: ( 9197): [SLES] : Setting audio latency (buffer size: [12288]) … I/RetroArch: ( 9197): [CPUID]: NEON: 1 I/RetroArch: ( 9197): Sinc resampler [NEON] I/RetroArch: ( 9197): SINC params (12 phase bits, 8 taps). I/RetroArch: ( 9197): SRAM will not be saved. I/RetroArch: ( 9197): rarch_main_init_wrap() succeeded. I/RetroArch: ( 9197): Network is stalling, resending packet… Count 4 of 16 … I/RetroArch: ( 9197): Network is stalling, resending packet… Count 5 of 16 …

Guessing from the log you posted, perhaps the emulator doesn’t have enough power to keep up. What core/cores did you try? Perhaps building an x86 RetroArch build for android and using these instructions to set up a more native android AVD would be a sufficient increase in speed.

@georaldc Dunno about the resetting thing, but yeah, it sounds like the same saving issue. I would recommend turning on autosaving. Then, you can just close up as normal/convenient, then load up the savestate when you come back and you’ll only lose a few seconds or whatever your save interval is set to.

@Duked Nice :smiley:

I would recommend starting with very lightweight cores to minimize the potential of performance issues to mess things up. Gambatte runs very fast and I think works with netplay. You might also try connecting to a regular PC instance of RetroArch rather than running it through an Android emulator.

Getting an odd bug in the latest RetroArch for the Nvidia Shield. This is a really strange one, but when I try to change the “Device” in the “Input Options”, at random times it will auto-scroll. I mean, it will go to the left or right(not sure which) endlessly until I press one of the direction buttons. I figured this out because I was trying to connect my new Moga Pro controller to my Shield to have it act like a console and hook it up to my TV and play some game on it. Can someone else try changing the “Device” in the “Input Options” inside a currently running core such as PCSX? I hope I’m not the only one getting this weird bug.

Here is the Apk, you can set it up in Settings under Netplay.

https://mega.co.nz/#!HEIWgD6L!G-NG8zPXP88D4FBxkyZfMiZGgYwGnv-cBOp7i84_o64

By default you host the game unless you tick client. If you have an issue when hosting make sure there’s nothing setup for the host (that is only to connect as a client).

I’m looking for someone else with a shield to give it a try online :wink:

Ideally if I have enough time I would like to have a lobby pretty much like GGPO/supercade, did someone start the work on the backend ?

Thanks for the suggestion. I tried just that and I don’t think it actually helps. It looks like autosaves only kick in when I exit the game, and not when I just hit the home button and put the Shield to sleep (which is my problem in the first place. I keep forgetting to actually exit the game/core that’s running and assume that my saves are being written T_T). Am I assuming things right away, or is there something I’m missing (like maybe it auto saves in set intervals or something)?

Also, are autosaves separate from normal savestates? It looks like I can only get the autosave to load by checking the “Auto load state” option as well

Yeah I have that behavior too, they are not the same just different extension. It would be cool if you could load them manually (auto - 0,1,2,3,4,5,6,…) I don’t like autoloading since I play on different devices and somethimes autoloading causes me to lose some progress saved via in-game saves

Hi i would be happy to help.

Sorry for delay , i completly miss this post.

Now i remember having this pb with memory.h when i builded some others emulators for android . the pb is a “naming clashing” because ndk include in stdlib.h memory.h ( which is BTW a blank header ) so the pb arrive when somewhere in emu they include stdlib.h and include path found the bad memory.h ( in your case the mame one) in the past ,for other emulator to fix android build i had change all the memory.h to core_memory.h ( and fix all the include in file) . but after having many time this pb , i choose to make a android standalone toolchain and simply comment #include <memory.h> in the stdlib.h header (since it was a blank header).

Yes i know , it was a bad shortcut (which save me lot’s of time) , and for the time i completly forgot it.


/*
 * Copyright (C) 2008 The Android Open Source Project
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */
#ifndef _STDLIB_H_
#define _STDLIB_H_

#include <sys/cdefs.h>

/* wchar_t is required in stdlib.h according to POSIX.
 * note that defining __need_wchar_t prevents stddef.h
 * to define all other symbols it does normally */
#define __need_wchar_t
#include <stddef.h>

#include <stddef.h>
#include <string.h>
#include <alloca.h>
#include <strings.h>
//#include <memory.h>