Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Wigo

macrumors newbie
Sep 8, 2008
15
0
New update guys!

I contacted ZodTTD author of Quake4iphone and he responded :
-----------------------------------------------------------------
Hi!

Quake4iphone may have some init code for a gamepad controller add-on I'm working to get up and going. The controller addon uses the dock connector. I will see about getting that code to you, if you're interested in it. I have some open sourced version of the code I can share. If it is what Im thinking, it could be as simple as opening a bsd device serial port connection properly. If not, it's something more complex in my code.

Which thread should I respond to? :)

Keep in touch,ZodTTD
-------------------------------------------------------------------

I directed him to respond to this thread so hopefully we'll hear from him soon. Please note that I'm not very savvy when it comes to code, so if anyone here could help out with ZodTTD that would be great!
 

aaquib

macrumors 65816
Sep 11, 2007
1,496
1
Toronto, Canada
I exchanged my dock back to Apple and the new one seemed to work fine for about 2 weeks, not its on/off. Sometimes it gives me the error message, sometimes I do without it. I haven't let any water get inside, nor have I put on any unauthorized devices. Just my iPhone.
 

Bensonious

macrumors newbie
Oct 3, 2008
4
0
So I also message zodttd and his response hinted at a fix. I'm guessing that was is happening is that there is in fact an hardware issue, and there for the phone thinks something is connected and hence locking the serial port.

I ssh'd into my phone and did a simple "touch" on the serial block device. Nothing happened and in fact the command was being blocked. So I killed the process and voila, my sound was back.

Next I had to get this to happen every time the phone was unlocked. I'd explain it but its easier to jsut tell you how to do it.

I created a file called "com.SoundFix.plist" with these contents:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.SoundFix</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/Library/Scripts/ResetAudio.sh</string>
</array>
<key>StandardErrorPath</key>
<string>/dev/null</string>
<key>StandardOutPath</key>
<string>/dev/null</string>
<key>UserName</key>
<string>root</string>
<key>StartCalendarInterval</key>
<dict>
<key>Minute</key>
<integer>1</integer>
</dict>
</dict>
</plist>

I placed that file in /Library/LaunchDaemon

After that I had to create this script: /Library/Scripts/ResetAudio.sh

looks like this.

#!/bin/sh

touch /dev/tty.iap&
sleep 1
killall touch



And make sure that the permissions are set to be executable.


Restart your phone and you are done.

*** The script isn't perfect, so you might get the pop up once after unlocking, but you will have sound immediately after that. I'm working the kinks out.

Spread the word,

Ben
 

Wigo

macrumors newbie
Sep 8, 2008
15
0
Way to go Ben!

Looks like we're on the right track. I wish I could help out in terms of coding and scripting but I have no clue with that stuff. I hope others who have knowledge in this can help you out!

Hopefully in the end, we can find a fix and package it onto Cydia or something so that we have a one-click solution for all us coding newbies.
 

dynaxfl

macrumors newbie
Oct 4, 2008
7
0
Thanks, Ben! This worked really well. It occasionally has pop up but it immediately disappears and I have the sound!
 

AlexiFortuni

macrumors newbie
Mar 13, 2008
27
0
So I also message zodttd and his response hinted at a fix. I'm guessing that was is happening is that there is in fact an hardware issue, and there for the phone thinks something is connected and hence locking the serial port.

I ssh'd into my phone and did a simple "touch" on the serial block device. Nothing happened and in fact the command was being blocked. So I killed the process and voila, my sound was back.

Next I had to get this to happen every time the phone was unlocked. I'd explain it but its easier to jsut tell you how to do it.

I created a file called "com.SoundFix.plist" with these contents:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.SoundFix</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/Library/Scripts/ResetAudio.sh</string>
</array>
<key>StandardErrorPath</key>
<string>/dev/null</string>
<key>StandardOutPath</key>
<string>/dev/null</string>
<key>UserName</key>
<string>root</string>
<key>StartCalendarInterval</key>
<dict>
<key>Minute</key>
<integer>1</integer>
</dict>
</dict>
</plist>

