Enabling speakers with headphones plugged in? (solved)

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

Moderators: cheriff, TyRaNiD

Post Reply
deniska
Posts: 71
Joined: Mon Oct 17, 2005 1:38 pm
Location: New York

Enabling speakers with headphones plugged in? (solved)

Post by deniska »

Does anyone have any ideas on how to achieve it?
Apparently, it's possible in Talkman..
Last edited by deniska on Thu Nov 22, 2007 11:20 am, edited 1 time in total.
adrahil
Posts: 274
Joined: Thu Mar 16, 2006 1:55 am

Post by adrahil »

Hi!
I need to check it, but I have an idea on how to do it ;)
I will post a snippet of code in a few hours. :P

Cheers,

Adrahil
deniska
Posts: 71
Joined: Mon Oct 17, 2005 1:38 pm
Location: New York

Post by deniska »

this would be super!
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

Yes, would be great.
Btw do you know if there's a way to know whether the headphones are plugged in or not?
Sorry for my bad english
Image Oldschool library for PSP - PC version released
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

Code: Select all

if( sceHprmIsRemoteExist() ) { // check if remote is connected
    if( sceHprmIsHeadphoneExist() ) // check if remote + headphones are connected
    // do your madness
}
else
if(sceHprmIsHeadphoneExist() ) { // check if headphones are connected (WITHOUT REMOTE)
    // do your madness
}
else
if(sceHprmIsMicrophoneExist() ) { // check if microphone is connected (WITHOUT REMOTE)
    // do your madness
}
Last edited by dot_blank on Wed Aug 29, 2007 5:02 am, edited 1 time in total.
10011011 00101010 11010111 10001001 10111010
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

Oh yesssssssssssssss so cool! I've gotta try this :)
This would make the psp a great audio player for silent rooms if we could pause the audio output when the headphones are accidentially plugged out ;)
Thank you veryyyy much :)
Sorry for my bad english
Image Oldschool library for PSP - PC version released
adrahil
Posts: 274
Joined: Thu Mar 16, 2006 1:55 am

Post by adrahil »

I keep getting problems with the code :/ Albeit the library is here, it will not link correctly. Time to update toolchain, i guess.
deniska
Posts: 71
Joined: Mon Oct 17, 2005 1:38 pm
Location: New York

Post by deniska »

adrahil wrote:I keep getting problems with the code :/ Albeit the library is here, it will not link correctly. Time to update toolchain, i guess.
Can you post the code, so perhaps other people will be able to compile/link it?
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

dot_blank wrote:

Code: Select all

if( sceHprmIsRemoteExist() ) { // check if remote is connected
    if( sceHprmIsHeadphoneExist() ) // check if remote + headphones are connected
    // do your madness
}
else
if(sceHprmIsHeadphoneExist() ) { // check if headphones are connected (WITHOUT REMOTE)
    // do your madness
}


Just "FORCING" ;) them to return 0 will do the job?
deniska
Posts: 71
Joined: Mon Oct 17, 2005 1:38 pm
Location: New York

Post by deniska »

it appears that chopping off the tip of the audio plug connector does the job.
the serial port is still on while the speakers are not muted...
just make sure that you leave the other 2/3rds intact...
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

I'd like to thank dot_blank again, I can now automatically display a message when the headphones are plugged out. The game is paused, the sound muted, and you can select whether you want to disable sound or keep it playing (on the speaker). That's very cool :-)
Sorry for my bad english
Image Oldschool library for PSP - PC version released
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

deniska wrote:it appears that chopping off the tip of the audio plug connector does the job.
the serial port is still on while the speakers are not muted...
just make sure that you leave the other 2/3rds intact...
That's what I call a dirty hack!
hardfalcon
Posts: 5
Joined: Sun Aug 19, 2007 7:41 am

Post by hardfalcon »

Playing music simultanously via both the PSP speaker AND the headphone jack is IMHO *very* dangerous for the PSP hardware, as this might easily surcharge the audio power amplifier/output stage of the PSP. The result would be a PSP without ANY music.
If you want a pull relief for the audio jack, I suggest you simply glue 2 Velcro strips onto your PSP.
If you want be able to use both headphones and loudspeaker at the same time, I'm afraid this won't be possible without any soldering inside the device... Anyhow, I don't see any good reason for using both at the same time...

//EDIT: @Deniska: If I understand you right, you simply chopped off the connector for the left audio channel.
http://en.wikipedia.org/wiki/TRS_connec ... erminology
The way the speakers are disabled when you plug your headphones in is quite simple: there's some sort of "button" (AFAIK a tiny little convex round metal plate under which are 2 contacts (one outer circle and one in the middle) which are connected when the tip of the plugged jack connector presses the plate onto both contacts).
deniska
Posts: 71
Joined: Mon Oct 17, 2005 1:38 pm
Location: New York

Post by deniska »

Actually, I only need the sound through the speakers so this hardware trick works fine for me... Basically, I just want to be able to use speakers while using the serial port for gps receiver communication...
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

hardfalcon wrote:Playing music simultanously via both the PSP speaker AND the headphone jack is IMHO *very* dangerous for the PSP hardware, as this might easily surcharge the audio power amplifier/output stage of the PSP. The result would be a PSP without ANY music.
If you want a pull relief for the audio jack, I suggest you simply glue 2 Velcro strips onto your PSP.
If you want be able to use both headphones and loudspeaker at the same time, I'm afraid this won't be possible without any soldering inside the device... Anyhow, I don't see any good reason for using both at the same time...

