VoIP building blocks .)

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
mrn
Posts: 116
Joined: Wed Nov 02, 2005 2:26 am

VoIP building blocks .)

Post by mrn »

this is a thread to collect ideas / requirements/ for a possible Voice Over IP
application.

Please do not attack or lock this thread only because you think it is "impossible"
instead, send us your ideas, links, pieces of code, and comments.

What we need to discuss and collect material for are mostly:
1. mic input
2. available speech codecs
3. transfer, security and other networking stuff

@ mic inut:
there are at least 3 different views about the mic input at the bottom of the PSP:
one saying it has an extra pin for the mic (a-la JonathanDS)
another claiming that it is simple to connect a mic by using the white serial cable
and finally this one
http://www.luaplayer.org/sio/readme.html
claiming that one live pin of the audio channel has a DC,
which does not seem enough for an electret mic, but is definitely a lot for a headphone offset!!! so..?

question:
is there any hommebrew or free app to test the mic input of the PSP?
this is the point to strart!!!

@ speech codecs
there are some codecs available between
6 and 20 kbps, so we just need to port one


@ 3...
guys, it is your topic is not it?
User avatar
Stellar
Posts: 48
Joined: Mon Dec 12, 2005 9:13 am

Post by Stellar »

for a slightly different purpose, Ild like to donate my interest as well. Im assuming you mean a real voip application where you dial telephone numbers. My interest is just connecting to a server, much the way teamspeak does so you can have ingame communication ( I dont belive this has been done, am i wronge? )
Image
dbeyer3069
Posts: 81
Joined: Mon Dec 19, 2005 4:09 pm

Re: VoIP building blocks .)

Post by dbeyer3069 »

this is a thread to collect ideas / requirements/ for a possible Voice Over IP
application.

Please do not attack or lock this thread only because you think it is "impossible"
instead, send us your ideas, links, pieces of code, and comments.

What we need to discuss and collect material for are mostly:
1. mic input
2. available speech codecs
3. transfer, security and other networking stuff
Nothing is impossible in voice applications for this market. I anticipated it would only be a little while before someone else considered developing telephony apps for the PSP. I have libraries for all this already done :)

Google "bestsoftworks" and see what turns up. This product is already under development and is based on my technology which I've owned for 7 years.

David Beyer
dbeyer3069
Posts: 81
Joined: Mon Dec 19, 2005 4:09 pm

Post by dbeyer3069 »

Stellar wrote:for a slightly different purpose, Ild like to donate my interest as well. Im assuming you mean a real voip application where you dial telephone numbers. My interest is just connecting to a server, much the way teamspeak does so you can have ingame communication ( I dont belive this has been done, am i wronge? )
This is already part of a new project "Cupid's Playground" which I am developing. See my next message. This is part of what the game does. I am in the telephony business and thought the marriage was a good idea... which is why I'm doing it.

David Beyer
Pit0711
Posts: 54
Joined: Thu Mar 24, 2005 5:45 am
Location: Old Europe -Germany-

Post by Pit0711 »

jtwald
Posts: 24
Joined: Wed Jan 04, 2006 2:57 am

Post by jtwald »

I don't see why you are questioning what to use as a mic input.

Sony has already realeased an official headset with a flexible microphone, and it works in online paly with SOCOM Fireteam Bravo.

It retails for 20$, but because of poor promotion, a quiet release, and lack of supports except for one game, its not sold everywhere you'd think it would be.

I picked mine up at best buy.

Why mess with homebrew hardware when theres an excellent official hardware solution for only 20$ out and everyone will have the same thing?

Image
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Image
Check out that connector. Stereo audio and microphone all in one jack.
User avatar
Stellar
Posts: 48
Joined: Mon Dec 12, 2005 9:13 am

Post by Stellar »

first and foremost, i found this http://www.pspforums.com/forums/viewtop ... 886#116886 wwhich shows which wires are used for audio out and in, you can test which wwires are speaker, and the other two will be for the mic.

