Is there any dvb-t library for android? - android

I have an android STB and I'd like to know if there is any library with I can use the built in DVB-T tuner?
Thanks in advance!

No, there is no DVB-T library for android.
However, you can develop your own:
Firstly, is your DVB-T device supported by the kernel? To check, see if DVB related debug comes out of dmesg when you boot up the box. Also, ls /dev/dvb* to see what is already there.
If there is no DVB support in the kernel, you will need to add it. First you need access to the kernel source. Using this, modify the kernel menuconfig to add DVB related modules, and specific ones for your tuner - sometimes some Remote Control ones are required also. Then build these modules, and insmod the modules on the box. Sometimes firmware is required too. Check the initial check again.
Then you can cross-compile dvb-apps for android (specifically tzap), or the newer v4l-utils for android. This gives you c code to tune to DVB-T transponders. Then write some JNI to access the API from Java, and create an app to perform tuning.
Finally, you can send a URI to the /dev/dvb0.dvr0, to a third-party video player like VLC. This is a TS stream containing MPEG-2 for SD, and H264 for HD.
As you can see, it is a lot of work, but entirely possible.

Related

FUSE (Filesystem in Userspace) support on Android

I'm trying an app that require to enable a cloud based file system to my device. For this I've to have FUSE support in my Android device . I'm using Android version 4.4.2 on a Asus tablet. However I searched a lot but couldn't find some satisfactory answer to ensure that whether Android support Fuse. Thus I have few question as below ,
1.According to my search result When I run cat /proc/filesystems on an app (Terminal Emulator for Android) that provides Linux terminal I found the result of cat shows "Fuse" there . Is that mean my system support Fuse interface to allow install an user space file system ?
I also found in some forum either Fuse should come as built inside kernel or it should be as fuse.ko module under /system/lib/module . But my system doesn't contain fuse.ko hence does it mean I don't have fuse ?
In short, my question is how to ensure FUSE on android device ? I'm a beginner in Android programming so any help is much appreciated . Thanks in advance.
Modern versions of Android utilize Fuse internally, for example to implement the emulated External Storage.
However, Android is locked down and so neither 3rd party applications, not in most cases the human user, are allowed to add additional filesystems.
For stock Android the only choice will be to implement file-system-like operations within application code, creating a private API that replicates basic file operations, without actually using any files. Anywhere in the code you are writing or porting and need to access one of the remote "files", you would substitute your API for the actual file one. A good example of this would be Android assets - they look a lot like files and have many similar operations, but at runtime they actually are not files but an Android-unique storage mechanism.
Anything else would require modifying Android away from stock configuration (ie, root hacks, etc).
To check what your version of Android on your device supports, download a terminal emulator, and from the command line, run the following snippet of commands minus the parentheses...
"cat /proc/filesystems"
And scroll through the results looking for fuse. This will be a list of supported filesystems weather it be compiled into the kernel or loadable module.

Android call recording using ALSA / CAF

I'm writing a small call recording library for my rooted phone.
I saw in some application that recording is done through ALSA or CAF on rooted phones.
I couldn't find any example / tutorial on how to use ALSA or CAF for call recording (or even for audio recording for that matter).
I saw tinyAlsa lib project, but I couldn't figure how to use it in an android app.
Can someone please show me some tutorial or code example on how to integrate ALSA or CAF in an Android application?
Update
I managed to wrap tinyAlsa with JNI calls. However, calls like mixer_open(0) returns null pointers, and calls like pcm_open(...) returns a pointer but subsequent call to is_pcm_ready(pcm) always returns false.
Am I doing something wrong? Am I missing something?
Here's how to build ALSA lib using the Android's toolchain.
and here you can find another repo mentioning ALSA for android
I suggest you to read this post on order to understand what are your choices and the current platform situation.
EDIT after comments:
I think that you need to implement your solution with tinyalsa assuming by you are using the base ALSA implementation. If the tiny version is missing something then you may need to ask the author (but it sounds strange to me, because you are doing basic operations).
After reading this post, we can get some clues about why root is needed (accessing protected mount points).
Keep us updated with your progress, it's an interesting topic!

Android, msm_pcm_out device and ALSA lib

Could anyone tell me if it is possible to use alsa lib directly in native C code in Android?
Because I must receive raw data from native C code socket fd, I think it is better to play it out in native C, too. I have searched a lot and found that I could play pcm data directly by using msm_pcm_out device, but I could not find this device in my platform. So my last choice is using alsa lib. My questions are:
Could I add msm_pcm_out device by myself ? And use it just like the sample playwav.c?
If adding the msm_pcm_out device is not possible, could I use alsa lib in native C?
If all I mentioned above are impossible, any suggestion?
Thank you.
Search result :
MSM_PCM_* are the specified devices in Qualcomm MSM7K series chip, so other platform would not have this !
It seems that using ALSA lib directly in native C is not possible because the ALSA resource would be engaged by system.
Update : Use ALSA API to do the play would not work, but record works ! (Strange...)
My last choice might be using the OpenSL ES...
Any suggestion would be appreciated.

Android Linux system call List

Does anyone know where I can find the list of system call that can be used in Android Mobile phones? I guess that looking to the kernel should work, but I cannot find any *.h or *.c with the declaration of them.
Best regards
You primarily want section 2 of the linux kernel manual pages.
Very little is unique to Android, the few gotchas being in the android docs (no sys-V IPC, AF_INET sockets won't work unless you are in the network group, etc). Most of the android additions are drivers (Binder, etc) and novel usage patterns (for example of user IDs) rather than actual syscalls.
If you actually need the syscall numbers you can find them in bionic/libc/SYSCALLS.TXT within the sources
You may want to check the Bionic sources for the system call list. Since, Bionic is the C-Library, that Android works off.
Try here
It is located in SYSCALLS.TXT file inside of libc directory under certain Android version. Example above is system call on Android 11.

How do I use Android OpenCORE codecs using JNI?

I want to use the codecs in Android from my application. For now I just want to use the H.264 codec for testing, unless the mp3 or aac codecs provide functions for sending the audio to the device's speaker in which case I would prefer one of those.
I have the NDK installed along with Cygwin, GNU Make, and GNU Awk. I can't figure out what I need to do from here though. I'm downloading the entire OpenCORE tree right now but I don't even know how to build it or make Eclipse plugin know it needs to include the files.
An example or a tutorial would be much appreciated.
EDIT:
It looks like I can use JNI like P/Invoke which would mean I don't have to build the OpenCORE libraries myself. However, I can't find any documentation on the names of the libraries I need to load.
I'm also confused as to how to do it. I'm looking at http://www.koushikdutta.com/2009/01/jni-in-android-and-foreword-of-why-jni.html and I don't understand what the purpose of writing a library to access a library is. Couldn't you just use something like System.loadLibrary("opencore.so")?
You cannot build opencore seperately. It has to be built with whole source code. What are you trying to acheive. If you just want to play a video/audio, use VideoView or MediaPlayer object.
Build the Android source and use the headers and the static library from it. This will propel you straight to the zone of unsupported APIs.

Categories

Resources