I have an embedded device which has Wifi and Audio capabilities. I want to make my Android phone communicate to it using RTP. I have already tried Mobile to Mobile RTP audio communications. That works like charm. But now I want to try, one side Android and other side this embedded device. Could anyone point me to the source code (simple one as less RAM in embedded device) of basic RTP.
I am using ffmpeg on Windows PC to simulate the embedded device. When I "join()" the RTP from my Android, I get the error as 0x64 wrong protocol type.
If I get a basic handshake between the devices for audio, it will be great.
Related
I'm using libVLC in my Android app to stream video over rtsp from the camera that I'm connected to over WiFi.
In general, streaming works fine, but there seems to be streaming problem if I'm connected do the camera by WiFi (that provides no internet) and also have got mobile data turned on. I use bindProcessToNetwork to make sure that the streaming is done via my WiFi network. On some devices (like Huawei Mate 10 with Android 9) the streaming works ok (it seems to use WiFi and ignore having mobile data on), but on other devices (like Samsung Note 10 with Android 10) when I use new networking API it seems that VLC is trying to connect via the mobile data, and only after some time when it fails it decides to use my camera's WiFi (despite the fact that I used bindProcessToNetwork).
I get an error log
VLC-std: Unable to determine our source address: This computer has an invalid IP address: 0.0.0.0
Suprisingly, it works fine if I connect to my WiFi from the system settings...
I found some comments that media streaming is done in a separate process, and it ignores calling to bindProcessToNetwork but on some devices (and Android versions) is seems to work and on others it does not.
I already asked this question on the Videolan forum, but with no luck.
Is there a way to force libVLC to stream using a specified network?
I don't think LibVLC can do this, and it's a bit out of scope of a multimedia framework.
I would handle this on the app side if I were you, using something like How do I connect to a specific Wi-Fi network in Android programmatically?
I'm going through the WebRTC tutorial, and trying to setup their sample code.
Problem is, i do not have a webcam. I quickly realized that my Android phone can be used as a webcam using an App called IP Webcam, which transmits the video via wifi to my computer(which can be viewed in a special address).
Is there anyway, that this can be recognized and used by getUserMedia?
I'm using this sample code from he tutorial:
https://codelabs.developers.google.com/codelabs/webrtc-web/#3
When i run it, i get this error:
code: 8 message: "Requested device not found" name: "NotFoundError"
Is there any way to make WebRTC aware of the connected phone?
I'm using Windows 7, latest Chrome, and serving the sample code via Xampp(if any of it matters)
I'm recording (external and internal) sensor data on my Android tablet. Now I would like to stream these recorded sensor data over internet to my notebook / PC and display a graph of the data there. I have found this nice tutorial: http://simena86.github.io/blog/2013/04/30/logging-accelerometer-from-android-to-pc/
In this tutorial the data is streamed from Android over sockets to a python application which in turn uses a Perl script for plotting (I have never used perl before).
Now I would also like to stream the tablet display as well as the front cam recording (i.e. video data) from the tablet to the notebook / PC. Is there an easy way for doing this or can the above method be altered to achieve this?
Use a VNC server on your tablet. There are several out there; I've used Alpha VNC. Then on the computer use a VNC viewer such as RealVNC to connect to it, and this will allow you to view the tablet screen on the PC.
I need to be able to send and receive audio over bluetooth and it seems A2DP is the thing that does this
Using the code given here, I managed to get my phone to detect and pair with the remote bluetooth device, then establish an A2DP connection which sent all the audio output of the android device to the remote one via bluetooth
I was previously able to do such two way data communication with the same remote bluetooth device via RFCOMM (the android phone needed to be the one initiating the communication though, I could not do it through the remote device though I know it is possible). Once the RFCOMM link was established, the android device could send data to the remote device, as well as receive data from it
What I need now is something similar, but for audio (preferrably using A2DP, but I am open to using whatever else, as long as it gets the job done). While snooping around SO I've got hints that receiving audio data on phone (at least an unrooted normal one, rooting is not an option for me) via A2DP is not possible (see for example, here). But I have also seen headsets that allow making phone calls entirely through bluetooth (well, wirelessly actually, I am assuming it must be bluetooth). For example, for an incoming call, you can just press a button on the bluetooth earpiece, then you can talk as well as listen to the other party. If a phone cannot be used as an audio sink, how do such headsets do it?
I need some ideas on how I should go about writing an android app to send as well as receive audio data via bluetooth (for simplicity lets consider it similar to the Bluechat sample program, but involving audio instead of text). Is it possible at all (through java)? Is it possible only through NDK? How do the devices on the market do it? Is it a different profile than A2DP?
PS: My test devices are Samsung Galaxy 2 (phone) with Gingerbread and Asus Nexus 7 (tablet) with KitKat. Incidentally the remote bluetooth device (it is a development board) comes with a sample project that is supposed to turn the board into an A2DP audio source. if I run this sample project on the board, using the phone's and tablet's built-in bluetooth settings, I can sort of pair with the remote board, but the android devices do not receive any audio.
There are two different A2DP profiles, A2DP source and A2DP sink. The A2DP source profile is supported by Android thus allowing you to stream music from your device to a sink like a bluetooth speaker. To my knowledge the A2DP sink profile is not enabled, which is why you're unable to stream music to your mobile phone and have it act as a speaker. I only know this from having googled around some time ago so things may have changed.
It is possible to enable the A2DP sink profile by editing /etc/bluetooth/audio.conf and rebooting your phone. Unfortunately this has the side-effect of disabling the A2DP source profile and thus cannot be used in a widely distributed app. The other downside is that there is not much of a java software stack for working with that profile so you'd have to do quite a bit of work to get things rolling.
To answer your question as to why a headset is able to connect to the Android, that is because headsets use a different profile called Headset profile (HSP), commonly used by headsets, or Handsfree profile (HFP) commonly used in cars. Both profiles have two sides: a client side and the gateway side (mobile phone). The audio quality of both of these profiles is considered voice quality. 8 or 16kHz sample rates and a crappy codec. There is also a lot of protocol for answering/making calls, etc... I'm not sure if you'd even get audio to transmit without an active connection to the phone network.
For A2DP Sink support -
Yes. It is possible. I have done it in Android JB.
Android device as a receiver for A2DP profile - Please read my reply.
I'd like to write an Android app that will run Tablet that can connect to my phone using A2DP and stream music from the phone.
The Android tablet will replace my car's stereo and navigation system.
I have already read quite a bit on Android Bluetooth API, I have imported a number of sample apps and more I read more I have the impression that the Android API only allows me to 'send' the music stream and not to 'receive' it as I'd like.
Does anyone have any toughs or ideas on this?
Regards