Im going to use the remote cable and retrofit a jack on the end so I can use my logitech headset ( much better imho ).

[/url]
Image
Dr. Vegetable
Posts: 171
Joined: Mon Nov 14, 2005 1:32 am
Location: Boston, Massachusetts
Contact:

Post by Dr. Vegetable »

I've had a "SOCOM Headset" for awhile now, and it has been known that two of the pins near the headphone jck on the bottom of the PSP are for microphone input. We understand the hardware part of voice/audio input into the PSP very well at this point. What is missing is an understanding of how to record audio into a homebrew application.

For example, I would like to write a simple voice recorder application but have not succeeded in reverse-engineering the audio input capability, nor have I found anyone else who has. There are many great applications that will be possible once someone figures this out. Of course, adding chat to games or running phone-quality VOIP applications are on the list. But voice recognition/command, voice recorder, even an amateur radio digital communication protocol called PSK-31 would also be possible.
mrn
Posts: 116
Joined: Wed Nov 02, 2005 2:26 am

Post by mrn »

thnx for all the replys.
I don't see why you are questioning what to use as a mic input.
Let us consider that not everybody likes to take a hge mic with himself,
or let say, i'd like just to add an on-board mic to my psp sticking it right
behind the 3.5mm jack hole.

then..
acc to the images from ooPo...
there must be a fourth pin inside the jack hole to connect to the 4th ring acc. to his image...

BUT!
my question is:
how many rings does your male jack have on the remote-control cable?
for caase you do not have it beside, check:
http://www.pspforums.com/forums/viewtop ... 886#116886
....

strange, hahh? sony just produces different ways of mic input?
ok. in case you have less then four, which pin is then the mic input pin?
btw, my psp audio jack HOLE also seems to have only 3 pins INSIDE...

therefore, and from the reason that the headphone on the figure is not available herem, the question:
is there any homebrew or free app to test the mic input of the PSP?
is still valid!
i am asking coz' first of all we need to know which pin to use when building the HW, and then we need a way to be able to address and implement mic input.. so we need to know how to control the bufers, etc....
Last edited by mrn on Fri Jan 06, 2006 10:24 pm, edited 1 time in total.
Dr. Vegetable
Posts: 171
Joined: Mon Nov 14, 2005 1:32 am
Location: Boston, Massachusetts
Contact:

Post by Dr. Vegetable »

The PSP "remote control" headphone extension cable has a 4-ring TRRS jack that can accept the SOCOM headset and convert it to the 3-ring TRS connector inside the PSP. The microphone input on the PSP is brought in through the two connectors closest to the headphone jack. For whatever reason, Sony did not simply put the TRRS connector right on the PSP, so you need to use the remote (or similar adapter) to use a microphone headset with the PSP. The headphone jack on the PSP is just a simple 3-conductor TRS stereo headphone output.
mrn
Posts: 116
Joined: Wed Nov 02, 2005 2:26 am

Post by mrn »

Thanx, Dr.Vegetable!!! clear answer! m.

but then the signs are wrong on this page:
http://www.luaplayer.org/sio/readme.html
[/quote]
Dr. Vegetable
Posts: 171
Joined: Mon Nov 14, 2005 1:32 am
Location: Boston, Massachusetts
Contact:

Post by Dr. Vegetable »

Right, this link is similar to another one I have used. The pins labelled "1" and "4" are the microphone input lines, with 1 being audio ground, and 4 being the microphone input.

There is a function in the firmware that will apparently detect whether a microphone is connected, called sceHprmIsMicrophoneExist() if memory serves me correctly. Beyond this, recording audio will presumably require allocating buffers, starting a record operation, and monitoring callbacks to feed fresh record buffers in.
mrn
Posts: 116
Joined: Wed Nov 02, 2005 2:26 am

Post by mrn »

just measured it:

Edit:PSP-side...

Image

..and remote control Jack Hole:


