|
Sound
NOTE ON SOUND Sound required that you disable mediaserverd, and only works through the headphones. A couple of easy aliases can be added to your .profile to disable or re-enable mediaserverd if you are using MobileShell: alias nosound="launchctl unload /System/Library/LaunchDaemons/coreaudiod.plist" alias sound="launchctl load /System/Library/LaunchDaemons/coreaudiod.plist" |
Sign in to add a comment
Great! ... just... where is that .profile file on the iPhone? Is it supposed to be in /var/root/?
Yes, PLEASE a step by step to get sound working. The natetrue readme gives this same info, it's just nobody I've found knows how to do it! Modmyiphone.com has a lengthy thread about it, many many people waiting.
echo "alias nosound=\"launchctl unload /System/Library/LaunchDaemons?/coreaudiod.plist\" >> ./~profile echo "alias sound=\"launchctl load /System/Library/LaunchDaemons?/coreaudiod.plist\" >> ./~profile
Relogin with ssh, then just type nosound or sound.
So let me get this straight:
1.) Disable mediaserverd (no idea what mediaserverd is) 2.) Add a couple of "aliases" to some .profile file (no idea what you're talking about)
That's a lot of help! Thanks!
It's a difficult concept for non-unix/linux folks. Often times, the best we can do is offer hints. At the very least, If upon reading this the aliases STILL don't make sense to you, at any time you can simply remotely log in (as Root! Required!) and type:
launchctl unload /System/Library/LaunchDaemons?/coreaudiod.plist That'll disable system sound, enabling it for NES.app.
launchctl load /System/Library/LaunchDaemons?/coreaudiod.plist Will re-enable system sound, disabling it for NES.app.
1. mediaserverd is a program, a service. The "d" at the end means it's a "daemon", a program whose sole purpose is to run in the backround and never be seen. It can still be invoked with things like parameters, and this can have an effect on how it is running. In this case, we set up aliases to call the launchctl command. With the parameters we pass in, we end up having an impact on whether mediaserverd is running. 2. An alias is just like what they are on the Mac: a pointer to starting a program. On the Windows side, they're called Shortcuts. The actual commands you run are long and complicated. The aliases provide an easy way to call the two commands. 3. The .profile file is (or can) be created for each user on a system. Basically, it contains a list of things to do when user X logs in. 4. The echo command simply outputs whatever? to the main output buffer. The >> after the whatever? means append that output to file? (creating it, if it doesn't exist, which it doesn't by default).
What neimod is trying to tell you to do, even though his post is riddled with strange errors, is the following:
1. Log into your iPhone remotely using SSH using the root account and password. To do this, you must have, at one point, jailbreak'd your phone and installed SSH on it, and THEN even gone ahead and thrown a bunch of handy commands on there so that you can do this. If this sounds hard, it's because it is. If it doesn't, you're either an expert or you've already done it.
IT MUST BE THE ROOT ACCOUNT, not the Mobile account. Only root has permission to invoke launchctl (and succeed). The .profile file mentioned below must be in the root's home directory, which is located at "/var/root/". When you SSH into the iPhone as root, this is where you'll start by default.
If you're on Mac OS X, then it's easy. Download iFuntastic and jailbreak the phone. WHILE it's jailbreak'd, download this guy's SSH install script and give it a run. It's very good. It installs SSH and all of the tools you'll need to add 3rd party apps to the phone.
http://www.kdbdallas.com/index.php/2007/08/04/iphone-ssh-install-for-mac-shell-script/
Remember to re-jail the phone after you’re done! This is important. If it is not done, iTunes won’t sync with the iPhone until it is. If iTunes won’t sync with the phone, the first thing you should try is to jail the phone.
Chances are, if you're to the point you've got the NES application on the iPhone and are using it without sound then you've already had some Terminal experience. You had to "chmod +x" the NES application in order to get it to run. I hope so, because I'm hoping the next statement makes sense.
Really, the variables for the commands are as follows. I'm splitting them out so the statements make sense, but you have to assemble them yourselves for them to work.
profileFile? = .profile noSoundCommand? = launchctl unload /System/Library/LaunchDaemons?/coreaudiod.plist yesSoundCommand? = launchctl load /System/Library/LaunchDaemons?/coreaudiod.plist
Open the Terminal on your Mac. Type ssh root@ipaddress? (ipaddress is found in the iPhone's wireless network's settings).
Type in "dottie" for the password.
Type the assembled version of what's below into the terminal and hit enter, once for each line.
echo "alias nosound=\"noSoundCommand?\"" >> profileFile? echo "alias sound=\"yesSoundCommand?\"" >> profileFile?
For example: The assembled version of the first line is: echo "alias nosound=\"launchctl unload /System/Library/LaunchDaemons?/coreaudiod.plist\"" >> .profile
Echo outputs the message within the double quotes (not including the \"'s). >> Sends that output along to .profile, appending it to a new line. If the file doesn't exist, it's created. If it does, the output is tacked onto the end.
With those commands, you've created the profile file and added the "sound" and "nosound" aliases to it! Log out of SSH. Log back into SSH as root (must be as root, again). This time, on login, your session sees the .profile file and runs those two alias commands, creating the aliases for your session.
typing "sound" should now actually call: launchctl load /System/Library/LaunchDaemons?/coreaudiod.plist
typing "nosound" should now actually call: launchctl unload /System/Library/LaunchDaemons?/coreaudiod.plist
That's it. I hope that makes sense. Good luck to everyone. It's pretty sweet with sound, and I look forward to seeing this project progress. Tristan
Okay, so that makes sense. Google post-processed my message. Any time where you see a linked question mark, just ignore it. Sorry.
To see the unprocessed version of what I was trying to say, check out http://www.theblowmedown.com/Extras/sound_nosound.txt
Everytime I type 'nosound' in terminal after creating the two aliases, it says 'No such process". (To create the two aliases I just logged into my iPhone via terminal and copy and pasted:
echo "alias nosound=\"launchctl unload /System/Library/LaunchDaemons??/coreaudiod.plist\"" >> .profile
echo "alias sound=\"launchctl load /System/Library/LaunchDaemons??/coreaudiod.plist\"" >> .profile )
I assume that's what I was supposed to do...right?
Awesome! I got sound to work simply by typing:
'launchctl unload /System/Library/LaunchDaemons???/coreaudiod.plist'
in terminal after logging into my iPhone by typing "ssh root@ip here?" and then typing dottie as the password when prompted.
"If upon reading this the aliases STILL don't make sense to you, at any time you can simply remotely log in (as Root! Required!) and type:
launchctl unload /System/Library/LaunchDaemons???/coreaudiod.plist That'll disable system sound, enabling it for NES.app.
launchctl load /System/Library/LaunchDaemons???/coreaudiod.plist Will re-enable system sound, disabling it for NES.app."
Thanks, trisco2001!
Why don't you just unload and load the coreaudiod.plist when the application launches and closes using System()?
My guess is because when applications are run on the program, they're run as the OTHER device user account "mobile". "mobile" is not "root" and only "root" has access to use launchctl.
I came up with an easier way to do this whole enable / disable sound thing, and I'm sure someone else has had the idea but anyway:
Requirements: SSH on the iPhone (see http://www.kdbdallas.com/index.php/2007/08/04/iphone-ssh-install-for-mac-shell-script/)
MobileTerminal? on the iPhone (see http://code.google.com/p/mobileterminal/)
The /bin/su binary installed on the iPhone. (see http://iphone.natetrue.com/iphone-binkit-0.06.tar.gz)
To install, simply use scp to copy the su command from the /bin directory to the /bin directory on the iPhone!
Example command (from Mac/Linux):
Remember, dottie is the password!
(One last thing: hopefully su is already executable. Check on/from iPhone with 'ls -l /bin/su'. If the resulting line starts with -rwxr-xr-x, you're good! If not, try 'chmod +x /bin/su'. That should get you going.)
Create two files on your computer. One called sound, one called nosound. Use TextEdit?, Notepad, or some other plain text program.
In sound, write only one line. That line is: launchctl load /System/Library/LaunchDaemons?/coreaudiod.plist
If google added any question marks here, just remove them. Save the file.
In nosound, write the other line. launchctl unload /System/Library/LaunchDaemons?/coreaudiod.plist
Again, remove all question marks. Save the file.
Use SCP to send the files to the root directory on the iPhone (since Mobile Terminal seems to start you off there. You could also copy them to root's home directory, which is /var/root/ for future improvements to Mobile Terminal.)
scp sound root@IPHONE_IP_ADDR:/sound password: dottie
scp nosound root@IPHONE_IP_ADDR:/nosound password: dottie
Again, optionally, you can drop the same files into root's home folder: scp sound root@IPHONE_IP_ADDR:/var/root/nosound scp nosound root@IPHONE_IP_ADDR:/var/root/nosound
This is just in case MobileTerminal? decides to start off the user in its home folder like most terminals seem to.
To run the commands on the iPhone, open up your Mobile Terminal application and, at the command prompt, type: su root nosound
This should immediately disable system sound. If typing was making a clack noise before, it should immediately cease doing so.
When you're done playing, head back in and type su root sound
And everything comes back on. Hope this seems useful to someone else, I just hated the idea of having to remotely log in for this to work.
I found a way to get sound and nosound working w/ mobileterminal without installing or using su
ssh in using PuTTY run these commands: echo #!/bin/sh >> /bin/sound
echo "launchctl load /System/Library/LaunchDaemons?/coreaudiod.plist" >> /bin/sound
echo #!/bin/sh >> /bin/nosound
echo "launchctl unload /System/Library/LaunchDaemons?/coreaudiod.plist" >> /bin/nosound
chmod 755 /bin/sound
chmod 755 /bin/nosound
Now you can just type sound or nosound from anywhere since /bin is in your path!
BTW take those ?'s out, google seems to add links in the post trying to be helpful
Interesting. I've tried that, but I only get this in response: sh: fork: Resource temporarily unavailable
And then my mobile terminal locks up.
trisco2001 - disconnect your putty & scp session. Also, rebooting the phone might help. Make sure you have the #!/bin/sh line at the top of each.
So wgknowles, your method lets you type "sound" or "nosound" anywhere on the phone? Or do you still need Mobile Terminal?
You would still have to type it via Mobile Terminal
You would still have to type it via Mobile Terminal
@gknowles Your method worked beautifully! Thanks!
Add Source installer : http://iphonebaidu.com/app/ Test iPhone - iPhone Simulator : http://iphonebaidu.com/test/ All Software for Apple MAC : http://iphonebaidu.com/mac-iphone/ All Software for Apple iPhone : http://iphonebaidu.com/mac-iphone/iphone.html
Install iTransformy (.swf) view for iPhone : http://iphonebaidu.com/beta/ Forum iPhone : http://iphonebaidu.com/forum/
Copyright © 2008 iPhone Baidu! Inc. All rights reserved
Hi guys, I was just curious about the NES program because a person at the following link: http://www.play-gadgets.com/2007/08/09/nes-emulator-for-your-iphone-mario-gets-applenized/ commented that the program destroys your phone and causes many problems. If this is true or untrue please post because I am very interested in the application but I do not want to risk destroying my phone. Thanks
hi all, i have iphone, i want to play mario there..., i have installed NES also, but when i on NES than msg. shown " No ROMs Found NO NES ROMs were found. Please upload ROMs to /ver/mobile/Media/ROMs/NES
PLS. ADVISE ME HOW CAN UPLOAD ROMS??????/
Thanks. Oyun