//EDIT: @Deniska: If I understand you right, you simply chopped off the connector for the left audio channel.
http://en.wikipedia.org/wiki/TRS_connec ... erminology
The way the speakers are disabled when you plug your headphones in is quite simple: there's some sort of "button" (AFAIK a tiny little convex round metal plate under which are 2 contacts (one outer circle and one in the middle) which are connected when the tip of the plugged jack connector presses the plate onto both contacts).
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

Why the pointless quote?

Surely you realize that Deniska is playing audio through just the speakers (even though his headphone connector is in place) and so that quote is irrelevant.

Not that it matters either way. I strongly doubt you can damage the PSP's audio output stage by doubling the load. It's would be no different than plugging in a set of very low-impedance headphones, and Sony has certainly thought about that.
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

Oops.
I meant to add my own words to it and agree with you.
ie. they are big words for a tiny amplifier,
and to add my own finding (have a spare brick):

There is a metal lever at the far end of the socket as already figured,
it is normally closed. Since I know this is on the left hand side of the
socket when looking into it with your PSP screen facing up,
you can avoid opening the switch by shaving only the left side of the tip
terminal. It may also stay connected, and I don't know what the result
of this will be.

on DIY serial plugs the headphone plug can be an effective switch
by rotating it 90 degrees, and the headphenes still work otherwise.
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

dot_blank wrote:

Code: Select all

if( sceHprmIsRemoteExist() ) { // check if remote is connected
    if( sceHprmIsHeadphoneExist() ) // check if remote + headphones are connected
    // do your madness
}
else
if(sceHprmIsHeadphoneExist() ) { // check if headphones are connected (WITHOUT REMOTE)
    // do your madness
}
Thanks, but do you know a similar command for the mic?
I have seen the original PSP input recording app detects the mic.
Art.
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

Art wrote:
dot_blank wrote:

Code: Select all

if( sceHprmIsRemoteExist() ) { // check if remote is connected
    if( sceHprmIsHeadphoneExist() ) // check if remote + headphones are connected
    // do your madness
}
else
if(sceHprmIsHeadphoneExist() ) { // check if headphones are connected (WITHOUT REMOTE)
    // do your madness
}
Thanks, but do you know a similar command for the mic?
I have seen the original PSP input recording app detects the mic.
Art.
mic in the headphone port?
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

yes,
I tried the obvious:
sceHprmIsMicrophoneExist
but doesn't work.

EDIT... oh, of course it is. all of these are defined in PSPHPRM.h,
but the lib has to be included ;)
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

EDIT
10011011 00101010 11010111 10001001 10111010
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

dot_blank wrote:

Code: Select all

if( sceHprmIsRemoteExist() ) { // check if remote is connected
    if( sceHprmIsHeadphoneExist() ) // check if remote + headphones are connected
    // do your madness - DONE
}
else
if(sceHprmIsHeadphoneExist() ) { // check if headphones are connected (WITHOUT REMOTE)
    // do your madness - DONE
}
else
if(sceHprmIsMicrophoneExist() ) { // check if microphone is connected (WITHOUT REMOTE)
    // do your madness - DONE
}
It made Absolutely NO difference!

All three Return 0 but still no sound! :(

Guess, Adrahil is our LAST hope.
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

KickinAezz wrote:
dot_blank wrote:

Code: Select all

if( sceHprmIsRemoteExist() ) { // check if remote is connected
    if( sceHprmIsHeadphoneExist() ) // check if remote + headphones are connected
    // do your madness - DONE
}
else
if(sceHprmIsHeadphoneExist() ) { // check if headphones are connected (WITHOUT REMOTE)
    // do your madness - DONE
}
else
if(sceHprmIsMicrophoneExist() ) { // check if microphone is connected (WITHOUT REMOTE)
    // do your madness - DONE
}
It made Absolutely NO difference!

All three Return 0 but still no sound! :(

Guess, Adrahil is our LAST hope.
That code simply checks for the remote/headphone/microphone. It was posted in response to Brunni's question on how to tell if anything is plugged in.
Brunni wrote: Btw do you know if there's a way to know whether the headphones are plugged in or not?
So it has nothing at all to do with enabling the speakers with the headphones plugged in.
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

J.F. wrote: So it has nothing at all to do with enabling the speakers with the headphones plugged in.
That makes it CLEAR! :D
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
deniska
Posts: 71
Joined: Mon Oct 17, 2005 1:38 pm
Location: New York

Post by deniska »

Actually, the latest version of mapThis (0.520) enables speakers even if the phone plug is in (no cutting of the audio plug tip required).. The code can be found here: http://www.dcemu.co.uk/vbulletin/showthread.php?t=79825

The code works on ta-79 and slim psp (that I have at my displosal) as long as it's ran under m33 3.xx firware (tested with 3.52 & 3.71)
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

deniska wrote:Actually, the latest version of mapThis (0.520) enables speakers even if the phone plug is in (no cutting of the audio plug tip required).. The code can be found here: http://www.dcemu.co.uk/vbulletin/showthread.php?t=79825

The code works on ta-79 and slim psp (that I have at my displosal) as long as it's ran under m33 3.xx firware (tested with 3.52 & 3.71)
siogps.h's functions do that?

Wow. Great work!
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

I'm finally able to confirm that Talkman does it, but I guess it's already sorted.
Talkman would have to be the most unfortunate PSP title.
It doesn't get anything right.
If not actually, then potentially.
Post Reply