![]() |
Stopping music/media player when headset unplugged
One thing that i really like about my Zune is that whenever I pull the headset out (which I tend to do a lot by accident) - the player stops. Obviously that makes sense on the Zune (non-HD) as it doesnt have any external speakers.
I would love for there to be an option to have my N810 act in the same way; If playing a movie/music/podcast and the headset is pulled out...then stop the player. If you want to continue to play through your speakers just press play and it continues playing. Happened again today that I stand in line and the headset pulls out and suddenly I'm blasting Cypress Hill from my right pocket.... Thing is...would such an option have to be implemented into each possible media player...or could it somehow be a global, application-independent option...somehow? |
Re: Stopping music/media player when headset unplugged
I like this. This will be a nice feature. Will save many from those little occasional embarrassments.
Pause audio/video when the headset is pulled out. |
Re: Stopping music/media player when headset unplugged
You can detect headphone plug/unplug events via D-Bus, so you could write a service that then notifies the media players.
BTW: On the N900, you can non-headphone and headphone volume independently, so if you set the volume to zero when the headphones are not plugged in, then connect the headphones and set some positive volume, if you accidentally unplug the headphones in a subway or bus, people won't be distracted by whatever fancy music you decided to listen to today. That said, a mini-daemon that listens on D-Bus for headphone unplug changes and sets/remembers/restores the volume for each different mode would probably be easy to do and avoid what I call the "public transport situation" ("waiting in line situation" for you ;) for all media players. |
Re: Stopping music/media player when headset unplugged
Oh, and I just found out (while searching for code) that there have already been several threads about this:
http://talk.maemo.org/showthread.php?t=26925 http://talk.maemo.org/showthread.php?t=24975 ..and the solution (as a package) is here: http://talk.maemo.org/showthread.php?t=21182 ..or if you prefer powerlaunch: http://talk.maemo.org/showpost.php?p...7&postcount=18 |
Re: Stopping music/media player when headset unplugged
Only problem with this is that sometimes the N900 seems to forget that there are headphones plugged in from time to time and the headphones icon disappears from the status bar.
|
Re: Stopping music/media player when headset unplugged
1 Attachment(s)
Here's a quicky hacked together version of what you want. Compiled against Diablo's SDK. Source + Git repository included.
Either compile it yourself in the SDK or trust my binary and copy headphoned-armel-diablo to your N8x0 and then start it. Everytime the headphone is disconnected, headphoned will send a "pause" event (the same as clicking on pause in the Media Player) to the player. |
Re: Stopping music/media player when headset unplugged
Hi and wow thanks for the super quick 'fix' :)
I'm still new to the Linux world so sorry for the follow-up questiom: I downloaded your zipfile to my N810 and unzipped it. I can see the files/directories it created (including the headphoned-armel-diablo file in the main /headphoned folder - but how do I actually open/install it? I tried browsing to it through the application manager but wasn't able to find anything I could install. Man, if this will work this will be awesome :) Edit: I tried apt-get -f install headphoned-armel-diablo in the /headphoned folder (while I was root) but got the error 'Couldnt find package headphoned-armel-diablo' Also tried dpkg -i headphoned-armel-diablo but with no luck |
Re: Stopping music/media player when headset unplugged
Quote:
Code:
chmod +x headphoned-armel-diablo The ampersand [&] will cause it to run in the background. You can use "ps ax | grep headphoned" to check if it's running and you can use "killall headphoned-armel-diablo" to kill it. Here's a nice beginner tutorial for getting used to the command line: http://www.linuxcommand.org/ HTH. |
Re: Stopping music/media player when headset unplugged
Quote:
I wasn't sure if the code you included was supposed to be run as two entries or as one long sentence. I tried both but did not seem to do anything. When executing the first row I don't get any confirmation or error message. When executing the second row I got 'no permission'. I tried checking for active processes using an app i got running in tne status barr but it didnt show there - and i also tried pulling out the cord whilst playing a podcast through gpodder/panucci but the player did not pause. Sorry for being new to all of this and making helping out a lenghty process. (Also..how do I get a 'pipe' as in your example for how to check what processes are active using my N810 keyboard?) |
Re: Stopping music/media player when headset unplugged
Sounds like you are perhaps in the wrong directory when you execute the chmod command. Try moving to the directory you extracted with command "cd" [directory]. To make sure the chmod worked, you can run "ls -la", it should show something like "-r-x------" [filename], where "x" means you can now run the application.
Symbol "|" is called pipe, and it gives the output of first command to the second command. Most usual use case is probably finding some specific string in a long text output, like: "ps aux | grep [name of the program]". Not sure what you need to press to get it out of n810 ;) Oh, and the "ps aux" above lists all the running processes. Quote:
|
All times are GMT. The time now is 01:28. |
vBulletin® Version 3.8.8