maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Do you want a headphone daemon? (actions based on headphone plugging) (https://talk.maemo.org/showthread.php?t=24975)

thp 2008-11-14 08:42

Do you want a headphone daemon? (actions based on headphone plugging)
 
Hi there!

I've been thinking for some time now for an application that controls certain aspects of my tablet when my headphone is plugged in or unplugged. I currently walk to university while listening to podcasts on my N800 (using headphones) and then when I get into the auditorium unplug the headphones - always then I want to mute the audio of my N800, so I don't disturbe the lecture.

When I head for home again, I plug in my headphone and have to manually unmute my tablet's audio.

I want to write an app that runs in the background and waits for some actions to happen (headphone plugged, unplugged - maybe others) and reacts to these by running certain actions that can either be pre-defined (mute audio, unmute audio) user customizable. The app would run in the background with no UI other than a control panel configuration screen and maybe an optional system notification icon.

What do you think? Would something like this be useful to you? Do you have other suggestions for me that would be important to know before starting on this project? Does such a beast exist already?

tso 2008-11-14 08:52

Re: Do you want a headphone daemon? (actions based on headphone plugging)
 
im tempted to ask if not powerlaunch can already do this...

thp 2008-11-14 09:08

Re: Do you want a headphone daemon? (actions based on headphone plugging)
 
Quote:

Originally Posted by tso (Post 241937)
im tempted to ask if not powerlaunch can already do this...

Does it? If so, that would be awesome. Can someone confirm this?

icebox 2008-11-14 10:04

Re: Do you want a headphone daemon? (actions based on headphone plugging)
 
A clean documentation with examples for powerlaunch would be great :D

I know of things it can do but never managed to configure

munky261 2008-11-14 11:23

Re: Do you want a headphone daemon? (actions based on headphone plugging)
 
id just be happy for the volume to not get turned down when i insert headphones....anyone know of anyway to do this?

tso 2008-11-14 11:30

Re: Do you want a headphone daemon? (actions based on headphone plugging)
 
heh, sounds like some kind of ear protection thing, so that people cant complain to nokia about the tablet damaging their hearing.

pycage 2008-11-14 12:30

Re: Do you want a headphone daemon? (actions based on headphone plugging)
 
Quote:

Originally Posted by munky261 (Post 241953)
id just be happy for the volume to not get turned down when i insert headphones....anyone know of anyway to do this?

Don't use the headphones that came with the device. They're damn silent and sound bad.
I use Sennheiser ear-plugs and they can go very loud (louder than I would ever want).

allnameswereout 2008-11-14 13:27

Re: Do you want a headphone daemon? (actions based on headphone plugging)
 
Personally, I would not use such, but this should be part of HAL or the extended daemon of HAL don't have time now to search for this it might be listed at http://www.freedesktop.org/wiki/Software

qwerty12 2008-11-14 15:30

Re: Do you want a headphone daemon? (actions based on headphone plugging)
 
If I may, I'll place a plug:
http://www.internettablettalk.com/fo...ad.php?t=21182

This one lets you use the headset button :D

Benson 2008-11-14 15:55

Re: Do you want a headphone daemon? (actions based on headphone plugging)
 
multimediad (Nokia closed stuff) seems to handle at least some of this stuff. An open replacement for that would be awesome.

MattZTexasu 2008-11-14 17:18

Re: Do you want a headphone daemon? (actions based on headphone plugging)
 
Quote:

Originally Posted by qwerty12 (Post 241987)
If I may, I'll place a plug:
http://www.internettablettalk.com/fo...ad.php?t=21182

This one lets you use the headset button :D

What this thread is describing would allow you to mute the entire tablet when the headphones are unplugged. I don't understand how headset-control is related...

qwerty12 2008-11-14 17:23

Re: Do you want a headphone daemon? (actions based on headphone plugging)
 
Quote:

Originally Posted by MattZTexasu (Post 242010)
What this thread is describing would allow you to mute the entire tablet when the headphones are unplugged. I don't understand how headset-control is related...

Good point, I guess it could be quickly ripped to do this. (Volume is stored as a gconf value). As for being related, well, technically they both are daemons (in the case of the muting one, planned to be obviously) and they both do something with the headset.

MattZTexasu 2008-11-14 18:44

Re: Do you want a headphone daemon? (actions based on headphone plugging)
 
so you're suggesting that headset-control could be modified to monitor not just the headset button, but also the presence of earphones, and then to take some action on the plug/unplug events?

Sounds like a good idea to me.

How will this effect power drain?

Mikma 2008-11-14 20:44

Re: Do you want a headphone daemon? (actions based on headphone plugging)
 
http://mikma.reaktio.net/maemo/hsd.png

Khertan 2008-11-14 21:09

Re: Do you want a headphone daemon? (actions based on headphone plugging)
 
Oh my god please not an other daemon !

:)

