Hi!
according to my first analysis hxxp://forum.xda-developers.com/showthread.php?t=841623 i can say that the key to call recording on the i9000 is in the WM8994 driver.
intro: how does the i9000 do video call recording?
video calls are recorded through an additionally added pcm device .. and controlled by the libvtstack.so (there is some h324 recording function inside, which manages recording).
But how does it the SHW-M100S?
well, the SHW-M100S records through the device 0 (as seen in asound.conf)
------ asound.conf from SWH-M100S ------
pcm.AndroidRecord_Headset_videocall {
type hooks
slave.pcm {
type hw
card 0
device 0
}
hooks.0 {
type ctl_elems
hook_args [
# Enable audio output from the DSP
#{name "Voice Call Path" value 3} # 0:OFF 1:RCV 2:SPK 3:HP 4:BT 5:3POLL
#{name "MIC Path" value 1} # 0:Main Mic 1:Sub MIC
]
}
}
----------------------------------------
------ asound.conf from i9000 jpa ------
pcm.AndroidRecord_Headset_videocall {
type hooks
slave.pcm {
type hw
card 1
device 0
}
hooks.0 {
type ctl_elems
hook_args [
# Enable audio output from the DSP
# Already called codec path by Video call outputstream
#{name "Voice Call Path" value 3} # 0:OFF 1:RCV 2:SPK 3:HP 4:BT
#{name "MIC Path" value 1} # 0:Main Mic 1:Sub MIC
]
}
}
----------------------------------------
notice the difference in the card line!
resume: shw-m100s sets recording (also for normal voice calls) to device 0 and easily records through MediaRecorder.AudioSource.VOICE_CALL whereas the i9000 uses an additional pcm device for (at least) video call recording.
what can we do:
(1) adapt the wm8994 initialization and setup from the shw-m100s to the i9000
pro: can use 3rd party call recorders
con: need to recompile kernel
(2) use the pcm device for voice call recording too
pro: should work with stock i9000 firmware
con: need specific call recording software for i9000
risk: the video call recording funcion in libvtstack.so specificly sets up the pcm device and some of the internals correspond to the call mode. i.e. nothing is got back from the pcm (1) device
i favour alternative one, but i need help to figure out the wm8994 initialization. i'm missing some alsa and wm8994 know how.
anybody able to help?
David
Just in case for those who don't know.
Setting up a build environment for android arm is a like a pain in the ass.
cross compiling was rather painless for the dreambox. i just hate this autoconf, configure, make ****. moreover i hate cygwin.
can anyone tell me why the alsa libs need curses?
and why does ncurses needs such fu**ing hacking.
hxxp://credentiality2.blogspot.com/2010/08/compile-ncurses-for-android.html
but initializing the codec in the wm8994 startup seems to help. The code below was in the pcm startup code.
------
// For initialize codec.
wm8994_write(codec, WM8994_POWER_MANAGEMENT_1, 0x3 << WM8994_VMID_SEL_SHIFT | WM8994_BIAS_ENA);
msleep(50);
wm8994_write(codec, WM8994_POWER_MANAGEMENT_1, WM8994_VMID_SEL_NORMAL | WM8994_BIAS_ENA);
wm8994_write(codec,WM8994_OVERSAMPLING, 0x0000);
wm8994_write( codec,WM8994_FLL1_CONTROL_2, 0x0700 );
wm8994_write( codec,WM8994_FLL1_CONTROL_3, 0x86C2 );
wm8994_write( codec,WM8994_FLL1_CONTROL_5, 0x0C88 );
wm8994_write( codec,WM8994_FLL1_CONTROL_4, 0x00E0 );
wm8994_write(codec, WM8994_FLL1_CONTROL_1, WM8994_FLL1_FRACN_ENA |WM8994_FLL1_ENA);
reg = wm8994_read(codec,WM8994_AIF1_CLOCKING_1);
reg |= (WM8994_AIF1CLK_SRC_FLL1 | WM8994_AIF1CLK_ENA); //enable the clocks
wm8994_write(codec, WM8994_AIF1_CLOCKING_1, reg);
//Enable clocks to the Audio core and sysclk of wm8994
reg = wm8994_read(codec, WM8994_CLOCKING_1 );
reg &= ~(WM8994_SYSCLK_SRC_MASK | WM8994_DSP_FSINTCLK_ENA_MASK|WM8994_DSP_FS1CLK_ENA_MASK);
reg |= (WM8994_DSP_FS1CLK_ENA | WM8994_DSP_FSINTCLK_ENA);
wm8994_write(codec,WM8994_CLOCKING_1 ,reg);
------
video recording in video calls is broken now. but who cares.
has anyone has a binary of arecord from the alsa-utils?
David
I believe some asian firmwares have phone call recording build it. Possible to hack into one if those to achieve this result?
Sent from my GT-I9000 using XDA App
rlorange said:
I believe some asian firmwares have phone call recording build it. Possible to hack into one if those to achieve this result?
Sent from my GT-I9000 using XDA App
Click to expand...
Click to collapse
That would be lovely, if anyone can find and port that to an app.
I read on a thread a while back, should have made it a favourite!
I it was a chinese eclair rom, said that on the in-call screen there was a record call button
Sent from my GT-I9000 using XDA App
Update: found the thread via search but don't know how to post a link...
It us the korean pda rom with built in call recording however it seem all radio roms have this ability untapped
Sent from my GT-I9000 using XDA App
apparently meizu m9 which uses the same internals as galaxy s do 2-way recording just fine...
http://androidforums.com/android-lounge/181663-android-phone-call-recording-function.html
Related
Hi,
I hope someone can help me !
I'm trying to programatically make a connection to Bluetooth headset from WM5 device.
Using the GU interface provided on the device, I can
a. discover the headset device, and authenicate
b. Select the headset service, however I'm not certain what is actually
done programatically when perform this selection in the GUI
c. Redirect the audio of the WM5 device to the headset.
This all works fine !
Additionally I seen a lot of programs available to direct the audio of the
device thru the headset, but what I'm missing is the code which
allow me to do things which I currently do via the GUI.
I am now trying to do this all programatically, I've been looking through a
description of the headset profile, it seems to indicate that the AG can
initiate a connection to the HS, the AG is responsible for the creation of :
1. Connection establishment
2. SCO link establishment
In the following code, I think :
BthCreateACLConnection & BthAuthenticate are performing 1
BthCreateSCOConnection is performing 2
CreateFile and DeviceIoControl perform c.
if (ERROR_SUCCESS == BthCreateACLConnection (&b, &h)) {
iRes = BthAuthenticate (&b);
BthCloseConnection (h);
int res = BthCreateSCOConnection (&b, &hSCO);
} else {
iRes = GetLastError ();
MessageBox (hWnd, L"Connection failed", L"Error", MB_OK | MB_TOPMOST);
}
HANDLE h = CreateFile(L"BAG0:",0,0,NULL,OPEN_EXISTING,0,NULL);
if (INVALID_HANDLE_VALUE == h) {
// TODO: Handle failure case where AG is not present
}
BOOL fStatus = DeviceIoControl(h,IOCTL_AG_OPEN_AUDIO,NULL,0,NULL,0,NULL,NULL);
if (FALSE == fStatus) {
// Failed to open BT audio!
} else {
// Success!
}
CloseHandle(h);
I'm currently attempting to make to SCO connection to the BT_ADDR of the
device, as opposed to the socket of the headset service. I'm not certain if
this is correct or not. I get an error code 1229 which means :
An operation was attempted on a nonexistent network connection.
Am I doing something wrong !
Cheers
Paul Grant
Hi
I'm trying to write an app to capture video through integrate cameras using directshow. Now, the prob is though the app is doing this now, but after capture is stopped, encoding takes a loooooong time to complete. The encoder being used is WMV9. Now, the inbuilt camera apps must be doing this differently because they dont take any extra time after capture is stopped. So, any suggestion how to optimize the process (how to use a different encoder, or otherwise) to speed up the capture?
TIA
Just found out that HTC devices ship with a filter named "HTC Source Filter". Somewhere on directx.audio group I found out that someone had delved into it a bit and found that it was a capture filter from HTC (both audio and video). I checked in registry and that is true. So, it must be some optimized filter that we can use for capture.
Now, I tried to enumerate the pins on this capture filter, for which I have to first query for an IPersistPropertyBag interface on this filter (used the clsid of the filter from the registry and CoCreateInstance for it returns S_OK). But the QueryInterface returns E_NOINTERFACE. Any opinions/suggestions here? Because the registry clearyly shows that this is a capture filter. Is there any other way I can use this filter?
---My Code---
HRESULT hResult = S_OK;
IGraphBuilder *pFilterGraph;
ICaptureGraphBuilder2 *pCaptureGraphBuilder;
htcDDR.Data1 = 0xA06DF275;
htcDDR.Data2 = 0xC4F3;
htcDDR.Data3 = 0x46C7;
htcDDR.Data4[0] = 0xB5;
htcDDR.Data4[1] = 0x20;
htcDDR.Data4[2] = 0x3A;
htcDDR.Data4[3] = 0x16;
htcDDR.Data4[4] = 0xB3;
htcDDR.Data4[5] = 0xD1;
htcDDR.Data4[6] = 0xB8;
htcDDR.Data4[7] = 0xC2;
hResult = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC,
IID_IGraphBuilder,(void**)&pFilterGraph);
hResult = CoCreateInstance(CLSID_CaptureGraphBuilder, NULL,
CLSCTX_INPROC, IID_ICaptureGraphBuilder2,
(void**)& pCaptureGraphBuilder);
hResult = pCaptureGraphBuilder->SetFiltergraph( pFilterGraph );
IBaseFilter *pVideoCaptureFilter;
hResult=CoCreateInstance(htcDDR, NULL, CLSCTX_INPROC,
IID_IBaseFilter, (void**)&pVideoCaptureFilter);
IPersistPropertyBag *pPropertyBag;
hResult=pVideoCaptureFilter->QueryInterface( IID_IPersistPropertyBag, (void**) &pPropertyBag );
/* This is where I get the E_NOINTERFACE*/
---------------
Capture Performance on WM 5
Hello shantzg001,
I'm quite new in C++ mobile developpement and have the same problem with the encoding performance of the WM9 encoder. Have you find something new to improve that perfomance or change the default encoder (HTC built in) ?
Thanks
hey thecrets, Im afraid I couldn't...
Hello guys,
I've got an HTC Athena and I find encoded videos are crappy. I'm not a coder, at least I'm not a windows mobile coder, Id just like to know if that would be possible to record videos directly to the microdrive or a SD card in raw mode, so I would encode the video later on my desktop PC.
Do you think a machine like the Athena is powerfull enough to handle video recording in raw mode ? Would the microdrive fast enough ?
Another thing, I can't access more than CIF video mode, is it possible to reach higher resolutions with directshow ?
I know there is a software called coolcamera, but it was not updated since 1 year, and my device is not compatible.
Very very last question, if raw mode is possible, could one of you upload here a release of his proggy ?
Thanks dudes ! I don't expect n95 videos on our devices,but I'm sure it can be really better than what we have.
Hi~
have you solve your problem now? I came across the same problem, and have no idea.
I could be wrong ( or just a moron) but isn't there a webcam program for ppc out there that does exactly what you are trying to create?
@arigold1: If that was directed me, then Yes, there is a webcam program but that is not what I "was" trying to create..I needed to do the recording but not as a webcam but smthing else as part of another project that I was doing at that time..
I discovered this yesterday, in writing a small app to hide TF3D Caller ID so My 3rd party caller ID would be the only one presented on an incoming call.
Here it is as is - limited testing sofar for me it works.
This is in C#:
Hey, I may have a contribution for you. That is Assuming you have not been able to Hide the TF3D (aka Manila) Caller ID on Diamond and TP devices in your custom caller ID code/apps.
As I said I wrote a small stub app to specifically Hide TF3D (Manila) caller ID so your custom / 3rd party Caller ID app would be the only one that appears. Actually Just figured it out yesterday; Have done some limited testing and appears to be working 100% so far. To that end, would like to provide you sample code that I used incase you find it useful.
Note: This is written in C# but the API's can be called in C++ as well.
Includes (from WM6 SDK) for c#:
using Microsoft.WindowsMobile;
using Microsoft.WindowsMobile.Status;
Code run from timer:
if (SystemState.PhoneIncomingCall)
{
//ShowWindow(FindWindow("", "Phone - Incoming"), SW_HIDE);
ShowWindow(FindWindow("PPG_GSMWorkerCls", "PPG_GSMWorker"), SW_HIDE);
ShowWindow(FindWindow("PhoneCanvasWorkerCls", "PhoneCanvasWorker"), SW_HIDE);
ShowWindow(FindWindow("manila", ""), SW_HIDE);
}
else if (SystemState.PhoneCallTalking)
{
ShowWindow(FindWindow("PhoneCanvasWorkerCls", "T - Mobile"), SW_HIDE); // <--Note sure if this is needed / but the Diamond Phone Status has the carrier in win title so did it anyway so only your (custom app status is visible)..
ShowWindow(FindWindow("PhoneCanvasWorkerCls", "PhoneCanvasWorker"), SW_HIDE);
ShowWindow(FindWindow("", "PhoneCanvasWorker"), SW_HIDE);
}
if ((!SystemState.PhoneCallTalking) && (!SystemState.PhoneIncomingCall))
{
//Show manila once hung up- to prevent any possible problems with manila(Just in case).
ShowWindow(FindWindow("manila", ""), SW_SHOW);
}
Hopefully you all have already worked this out and or can do it better then me here. But contributing as I know many have asked this before..
And for those who want the stub app I have attached the CAB here.
So far no battery issues that I known of.. Its as is, but will take any feedback for future updates if requested.
Bump.. So people dont miss this..
Which 3rd party app do you use?
BTW thanks for the contribution
What about video calls. I use S2U2, but it doesn't work with video calls, so the default Caller ID kicks in. What will happen if it's disabled, or is it disabled of video calls .
I use PhoneEx at the moment. I have not tested Video calls, well I can't as we dont have that option in the US. Also not sure if PhoneEx would support it either. So obviously someone could test this in that scenario and see what the results are.
is this program hide my caller id when i call anyone even if my operaor doesnt support this feature for my line
Hi,
I'm developing a better caller name announcement than MSVC.
It's based on espeak for WM build and mortscript.
The announcement works, but not when incoming call ringing, I think WM disable the PlaySound when active call in progress. MSVC pauses the ringtone and plays it's own generated wav, than resumes the ringtone. Can somebody help how can I do it?
Here is the current mortscript:
While (1)
IsCalling = RegRead("HKLM", "System\State\Phone", "Incoming Call ID Status")
if (IsCalling > 0)
name = RegRead("HKLM", "System\State\Phone", "Last Incoming Caller Name")
run ("\Program Files\eSpeak\espeak.exe","-v hu -w \MUSIC\test2.wav ""call from: " & name & """")
PlaySound "\MUSIC\test2.wav"
Vibrate( 10 )
endif
sleep(1000)
EndWhile
I think it's an excellent idea, considering that MSVC sucks at announcing caller names. I really don't know the inner workings of WM vs. Mortscript functions, but if it's a reg key that WM changes during active call, it should be possible to track which one it is with SKTracker.
Or, You could try using the playsound.exe from here - http://forum.xda-developers.com/showthread.php?p=6288343. Maybe this one works during call, I don't know.
I presume You have disabled the WM incoming call ring, but why not let the system take care of the vibration? Because Mortscript says the script is paused until playing the sound finishes.
And since I couldn't find espeak for WM, could You kindly point me to it?
Thanks.
Download: eSpeak.zip
Thanks!
Might I ask where did it come from? I found the sourceforge page with espeak but there's no WM version there. Did You compile it Yourself? And for some reason the Estonian language (the one that I actually need) is thrown out from the WinCE version? I think I can use the one from PC version (haven't tried yet tho), but just curious about why
I fetched it from here. This link was provided there.
OK, thanks! I found that it probably originates from here: http://www.efficasoft.com/gpsutilities/index_wm_ppc_resources.html
Re:
Unfortunately this playsound didn't work too.
The incoming call event has higher priority than normal apps and it mutes all other application.
I'm trying to determine how MSVC works, but I'm not enough for this.
Thanks for the advise!
aiiro said:
Or, You could try using the playsound.exe from here - http://forum.xda-developers.com/showthread.php?p=6288343. Maybe this one works during call, I don't know.
Click to expand...
Click to collapse
Damn MS then... Too bad.
Hi and first thank you for reading my question!
I have a device, which gives me an output of essentially just a RS232 serial signal (1200 baud, 8 databits, no parity bits, one stop bit). This output comes in to my android phone via the 3.5mm audio jack.
I want to store every data bit into a variable, display or calculate something and when the next bits come in, it should override the variable.
I know exactly what to do with it after I thave the databits in variables but I have no idea on how to do the basic input / stream / read from audio jack thing...
More informations about my signal The payload is transmitted in 9 byte packets:
Code:
1: command byte as ASCII character ('I','A','S','L','R','C' or ' ')
2-6: time in ASCII chars (2:34:56)
7: checksum (64 + sum of time digits)
8: CR (carriage return, ASCII code 0x0D)
9: LF (line feed, ASCII code 0x0A)
I also think I have to store the input into a buffer and then read the signals from the buffer... But how do I write serial input from audio jack into a buffer?
Maybe something like this will work:
Code:
try
{
int N = AudioRecord.getMinBufferSize(8000,AudioFormat.CHANNEL_IN_MONO,AudioFormat.ENCODING_PCM_16BIT);
recorder = new AudioRecord(AudioSource.MIC, 1200, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT, N*10);
track = new AudioTrack(AudioManager.STREAM_MUSIC, 1200,
AudioFormat.CHANNEL_OUT_MONO, AudioFormat.ENCODING_PCM_16BIT, N*10, AudioTrack.MODE_STREAM);
recorder.startRecording();
track.play();
/*
* Loops until something outside of this thread stops it.
* Reads the data from the recorder and writes it to the audio track for playback.
*/
while(!stopped)
{
Log.i("Map", "Writing new data to buffer");
short[] buffer = buffers[ix++ % buffers.length];
N = recorder.read(buffer,0,buffer.length);
track.write(buffer, 0, buffer.length);
}
}
catch(Throwable x)
{
Log.w("Audio", "Error reading voice audio", x);
}
/*
* Frees the thread's resources after the loop completes so that it can be run again
*/
finally
{
recorder.stop();
recorder.release();
track.stop();
track.release();
}
}
Please help me, thank you!