I placed that file in /Library/LaunchDaemon

After that I had to create this script: /Library/Scripts/ResetAudio.sh

looks like this.

#!/bin/sh

touch /dev/tty.iap&
sleep 1
killall touch



And make sure that the permissions are set to be executable.


Restart your phone and you are done.

*** The script isn't perfect, so you might get the pop up once after unlocking, but you will have sound immediately after that. I'm working the kinks out.

Spread the word,

Ben



can anyone make a real noobie step by step for this fix???

its the only thing i can find that really works for this problem that many ppl are having with the iphone
 

Wigo

macrumors newbie
Sep 8, 2008
15
0
Yes, can anyone write a guide on how to do this? Maybe even package it onto Cydia as a one-click solution?
 

romeoyankee

macrumors member
Aug 27, 2008
33
0
My question is that the Library/Scripts/ folder isnt there....

So I have to create it or did you just accidently give the wrong destination?

Thanks!
 

romeoyankee

macrumors member
Aug 27, 2008
33
0
Ok so I did what I posted earlier and created the scripts folder and it does work!! (sometimes) lol


*edit* Ok it doesnt seem to be working for me...

I cant get the message to go away majority of the time and when it does I only get my system sounds back. I still cant play audio through the speakers from my ipod.

any idea why?
 

dynaxfl

macrumors newbie
Oct 4, 2008
7
0
My question is that the Library/Scripts/ folder isnt there....

So I have to create it or did you just accidently give the wrong destination?

Thanks!

Yes, you need to create a folder called Scripts. I set permission to 777 for all the new folders and files just created. Reboot the phone, it works.

NOTE if I put the phone in the charger, the message will come up more often than it's not in the charger.
 

Bensonious

macrumors newbie
Oct 3, 2008
4
0
Sorry to hear that it isn't working for you correctly. But you were right, you didn't have to create the scripts folder, I forgot to mention that.

As for your music not working, I haven't seen that problem. Try plugging and unplugging your earphones a few times. That always works for me.

Also, I have tried some different scripts, but none have worked as well as the one I posted. It all seems to be a timing issue. That is why you will see the popup every once and a while. Unfortunately the way launchd works, its not possible to have a script run periodically less than 1 minute. Although the script should be run immediately after you unlock, it just seems that the popup happens before the script can run every once and awhile.

This is what I believe the scenario is when you do see the popup:

script is run ->
touch /dev/tty.iap
sleep 1
(at this point the file is still locked and the popup is shown)
killall touch
(the popup automatically dissapears)

If anyone has any better knowledge of writing shell script, feel free to say something.
 

llcooljayce

macrumors newbie
Sep 16, 2008
4
0
So I also message zodttd and his response hinted at a fix. I'm guessing that was is happening is that there is in fact an hardware issue, and there for the phone thinks something is connected and hence locking the serial port.

I ssh'd into my phone and did a simple "touch" on the serial block device. Nothing happened and in fact the command was being blocked. So I killed the process and voila, my sound was back.

Next I had to get this to happen every time the phone was unlocked. I'd explain it but its easier to jsut tell you how to do it.

I created a file called "com.SoundFix.plist" with these contents:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.SoundFix</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/Library/Scripts/ResetAudio.sh</string>
</array>
<key>StandardErrorPath</key>
<string>/dev/null</string>
<key>StandardOutPath</key>
<string>/dev/null</string>
<key>UserName</key>
<string>root</string>
<key>StartCalendarInterval</key>
<dict>
<key>Minute</key>
<integer>1</integer>
</dict>
</dict>
</plist>

I placed that file in /Library/LaunchDaemon

After that I had to create this script: /Library/Scripts/ResetAudio.sh

looks like this.

#!/bin/sh