../T\
..)||( Ring1 ~ L Out
..|||| Ring2 ~ R Out
..|||| Ring3 ~ Mic and Out Gnd
..|||| Ring4 ~ Mic Input
--------
||.....||
||.....|| this is the socom headset jack .)

A~ (PSP Side) ..| B~ Remote conn hole| ...... R(AB)
-----------------------------------------------------------------
pin 4 ................| remote ring nr. 4 .....| shows 50 ohm
pin 5 ................| remote ring nr. 4 .....| shows 1.250 kOhm (why??)
pin1 .................|...any ring.................| infinite (!!!!)
ring3.................|...ring3.....................| 0 Ohm

therefore it seems that pin1 is not connected,
but the mic input corresponds to ring3(Mic Gnd) and pin4(MicLive) on the PSP side and ring3 and ring4 on the Remote control side!!!

therefore it seems that pin5 is the DC (2.5V) coupled by a 1,2kOhm resistor to mic input pin4. But where that 50 Ohms come from?
note: i did measure it w/o opening the remote thing.

pl. correct me Dr.V if i am wrong.
Last edited by mrn on Sun Jan 08, 2006 11:01 pm, edited 4 times in total.
mrn
Posts: 116
Joined: Wed Nov 02, 2005 2:26 am

Post by mrn »

The pins labelled "1" and "4" are the microphone input lines, with 1 being audio ground, and 4 being the microphone input.
where did you get this info from?
it seems that pin 1 is not connected to any of the 4 rings at the remote side!
dbeyer3069
Posts: 81
Joined: Mon Dec 19, 2005 4:09 pm

Post by dbeyer3069 »

For example, I would like to write a simple voice recorder application but have not succeeded in reverse-engineering the audio input capability, nor have I found anyone else who has. There are many great applications that will be possible once someone figures this out. Of course, adding chat to games or running phone-quality VOIP applications are on the list. But voice recognition/command, voice recorder, even an amateur radio digital communication protocol called PSK-31 would also be possible.
This thread is interesting to me because it gives insight into how much interest there is in these types of apps. The plus for the PSP is that phone quality audio requires much less data (8000hz recordings) versus the typical higher sound quality found in typical wav files, etc. With this said, it will be less taxing on it.

I haven't tried SOCOM's microphone capabilities (I have played the game)... but games written to use VOIP or something similar have to be well written to avoid choppy delivery (and then take into consideration polling versus interrupt methods of getting the data).

If there are other serious developers out there interested in the technology (both sides of it -- the PSP code AND the VOIP hardware side of it), we should talk. I can save you loads of time developing pieces of it.

David Beyer
PSP250
Posts: 12
Joined: Sat Nov 19, 2005 2:41 am

Post by PSP250 »

Great stuff!

I think the initial work/focus should be to actually write a sample app which is recording audio input. Afterwards anything is possible.

API wise it seems to be:

sceHprmIsMicrophoneExist
sceAudioInputInit
sceAudioWaitInputEnd
sceAudioGetInputLength
sceAudioInput
sceAudioInputBlocking

The usage seems to be kind of similar to the audio output one.
Will dig into it once i get my hands on a correct microphone.
dbeyer3069
Posts: 81
Joined: Mon Dec 19, 2005 4:09 pm

Post by dbeyer3069 »

PSP250 wrote:Great stuff!

I think the initial work/focus should be to actually write a sample app which is recording audio input. Afterwards anything is possible.

API wise it seems to be:

sceHprmIsMicrophoneExist
sceAudioInputInit
sceAudioWaitInputEnd
sceAudioGetInputLength
sceAudioInput
sceAudioInputBlocking

The usage seems to be kind of similar to the audio output one.
Will dig into it once i get my hands on a correct microphone.
The InputBlocking() is probably not something you would want to use. I haven't seen the docs for the function but you would want to keep it async instead of sync to reduce the load on the cpu so it has plenty for the rest of the app.

David Beyer
dbeyer3069
Posts: 81
Joined: Mon Dec 19, 2005 4:09 pm

Post by dbeyer3069 »