lardman 2008-11-15 10:15

Re: Do you want a headphone daemon? (actions based on headphone plugging)
 
Regarding your requirements in the first post, a location (GPS/wifi in sight) and time based system might suit you better (possibly along with the headphone behaviour too). Not that one exists (yet), but it would be cool, a Killer App even, to have the device do certain things depending on time and location contstraints.

lcuk 2008-11-15 11:59

Re: Do you want a headphone daemon? (actions based on headphone plugging)
 
Quote:

Originally Posted by lardman (Post 242150)
Regarding your requirements in the first post, a location (GPS/wifi in sight) and time based system might suit you better (possibly along with the headphone behaviour too). Not that one exists (yet), but it would be cool, a Killer App even, to have the device do certain things depending on time and location contstraints.

heh, that could get embarrassing quickly if it detects you in the wrong place or time.

austin 2008-11-15 16:36

Re: Do you want a headphone daemon? (actions based on headphone plugging)
 
Quote:

Originally Posted by icebox (Post 241945)
A clean documentation with examples for powerlaunch would be great :D

Yes, powerlaunch can do this easily. Edit /etc/powerlaunch/powerlaunch.conf (or make a copy to ~/.powerlaunch/powerlaunch.conf before editing). Here's a simple example to mute/unmute on headphone plugging in. You can run any other action you want on headphone plugging in.

Add "default_inherit common.headphone" to the end of main.on_init and add headphone_connected and headphone_disconnected handlers. The beginning of powerlaunch.conf would look like this:

Code:

on_init = load common; load mce; load systemui; load alarm; inherit systemui.ui; call start_apps; default_inherit common.headphone

headphone_connected = call system.volume.unmute
headphone_disconnected = call system.volume.mute


fizze 2008-11-16 10:31

Re: Do you want a headphone daemon? (actions based on headphone plugging)
 
Quote:

Originally Posted by lardman (Post 242150)
Regarding your requirements in the first post, a location (GPS/wifi in sight) and time based system might suit you better (possibly along with the headphone behaviour too). Not that one exists (yet), but it would be cool, a Killer App even, to have the device do certain things depending on time and location contstraints.

I'm also still waiting for GPS-enabled cellphones to do this.
I just think of profile switching when near the office / near home.

The pain is that GPS would have to be running always, so it might be better to deduct the location information also from bluetooth or wireless lan peripherals.
0.02€ ;)

allnameswereout 2008-11-23 17:20

Re: Do you want a headphone daemon? (actions based on headphone plugging)
 
DeviceKit is the project I meant. It uses HAL, is under construction, and will be included in Fedora 11.

Naranek 2008-11-23 18:13

Re: Do you want a headphone daemon? (actions based on headphone plugging)
 
It would be great to also be able to launch a program automatically when plugging the headphones in. 9 out of 10 times I plug them in I want to listen to music with Canola, so launching it automatically would be great. There could be a few seconds of delay so it would be possible to cancel the launch.

inoshishi 2008-11-24 12:52

Re: Do you want a headphone daemon? (actions based on headphone plugging)
 
Or it could trigger some voice-menu using flite to let you choose the application to launch by clicking the button. So that you can launch useful applications without taking your tablet out of your pocket.


All times are GMT. The time now is 12:44.

vBulletin® Version 3.8.8