All of lore.kernel.org
 help / color / mirror / Atom feed
* How can you tell if the speaker jack on your sound card has anything plugged into it???
@ 2008-04-25 19:28 Sean Thayne
  0 siblings, 0 replies; 14+ messages in thread
From: Sean Thayne @ 2008-04-25 19:28 UTC (permalink / raw)
  To: alsa-devel

Hi Everybody,

      I was talking with some users in the irc channel in the free node, 
and was hoping to find a way to get the information about weither or not 
anything was plugged into the sound card, I've seen this feature with 
windows vista. I search thru a bunch of documentation sites and also 
scanned the /proc & /sys to no avail...

Thanks,
Sean T

^ permalink raw reply	[flat|nested] 14+ messages in thread

* How can you tell if the speaker jack on your sound card has anything plugged into it???
@ 2008-04-25 19:29 Sean Thayne
  0 siblings, 0 replies; 14+ messages in thread
From: Sean Thayne @ 2008-04-25 19:29 UTC (permalink / raw)
  To: alsa-devel

Hi Everybody,

      I was talking with some users in the irc channel in the free node, 
and was hoping to find a way to get the information about weither or not 
anything was plugged into the sound card, I've seen this feature with 
windows vista. I search thru a bunch of documentation sites and also 
scanned the /proc & /sys to no avail...

Thanks,
Sean T

^ permalink raw reply	[flat|nested] 14+ messages in thread

* How can you tell if the speaker jack on your sound card has anything plugged into it???
@ 2008-04-25 19:29 Sean Thayne
  2008-04-25 19:49 ` Mark Brown
  0 siblings, 1 reply; 14+ messages in thread
From: Sean Thayne @ 2008-04-25 19:29 UTC (permalink / raw)
  To: alsa-devel

Hi Everybody,

      I was talking with some users in the irc channel in the free node, 
and was hoping to find a way to get the information about weither or not 
anything was plugged into the sound card, I've seen this feature with 
windows vista. I search thru a bunch of documentation sites and also 
scanned the /proc & /sys to no avail...

Thanks,
Sean T

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How can you tell if the speaker jack on your sound card has anything plugged into it???
  2008-04-25 19:29 How can you tell if the speaker jack on your sound card has anything plugged into it??? Sean Thayne
@ 2008-04-25 19:49 ` Mark Brown
  2008-04-25 20:53   ` Sean Thayne
  2008-04-25 21:08   ` Robert Jarzmik
  0 siblings, 2 replies; 14+ messages in thread
From: Mark Brown @ 2008-04-25 19:49 UTC (permalink / raw)
  To: Sean Thayne; +Cc: alsa-devel

On Fri, Apr 25, 2008 at 01:29:59PM -0600, Sean Thayne wrote:

>       I was talking with some users in the irc channel in the free node, 
> and was hoping to find a way to get the information about weither or not 
> anything was plugged into the sound card, I've seen this feature with 
> windows vista. I search thru a bunch of documentation sites and also 
> scanned the /proc & /sys to no avail...

There's currently no standard way of getting this information from user
space even where the hardware provides it.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How can you tell if the speaker jack on your sound card has anything plugged into it???
  2008-04-25 19:49 ` Mark Brown
@ 2008-04-25 20:53   ` Sean Thayne
  2008-04-25 20:56     ` Timur Tabi
  2008-04-25 21:08   ` Robert Jarzmik
  1 sibling, 1 reply; 14+ messages in thread
From: Sean Thayne @ 2008-04-25 20:53 UTC (permalink / raw)
  To: alsa-devel

How would one go about getting this info? I'm trying to create a 
monitoring tool for a specific sound card, so the driver's standardized...

Mark Brown wrote:
> On Fri, Apr 25, 2008 at 01:29:59PM -0600, Sean Thayne wrote:
>
>   
>>       I was talking with some users in the irc channel in the free node, 
>> and was hoping to find a way to get the information about weither or not 
>> anything was plugged into the sound card, I've seen this feature with 
>> windows vista. I search thru a bunch of documentation sites and also 
>> scanned the /proc & /sys to no avail...
>>     
>
> There's currently no standard way of getting this information from user
> space even where the hardware provides it.
>
>
>   