touch /dev/tty.iap&
sleep 1
killall touch



And make sure that the permissions are set to be executable.


Restart your phone and you are done.

*** The script isn't perfect, so you might get the pop up once after unlocking, but you will have sound immediately after that. I'm working the kinks out.

Spread the word,

Ben

This works perfectly for me! Thanks so much Ben.

Maybe you could explain how you know where to put everything and how to write the actual xml ... I would be curious to understand the inner workings of the phone. Cheers
 

romeoyankee

macrumors member
Aug 27, 2008
33
0
Soft Fix Newbie Guide

Hey Ben,

So just to clarify.. You wrote

"But you were right, you didn't have to create the scripts folder, I forgot to mention that."

Im assuming you meant "DID" ;)

anyways...

So it wasnt working for me.. I checked and I had everything set correctly and all permissions set to 0777. So I deleted everything and started over. Did everything step by step and now it works.. lol

For newbie steps do this...

1: If you havent jailbroken your iphone then you have to do that.. If you dont know how to then google is your friend. http://blog.iphone-dev.org/

2: Open Notepad and paste this into the body

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.SoundFix</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/Library/Scripts/ResetAudio.sh</string>
</array>
<key>StandardErrorPath</key>
<string>/dev/null</string>
<key>StandardOutPath</key>
<string>/dev/null</string>
<key>UserName</key>
<string>root</string>
<key>StartCalendarInterval</key>
<dict>
<key>Minute</key>
<integer>1</integer>
</dict>
</dict>
</plist>

Save this file as

com.SoundFix.plist

and make sure that when it saves that notepad doesnt automatically add the .txt extension. you should only have the .plist extension. It is case sensitive as well

3: Open a blank page with notepad and add this to the body

Code:
#!/bin/sh

touch /dev/tty.iap&
sleep 1
killall touch


Save this file as

ResetAudio.sh

again make sure that the extension is .sh and not .txt and also it is case sensitive.

4: Ssh into your iphone http://www.youtube.com/watch?v=4ryiOUzgNfY

5: find folder

<root>/Library/LaunchDaemons/

6: Copy the com.SoundFix.plist file into this folder and then right click on it and go to properties. Set the permissions to 777 and click Ok.

7: find folder

<root>/Library/

and create a new folder called Scripts. Set the permissions on the scripts folder to 777 as well.

8: find folder

<root>/Library/Scripts/

9: Copy the ResetAudio.sh file into this folder and then right click on it and go to properties. Set the permissions to 777 and click Ok.

10: Press the home and power buttons together and hold until the screen turns off and you see the apple logo at startup. Release them both.

11: The pop up will come back when you "slide to unlock" and then will almost immediately disappear. Your sounds should all work correctly!

Thanks so much Ben for this as many of us have been waiting for a LONG time for this fix. Would you be interested in putting this up in Cydia?
 

Bensonious

macrumors newbie
Oct 3, 2008
4
0
Hey Ben,

So just to clarify.. You wrote

"But you were right, you didn't have to create the scripts folder, I forgot to mention that."

Im assuming you meant "DID" ;)

anyways...

So it wasnt working for me.. I checked and I had everything set correctly and all permissions set to 0777. So I deleted everything and started over. Did everything step by step and now it works.. lol

For newbie steps do this...

1: If you havent jailbroken your iphone then you have to do that.. If you dont know how to then google is your friend. http://blog.iphone-dev.org/

2: Open Notepad and paste this into the body

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.SoundFix</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/Library/Scripts/ResetAudio.sh</string>
</array>
<key>StandardErrorPath</key>
<string>/dev/null</string>
<key>StandardOutPath</key>
<string>/dev/null</string>
<key>UserName</key>
<string>root</string>
<key>StartCalendarInterval</key>
<dict>
<key>Minute</key>
<integer>1</integer>
</dict>
</dict>
</plist>

Save this file as