I think the initial work/focus should be to actually write a sample app which is recording audio input. Afterwards anything is possible.
BTW. Does anyone know if the PSP has a seperate CPU which handles some of the external devices (sound, etc.)? Some hardware use dedicated cpus for processing audio/video.

David Beyer
Dr. Vegetable
Posts: 171
Joined: Mon Nov 14, 2005 1:32 am
Location: Boston, Massachusetts
Contact:

Post by Dr. Vegetable »

The link I have used in the past is this:

http://mc.pp.se/psp/phones.xhtml

I believe pin #1 is Audio Ground and pin #4 is microphone input. The same numbering is used on the picture you have linked. There was a discussion thread regarding the remote control's use of RS-232 that included some information about this as well. I'll post a link if I can shake it loose.

EDIT:
In this thread, it is written:
>NIL: wrote: Pins 1 and 4 are completely unused by the remote - This I could prove by cutting them both out of standard remote operations using a little bit of cello tape (never understimate the power of low budget technology!) As a matter of fact, further reference in this post to "cutting" or disconnecting pins simply mean that cello tape was applied on the relevant pin before the remote was plugged back in.
These are most likely Microphone Input (pin 1) and Microphone Bias (pin 4) and we can presume that the headset thingy will use an electret condenser microphone (this is a very common type of microphone these days since it generates a much better signal/noise ratio than other types of microphones, but it must be powered through a Bias output in order to do so).
I could measure voltage on pin 4, which is constant at about 2.25V. This tends to indicates that this pin most likely comes out of the MICBIAS output of the WM8750L audio chip (datasheet) rather than from the CPU, as it was previously identified that the CPU I/O pins will deliver a 2.5V voltage, not 2.25V.
When disconnecting pins 1 & 4, the remote works just as usual, so those pins are definitely optional when not using a microphone.
jtwald
Posts: 24
Joined: Wed Jan 04, 2006 2:57 am

Post by jtwald »

mrn wrote:thnx for all the replys.
I don't see why you are questioning what to use as a mic input.
Let us consider that not everybody likes to take a hge mic with himself,
or let say, i'd like just to add an on-board mic to my psp sticking it right
behind the 3.5mm jack hole.
You obviously havn't used the headset if you think it is 'huge'. It is relatively cheap (20$). The sound through the headphones is actually impressive, and the mic clarity is great. And to tie it all together, the headset is very light on your ears and comfortable, once you put it on you forget it's there.

So why waste your time making your own microphone, when you don't even know how to control the official audio input device yet.
mrn
Posts: 116
Joined: Wed Nov 02, 2005 2:26 am

Post by mrn »

So why waste your time making your own microphone.....
making my own mic is nothing more just connecting a 1.00 USD electret capsula to the right pins. dot.
I believe that that sony headset is nice and lightweight, but
first of all it is not available in mid europe (neither the usb webcam nor the usb keyboard),
and second.. i do not want to carry anything whith extra cables, ie i want the mic
a) inside the psp house
b) attached right beside the hedphone jack....

but still, as you say
..., when you don't even know how to control the official audio input device yet.
this is what we are trying to figure out here.
mrn
Posts: 116
Joined: Wed Nov 02, 2005 2:26 am

Post by mrn »

If there are other serious developers out there interested in the technology (both sides of it -- the PSP code AND the VOIP hardware side of it), we should talk. I can save you loads of time developing pieces of it.
David, thanks for your offer!
We believe the time will come when we can record and do whatever we want witht the audio input..
insert_name_here
Posts: 3
Joined: Mon Jan 09, 2006 6:26 am
Location: right hurr..., not over thurr

Post by insert_name_here »

I saw somewhere in the most recent toolchian/sdk something which checks to see if the microphone is there... would that help?

but of course, i lost it. *rolls eyes, and keeps looking*

edit: there it is, \usr/local/pspdev/psp/sdk/include/psphprm.h

it isnt commented, however it looks the same as the other commands in that header.