-- 
Sean Thayne
Summit Media Group LLC.
5532 Lillehammer Lane, Suite 300
Park City, UT 84098
T: (435) 575-0610 ext 115
F: (435) 615-9979
E: sthayne@smgroupllc.com <mailto:sthayne@smgroupllc.com>
W: http://www.smgroupllc.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How can you tell if the speaker jack on your sound card has anything plugged into it???
  2008-04-25 20:53   ` Sean Thayne
@ 2008-04-25 20:56     ` Timur Tabi
  2008-04-25 21:02       ` Sean Thayne
  2008-04-25 22:02       ` Mark Brown
  0 siblings, 2 replies; 14+ messages in thread
From: Timur Tabi @ 2008-04-25 20:56 UTC (permalink / raw)
  To: Sean Thayne; +Cc: alsa-devel

Sean Thayne wrote:
> How would one go about getting this info? I'm trying to create a 
> monitoring tool for a specific sound card, so the driver's standardized...

First, the hardware has to detect insertion.  Then, it has to send a 
signal to the driver (either via a status register or an interrupt).

Assuming you have all that (I've never seen a sound card that provides 
this info), perhaps you can specify the output jack only when something 
is plugged in?  That is, you register the output jack when something is 
plugged in, and then deregister it when something is removed.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How can you tell if the speaker jack on your sound card has anything plugged into it???
  2008-04-25 20:56     ` Timur Tabi
@ 2008-04-25 21:02       ` Sean Thayne
  2008-04-25 21:04         ` Timur Tabi
  2008-04-25 22:02       ` Mark Brown
  1 sibling, 1 reply; 14+ messages in thread
From: Sean Thayne @ 2008-04-25 21:02 UTC (permalink / raw)
  To: alsa-devel

How do you think Vista does it? I've used a couple of different 
computers (totally different hardware) and it can detect insertion for 
them all...

Timur Tabi wrote:
> Sean Thayne wrote:
>   
>> How would one go about getting this info? I'm trying to create a 
>> monitoring tool for a specific sound card, so the driver's standardized...
>>     
>
> First, the hardware has to detect insertion.  Then, it has to send a 
> signal to the driver (either via a status register or an interrupt).
>
> Assuming you have all that (I've never seen a sound card that provides 
> this info), perhaps you can specify the output jack only when something 
> is plugged in?  That is, you register the output jack when something is 
> plugged in, and then deregister it when something is removed.
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
>
>   

-- 
Sean Thayne
Summit Media Group LLC.
5532 Lillehammer Lane, Suite 300
Park City, UT 84098
T: (435) 575-0610 ext 115
F: (435) 615-9979
E: sthayne@smgroupllc.com <mailto:sthayne@smgroupllc.com>
W: http://www.smgroupllc.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How can you tell if the speaker jack on your sound card has anything plugged into it???
  2008-04-25 21:02       ` Sean Thayne
@ 2008-04-25 21:04         ` Timur Tabi
  0 siblings, 0 replies; 14+ messages in thread
From: Timur Tabi @ 2008-04-25 21:04 UTC (permalink / raw)
  To: Sean Thayne; +Cc: alsa-devel

Sean Thayne wrote:
> How do you think Vista does it? I've used a couple of different 
> computers (totally different hardware) and it can detect insertion for 
> them all...

Since I've never used Vista, I have no idea how it does it.  However, my 
point still stands: unless the hardware detects it and provide status 
information to the driver, there's nothing you can do.

So just figure out how your hardware provides the info, and then update 
your driver accordingly.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How can you tell if the speaker jack on your sound card has anything plugged into it???
  2008-04-25 19:49 ` Mark Brown
  2008-04-25 20:53   ` Sean Thayne
