Notices


Reply
Thread Tools
Posts: 418 | Thanked: 174 times | Joined on Oct 2009
#1
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?
 

The Following 10 Users Say Thank You to Tintin For This Useful Post:
vkv.raju's Avatar
Posts: 402 | Thanked: 448 times | Joined on Dec 2007 @ India
#2
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.
 

The Following User Says Thank You to vkv.raju For This Useful Post:
thp's Avatar
Posts: 1,389 | Thanked: 4,248 times | Joined on Sep 2007 @ Vienna, Austria
#3
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.
 

The Following 11 Users Say Thank You to thp For This Useful Post:
thp's Avatar
Posts: 1,389 | Thanked: 4,248 times | Joined on Sep 2007 @ Vienna, Austria
#4
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
 

The Following 7 Users Say Thank You to thp For This Useful Post:
zerojay's Avatar
Posts: 2,669 | Thanked: 2,552 times | Joined on Apr 2007 @ Halifax, Nova Scotia, Canada
#5
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.
 

The Following User Says Thank You to zerojay For This Useful Post:
thp's Avatar
Posts: 1,389 | Thanked: 4,248 times | Joined on Sep 2007 @ Vienna, Austria
#6
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.
Attached Files
File Type: zip headphoned.zip (27.6 KB, 255 views)
 

The Following 4 Users Say Thank You to thp For This Useful Post:
Posts: 418 | Thanked: 174 times | Joined on Oct 2009
#7
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

Last edited by Tintin; 2009-10-21 at 15:03.
 
thp's Avatar
Posts: 1,389 | Thanked: 4,248 times | Joined on Sep 2007 @ Vienna, Austria
#8
Originally Posted by Tintin View Post
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
It's just a binary executable, no package (yet..). You can start it like this (run it as normal user, there is no need to run it as root):

Code:
chmod +x headphoned-armel-diablo
./headphoned-armel-diablo &
The first command makes the file executable and you only need to do it once.

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.
 

The Following User Says Thank You to thp For This Useful Post:
Posts: 418 | Thanked: 174 times | Joined on Oct 2009
#9
Originally Posted by thp View Post
It's just a binary executable, no package (yet..). You can start it like this (run it as normal user, there is no need to run it as root):

Code:
chmod +x headphoned-armel-diablo
./headphoned-armel-diablo &
The first command makes the file executable and you only need to do it once.

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.
Hey and thanks again.
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?)
 
Posts: 87 | Thanked: 36 times | Joined on Sep 2009 @ Helsinki
#10
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.


Originally Posted by Tintin View Post
Hey and thanks again.
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?)
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 22:40.