maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N810 (https://talk.maemo.org/forumdisplay.php?f=28)
-   -   Speaker/Headphone switch? (https://talk.maemo.org/showthread.php?t=26925)

vs.taras 2009-02-17 05:18

Speaker/Headphone switch?
 
Some of you have probably experienced this problem:
You're listening to music with your tablet, and the headphone jack comes out. Voila, now the library, your class, or just the general public are forced upon your blaring and horrendous music taste. Is there any way to spare this incident from occuring again? Maybe an applet for switching between headphones and speakers? Or a hack to pause the music if you headphones come out, like the iPod? I really don't want to have to get another music player, and will have to if I can't solve this.
Any ideas out there guys?

Thesandlord 2009-02-17 06:44

Re: Speaker/Headphone switch?
 
I know this is possible. Don't have the skill to make it.

Is this already done somewhere? For example, the FM radio apps can select between speakers and headphones...

codeMonkey 2009-02-17 09:15

Re: Speaker/Headphone switch?
 
Definitely possible - I'm sure that someone implemented a daemon to change volume when the head-set is plugged in.

I think someone implemented something similar with powerlaunch, too.

pycage 2009-02-17 10:14

Re: Speaker/Headphone switch?
 
You could monitor /sys/devices/platform/gpio-switch/headphone/state for detecting plugging in the headset. It also generates some D-Bus event, IIRC.

Here's some code for headset stuff:

https://garage.maemo.org/plugins/scm...ox&view=markup

dfinch 2009-02-17 11:30

Re: Speaker/Headphone switch?
 
Depending upon how you are using the tablet, can you loop the cable around the stand one time to provide a strain relief?

A more elegant solution would be a strip of (soft side) self adhesive velcro on the back of the tablet. Then plug in, pass the cable over the soft velcro and hold in place with the grippy velcro strip. This would put a 180 deg bend in the cable (make the loop gentle) and any tug would not pull the plug.

Not quite the solution you were after but simple, quick and certainly do-able.

Sevanteri 2009-02-17 11:44

Re: Speaker/Headphone switch?
 
Quote:

Originally Posted by dfinch (Post 265078)
A more elegant solution would be a strip of (soft side) self adhesive velcro on the back of the tablet. Then plug in, pass the cable over the soft velcro and hold in place with the grippy velcro strip. This would put a 180 deg bend in the cable (make the loop gentle) and any tug would not pull the plug.

Ha... Never thought that either. :P

I also had the same idea some time ago. But I too don't have the skill to do even that simple app.
I can make an app that checks the /sys/devices/platform/gpio-switch/headphone/state
but... how do I make it mute my tablet and other way; how to make an background app; and how to make it start when the tablet starts.

vs.taras 2009-02-17 13:30

Re: Speaker/Headphone switch?
 
Quote:

Originally Posted by codeMonkey (Post 265067)
Definitely possible - I'm sure that someone implemented a daemon to change volume when the head-set is plugged in.

That would be awesome if you could find that daemon..
I'm surprised this isn't ever brought up.

codeMonkey 2009-02-17 13:42

Re: Speaker/Headphone switch?
 
There were discussions here.


All times are GMT. The time now is 07:54.

vBulletin® Version 3.8.8