@ 2008-04-25 21:08   ` Robert Jarzmik
  2008-04-25 21:28     ` Lennart Poettering
                       ` (2 more replies)
  1 sibling, 3 replies; 14+ messages in thread
From: Robert Jarzmik @ 2008-04-25 21:08 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, Sean Thayne

Mark Brown <broonie@opensource.wolfsonmicro.com> writes:

> There's currently no standard way of getting this information from user
> space even where the hardware provides it.
Isn't the event api switch "SW_HEADPHONE_INSERT" standard ?
I thought it was designed for such use.

If I'm not mistaken, the Neo teams handles it that way, as I do for the mio :
 -> input_report_switch(mioa701_evdev, SW_HEADPHONE_INSERT, val);

--
Robert

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How can you tell if the speaker jack on your sound card has anything plugged into it???
  2008-04-25 21:08   ` Robert Jarzmik
@ 2008-04-25 21:28     ` Lennart Poettering
  2008-04-25 21:32     ` Tobin Davis
  2008-04-25 21:40     ` Mark Brown
  2 siblings, 0 replies; 14+ messages in thread
From: Lennart Poettering @ 2008-04-25 21:28 UTC (permalink / raw)
  To: alsa-devel

On Fri, 25.04.08 23:08, Robert Jarzmik (rjarzmik@free.fr) wrote:

> 
> Mark Brown <broonie@opensource.wolfsonmicro.com> writes:
> 
> > There's currently no standard way of getting this information from user
> > space even where the hardware provides it.
> Isn't the event api switch "SW_HEADPHONE_INSERT" standard ?
> I thought it was designed for such use.
> 
> If I'm not mistaken, the Neo teams handles it that way, as I do for the mio :
>  -> input_report_switch(mioa701_evdev, SW_HEADPHONE_INSERT, val);

AFAIK HDA generally supports Jack Sensing. However
it's not wired up properly on all hardware. And there's no driver support
in the Linux HDA driver to generate an input device for jack
sensing.

But I might be mistaken. Takashi and Jaroslav know the current state
of Jack Sensing on Linux much better.

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net         ICQ# 11060553
http://0pointer.net/lennart/           GnuPG 0x1A015CC4

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How can you tell if the speaker jack on your sound card has anything plugged into it???
  2008-04-25 21:08   ` Robert Jarzmik
  2008-04-25 21:28     ` Lennart Poettering
@ 2008-04-25 21:32     ` Tobin Davis
  2008-04-25 21:55       ` Mark Brown
  2008-04-25 21:40     ` Mark Brown
  2 siblings, 1 reply; 14+ messages in thread
From: Tobin Davis @ 2008-04-25 21:32 UTC (permalink / raw)
  To: Robert Jarzmik; +Cc: alsa-devel, Mark Brown, Sean Thayne

The snd_hda_intel driver does this internally to mute the speakers when
headphones are plugged in.  Ditto for front mic.  But you are right, we
need a standard way of tracking this.  I am exploring the HAL interface
now to see what I can learn from it.  And most sound chips have an
insert detection mechanism.  Usually they are wired to specific jacks,
but sometimes they just register a change in plug state, and read the
jack's impedance levels to know which jack is used.  It is documented in
the Sigmatel/IDT, Realtek, and Analog Devices codec PRMs.

Tobin


On Fri, 2008-04-25 at 23:08 +0200, Robert Jarzmik wrote:

> Mark Brown <broonie@opensource.wolfsonmicro.com> writes:
> 
> > There's currently no standard way of getting this information from user
> > space even where the hardware provides it.
> Isn't the event api switch "SW_HEADPHONE_INSERT" standard ?
> I thought it was designed for such use.
> 
> If I'm not mistaken, the Neo teams handles it that way, as I do for the mio :
>  -> input_report_switch(mioa701_evdev, SW_HEADPHONE_INSERT, val);
> 
> --
> Robert
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

-- 
Tobin Davis 


All of the true things I am about to tell you are shameless lies.
		-- The Book of Bokonon / Kurt Vonnegut Jr.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How can you tell if the speaker jack on your sound card has anything plugged into it???
  2008-04-25 21:08   ` Robert Jarzmik
  2008-04-25 21:28     ` Lennart Poettering
  2008-04-25 21:32     ` Tobin Davis
@ 2008-04-25 21:40     ` Mark Brown
  2 siblings, 0 replies; 14+ messages in thread
From: Mark Brown @ 2008-04-25 21:40 UTC (permalink / raw)
  To: Robert Jarzmik; +Cc: alsa-devel, Sean Thayne

