Re: Alsa scenarios , mixer

2008-09-04 Thread François TOURDE
Le 14126ième jour après Epoch,
François TOURDE écrivait:

Ooops...

> #!/usr/bin/python
> # jack.py - An application to read jack
> #
> # Version 0.1
> #
> # Authors: Francois TOURDE <[EMAIL PROTECTED]>
> #
> # Copyright (c) 2008 Thomas Wood

This is not Thomas, replace it with my name and my email, but so can I
thanks Thomas, creator of gta02.py, a demo script in pygtk. Thanks to
him I've been able to write my first python script :)

___
support mailing list
support@lists.openmoko.org
https://lists.openmoko.org/mailman/listinfo/support


Re: Alsa scenarios , mixer

2008-09-04 Thread François TOURDE
Le 14126ième jour après Epoch,
Dale Maggee écrivait:

> Al Johnson wrote:
>> Doesn't do it in 2008.8 though, and the bug report was closed as 'wontfix'
>>
>> http://docs.openmoko.org/trac/ticket/1442
>>   
>
> Oh, joy!
>
>
> /me removes "check out 2008.8-update" from his to-do list

You can use the attached script to do that... Run it as a nohup
background process, or put it on session start scripts.

Pay attention that when you receive a call, the script is not awaken,
so result is unpredictable... (I've not tested this case, because I've
no friends calling me ^^)

#!/usr/bin/python
# jack.py - An application to read jack
#
# Version 0.1
#
# Authors: Francois TOURDE <[EMAIL PROTECTED]>
#
# Copyright (c) 2008 Thomas Wood
#
# jack.py is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# jack.py is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# TODO
#
# Change List
#
# 2008-09-03: First release

import os
import sys

# Hexdump of /dev/input/event0
# When jack inserted
# 9131 48be a594 0001 0005 0002 0001 
# 9131 48be a5f9 0001    
# When jack removed
# 9131 48be a594 0001 0005 0002  
# 9131 48be a5f9 0001    


# Open the jack sensor
f = open("/dev/input/event0", "r")

while 1:
  block = f.read(16)
  if block[8] == "\x05":
if block[10] == "\x02":
  if block[12] == "\x01":
os.system("alsactl -f /usr/share/openmoko/scenarios/headset.state restore")
  if block[12] == "\x00":
os.system("alsactl -f /usr/share/openmoko/scenarios/stereoout.state restore")

# Close the jack
f.close()

-- 
 [11:39] : 8h
 [11:39] : 18h putain
 [11:39] : euh oui 18h
 -+- : in Guide du Petit Joueur: t'as quelle heure, toi ? -+-
___
support mailing list
support@lists.openmoko.org
https://lists.openmoko.org/mailman/listinfo/support


Re: Alsa scenarios , mixer

2008-09-04 Thread Dale Maggee
Al Johnson wrote:
> Doesn't do it in 2008.8 though, and the bug report was closed as 'wontfix'
>
> http://docs.openmoko.org/trac/ticket/1442
>   

Oh, joy!


/me removes "check out 2008.8-update" from his to-do list

___
support mailing list
support@lists.openmoko.org
https://lists.openmoko.org/mailman/listinfo/support


Re: Alsa scenarios , mixer