command is sceHprmIsMicrophoneExist(void);



and about the connector that ooPo posted the pic of and the remote: does the remote actually do anything to the data, or does it just move the data around so that the stereo is on the 3.5mm jack, and the mic is on the serial?

oh, sorry, i just skipped the whole bit of stuff up at the top that talked about this.
Last edited by insert_name_here on Mon Jan 09, 2006 12:06 pm, edited 1 time in total.
init var me
me /= n00b.

init var mySig
mySig = lame
User avatar
Saotome
Posts: 182
Joined: Sat Apr 03, 2004 3:45 am

Post by Saotome »

insert_name_here wrote:I saw somewhere...
Maybe you saw it here (use the link or just scroll up 7 posts) *rolls eyes*
infj
Dr. Vegetable
Posts: 171
Joined: Mon Nov 14, 2005 1:32 am
Location: Boston, Massachusetts
Contact:

Post by Dr. Vegetable »

...or keep scrolling up...

:)

I'm actually quite interested in the other functions that PSP250 listed. I couldn't find these in the latest SDK.
mrn
Posts: 116
Joined: Wed Nov 02, 2005 2:26 am

Post by mrn »

sceHprmIsMicrophoneExist
sceAudioInputInit
sceAudioWaitInputEnd
sceAudioGetInputLength
sceAudioInput
sceAudioInputBlocking
we need sthng like:
setSamplerate (8kHz, 11kHz, 22, 32, 44.1, 48, etcetc-)
setSampleSize (8bit, 16bit, etc)
setBufferLength(256samples, 512 samples, etc)
bufferFilledCallback (this is the callback to process/store the content of the buffer)
startRecording
stopRecording
stopPlayback
startPlayback
pauseRecording

i am not familiar with all the available tools with psp programming,
but does not the codewarrior package support sthng like those..?
insert_name_here
Posts: 3
Joined: Mon Jan 09, 2006 6:26 am
Location: right hurr..., not over thurr

Post by insert_name_here »

mrn wrote:
sceHprmIsMicrophoneExist
sceAudioInputInit
sceAudioWaitInputEnd
sceAudioGetInputLength
sceAudioInput
sceAudioInputBlocking
we need sthng like:
setSamplerate (8kHz, 11kHz, 22, 32, 44.1, 48, etcetc-)
setSampleSize (8bit, 16bit, etc)
setBufferLength(256samples, 512 samples, etc)
bufferFilledCallback (this is the callback to process/store the content of the buffer)
startRecording
stopRecording
stopPlayback
startPlayback
pauseRecording

i am not familiar with all the available tools with psp programming,
but does not the codewarrior package support sthng like those..?
maybe SceAudioInputInit starts recording, I dont have SOCOM, is the audio continuous, or do you press a certain button to talk? If it is always on, the SceAudioInputInit command could do it all, and there wouldnt be a command for pause, or stop. It may not, at this point, support storing the captured sound, or setting the sample rate beyond a default. The only game we have to work with is SOCOM, which doesnt save the audio. of course the defaults could be changed if whatever in SOCOM uses the mic is reverse-engineered/uncompiled.

of couorse, that all could be wrong. and like Dr. Veg said up there, those werent in my copy of the toolchain (from oopo's site)
init var me
me /= n00b.

init var mySig
mySig = lame
dbeyer3069
Posts: 81
Joined: Mon Dec 19, 2005 4:09 pm

Post by dbeyer3069 »

David, thanks for your offer!
We believe the time will come when we can record and do whatever we want witht the audio input..
I'm not sure what your idea for an application is, but anything for VOIP or something similar has to tap into some type of audio stream. Ideally, passing that stream to a network handler which reads it, makes packets out of it and sends it off to a server. Interrupt driven would call a function when a certain amount of data is received so it can be passed to the network layer. Polling would do its own buffering until the end of the stream or the buffer was full - at which point it is passed to the network layer and the process starts over. In my opinion, these are the types of functions that are useful.

David Beyer
Post Reply