On Fri, Apr 25, 2008 at 11:08:49PM +0200, Robert Jarzmik wrote:

> Isn't the event api switch "SW_HEADPHONE_INSERT" standard ?
> I thought it was designed for such use.

Yes.  It'll also need extending to cover things that can detect jack
insertions other than headphones (espcailly usefully for devices that
can identify what is plugged into the jack).

> If I'm not mistaken, the Neo teams handles it that way, as I do for the mio :
>  -> input_report_switch(mioa701_evdev, SW_HEADPHONE_INSERT, val);

Indeed, and hopefully it'll get more widely adopted, at least for
embedded stuff.  Unfortunately adoption is currently rather limited -
the only in-tree users are the Zaurus machines.

I'm currently working on some helpers for ALSA for this.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How can you tell if the speaker jack on your sound card has anything plugged into it???
  2008-04-25 21:32     ` Tobin Davis
@ 2008-04-25 21:55       ` Mark Brown
  0 siblings, 0 replies; 14+ messages in thread
From: Mark Brown @ 2008-04-25 21:55 UTC (permalink / raw)
  To: Tobin Davis; +Cc: Robert Jarzmik, alsa-devel, Sean Thayne

On Fri, Apr 25, 2008 at 02:32:42PM -0700, Tobin Davis wrote:

> The snd_hda_intel driver does this internally to mute the speakers when
> headphones are plugged in.  Ditto for front mic.  But you are right, we
> need a standard way of tracking this.  I am exploring the HAL interface
> now to see what I can learn from it.  And most sound chips have an

The interface I'd previously proposed here was to provide an input
device per-jack which would do this - hal should then be able to monitor
the input device.  As suggested in the original message in the thread
providing sysfs information would probably be helpful for scripts.

> insert detection mechanism.  Usually they are wired to specific jacks,
> but sometimes they just register a change in plug state, and read the
> jack's impedance levels to know which jack is used.  It is documented in
> the Sigmatel/IDT, Realtek, and Analog Devices codec PRMs.

Yes, that's how all the codecs I've looked at do this.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: How can you tell if the speaker jack on your sound card has anything plugged into it???
  2008-04-25 20:56     ` Timur Tabi
  2008-04-25 21:02       ` Sean Thayne
@ 2008-04-25 22:02       ` Mark Brown
  1 sibling, 0 replies; 14+ messages in thread
From: Mark Brown @ 2008-04-25 22:02 UTC (permalink / raw)
  To: Timur Tabi; +Cc: alsa-devel, Sean Thayne

On Fri, Apr 25, 2008 at 03:56:46PM -0500, Timur Tabi wrote:

> First, the hardware has to detect insertion.  Then, it has to send a 
> signal to the driver (either via a status register or an interrupt).

> Assuming you have all that (I've never seen a sound card that provides 
> this info), perhaps you can specify the output jack only when something 

This is supported in a reasonable proportion of CODEC chips these days,
particularly those that have direct headphone and/or microphone support.
It's more frequently used in mobile devices than desktops (since they
tend to experience more plug/unplug events) but with the spread of
laptops it's now fairly common in PC class hardware.

> is plugged in?  That is, you register the output jack when something is 
> plugged in, and then deregister it when something is removed.

It's probably be easier from a UI perspective if the jack is always
present in the UI but applications can tell if it's disabled - the
physical jack is always there, after all.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2008-04-25 22:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-25 19:29 How can you tell if the speaker jack on your sound card has anything plugged into it??? Sean Thayne
2008-04-25 19:49 ` Mark Brown
2008-04-25 20:53   ` Sean Thayne
2008-04-25 20:56     ` Timur Tabi
2008-04-25 21:02       ` Sean Thayne
2008-04-25 21:04         ` Timur Tabi
2008-04-25 22:02       ` Mark Brown
2008-04-25 21:08   ` Robert Jarzmik
2008-04-25 21:28     ` Lennart Poettering
2008-04-25 21:32     ` Tobin Davis
2008-04-25 21:55       ` Mark Brown
2008-04-25 21:40     ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2008-04-25 19:29 Sean Thayne
2008-04-25 19:28 Sean Thayne

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.