2008-09-04 Thread Al Johnson
On Thursday 04 September 2008, Dale Maggee wrote:
> > Anyway, this script is usefull when trying to check what's up with the
> > sound, and that jack insertion do nothing on sound :(
>
> it does for me:
>
> [EMAIL PROTECTED]:~# ./findstate
> Current statefile is:  /usr/share/openmoko/scenarios/stereoout.state
>
> (plug in headset)
>
> [EMAIL PROTECTED]:~# ./findstate
> Current statefile is:  /usr/share/openmoko/scenarios/headset.state
> [EMAIL PROTECTED]:~#
>
> also when I use the headset in a call it uses gsmheadset.state rather
> than gsmhandset.state
>
> (I'm using 2007.2)

Doesn't do it in 2008.8 though, and the bug report was closed as 'wontfix'

http://docs.openmoko.org/trac/ticket/1442

___
support mailing list
support@lists.openmoko.org
https://lists.openmoko.org/mailman/listinfo/support


Re: Alsa scenarios , mixer

2008-09-03 Thread Dale Maggee
François TOURDE wrote:
> Le 14117ième jour après Epoch,
> Dale Maggee écrivait:
>   
>> 
>> I wrote a shell script which tells you which state is currently loaded, 
>> using this you can figure out what each state file is for:
>> 
>
> May I suggest a small update to your script, to check if multiple
> files are matching current alsa status?
>   


good point, I had it exiting for maximum speed, it never occured to me 
that there might be multiple identical statefiles. Thanks.

> Anyway, this script is usefull when trying to check what's up with the
> sound, and that jack insertion do nothing on sound :(
>   
it does for me:

[EMAIL PROTECTED]:~# ./findstate
Current statefile is:  /usr/share/openmoko/scenarios/stereoout.state

(plug in headset)

[EMAIL PROTECTED]:~# ./findstate
Current statefile is:  /usr/share/openmoko/scenarios/headset.state
[EMAIL PROTECTED]:~#

also when I use the headset in a call it uses gsmheadset.state rather 
than gsmhandset.state

(I'm using 2007.2)

___
support mailing list
support@lists.openmoko.org
https://lists.openmoko.org/mailman/listinfo/support


Re: Alsa scenarios , mixer

2008-09-03 Thread François TOURDE
Le 14117ième jour après Epoch,
Dale Maggee écrivait:

> Armin ranjbar wrote:
>> Dear all ,
>>
>> i have two question regarding FR audio subsystem : 
>>
>> 1 > i need to when any of alsa scenario files are loading , i need to make
>> modification but i really wonder when which will get loaded 
>>
>> 2 > i need to know exactly what each element of alsamixer doing ?
>>  
>>   
> I wrote a shell script which tells you which state is currently loaded, 
> using this you can figure out what each state file is for:

May I suggest a small update to your script, to check if multiple
files are matching current alsa status?

> #!/bin/sh
> CS="/tmp/current.state"
> alsactl -f $CS store
> Match=0
> for F in `ls /usr/share/openmoko/scenarios/*.state`; do
> #echo "Comparing with $F"
> if [ "`diff $CS $F`" = "" ]; then
> echo "Current statefile is: " $F
> Match=1
> fi
> done;
> [ $Match == 0 ] && echo "Current state matches no file!"

Anyway, this script is usefull when trying to check what's up with the
sound, and that jack insertion do nothing on sound :(

___
support mailing list
support@lists.openmoko.org
https://lists.openmoko.org/mailman/listinfo/support


Re: Alsa scenarios , mixer

2008-08-26 Thread Josh Thompson
On Tuesday August 26, 2008, Dale Maggee wrote:
> As for knowing exactly what each mixer element does, I'd love to know
> this too!

If you look at a state file saved by alsactl, there is a number associated 
with each control.  Many of those are documented in the image labeled 
as "ALSA Channels" at

http://wiki.openmoko.org/wiki/Neo_1973_audio_subsystem

As you can see from the diagram, many of the controls are configure how audio 
is routed through the audio chip.

Josh

___
support mailing list
support@lists.openmoko.org
https://lists.openmoko.org/mailman/listinfo/support


Re: Alsa scenarios , mixer

2008-08-26 Thread Dale Maggee
Armin ranjbar wrote:
> Dear all ,
>
> i have two question regarding FR audio subsystem : 
>
> 1 > i need to when any of alsa scenario files are loading , i need to make
> modification but i really wonder when which will get loaded 
>
> 2 > i need to know exactly what each element of alsamixer doing ?
>  
>   
I wrote a shell script which tells you which state is currently loaded, 
using this you can figure out what each state file is for:

---BEGIN---

#!/bin/sh
CS="/tmp/current.state"
alsactl -f $CS store
for F in `ls /usr/share/openmoko/scenarios/*.state`; do
#echo "Comparing with $F"
if [ "`diff $CS $F`" = "" ]; then
echo "Current statefile is: " $F
exit
fi
done;
echo "Current state matches no file!"

---END---

As for knowing exactly what each mixer element does, I'd love to know 
this too!


HTH,
-Dale

___
support mailing list
support@lists.openmoko.org
https://lists.openmoko.org/mailman/listinfo/support


Alsa scenarios , mixer

2008-08-26 Thread Armin ranjbar
Dear all ,

i have two question regarding FR audio subsystem : 

1 > i need to when any of alsa scenario files are loading , i need to make
modification but i really wonder when which will get loaded 

2 > i need to know exactly what each element of alsamixer doing ?
 
-- 
Armin ranjbar , System Administrator

___
support mailing list
support@lists.openmoko.org
https://lists.openmoko.org/mailman/listinfo/support