com.SoundFix.plist

and make sure that when it saves that notepad doesnt automatically add the .txt extension. you should only have the .plist extension. It is case sensitive as well

3: Open a blank page with notepad and add this to the body

Code:
#!/bin/sh

touch /dev/tty.iap&
sleep 1
killall touch


Save this file as

ResetAudio.sh

again make sure that the extension is .sh and not .txt and also it is case sensitive.

4: Ssh into your iphone http://www.youtube.com/watch?v=4ryiOUzgNfY

5: find folder

<root>/Library/LaunchDaemons/

6: Copy the com.SoundFix.plist file into this folder and then right click on it and go to properties. Set the permissions to 777 and click Ok.

7: find folder

<root>/Library/

and create a new folder called Scripts. Set the permissions on the scripts folder to 777 as well.

8: find folder

<root>/Library/Scripts/

9: Copy the ResetAudio.sh file into this folder and then right click on it and go to properties. Set the permissions to 777 and click Ok.

10: Press the home and power buttons together and hold until the screen turns off and you see the apple logo at startup. Release them both.

11: The pop up will come back when you "slide to unlock" and then will almost immediately disappear. Your sounds should all work correctly!

Thanks so much Ben for this as many of us have been waiting for a LONG time for this fix. Would you be interested in putting this up in Cydia?

Hey, Great re-write up. And yes I did mean "did"; I was probably trying to type to fast. Anyways, I'm not really familiar with cydia and I'm currently busying writing another iPhone app. But if I have some spare time, I'll try looking into it.

Hopefully this write up will bring relief to others who jumped into a pool with their phone in their pocket :D
 

AlexiFortuni

macrumors newbie
Mar 13, 2008
27
0
i was soo excited to get home today and try this fix....

but it didnt work... i even did it twice..


what could have gone wrong here??
 

AlexiFortuni

macrumors newbie
Mar 13, 2008
27
0
now i ssh'd back in erased all the code i had put in before and my sms was fine again...


then i tryed it all again

still dosnt work i still get the messege and sound turns off..

and now i cant for some reason ssh back into my iphone it says network error: connection times out

gggrrrrrrrrrrrr
 

Wigo

macrumors newbie
Sep 8, 2008
15
0
Hey, Great re-write up. And yes I did mean "did"; I was probably trying to type to fast. Anyways, I'm not really familiar with cydia and I'm currently busying writing another iPhone app. But if I have some spare time, I'll try looking into it.

Please Ben. All this coding and scripts is overwhelming. I'm afraid I might make my iphone worse!
 

Bensonious

macrumors newbie
Oct 3, 2008
4
0
now i ssh'd back in erased all the code i had put in before and my sms was fine again...


then i tryed it all again

still dosnt work i still get the messege and sound turns off..

and now i cant for some reason ssh back into my iphone it says network error: connection times out

gggrrrrrrrrrrrr

Sounds like you deleted all the files in the LaunchDaemons folder. There is a file in there that is used to launch the ssh service. You can probably uninstall ssh via cydia and reinstall it. Start the service with either boss prefs or sshtoggle and youre good to go.
 

AlexiFortuni

macrumors newbie
Mar 13, 2008
27
0
got it thanks


but this fix still dosnt work for me... im trying my best to follow each step exactly but something is going wrong...
 

subbetica

macrumors newbie
Oct 8, 2008
1
0
don´t works

another failure, Ii also didn´t worked to me, and It also fault the ssh then, it resolved by reinstalling the openssh.
where is the failure? in the code, in the firmware version,...
 

mryder66

macrumors newbie
Oct 9, 2008
1
0
Replacement the only fix?

I have tried for several days to fix this issue on my 3G, but eventually gave up and took it to the geius bar. The guy there, took one look and said that the fault is not repairable, and immediately swapped out the phone for me. Now I am doing a restore and will be oon my way.


I know this is cold comfort for those not under warranty.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.