Active Topics

 


Reply
Thread Tools
Posts: 2,076 | Thanked: 3,268 times | Joined on Feb 2011
#31
You could try to put
jack-bias: on
in all possible modes in alsaped.conf, it is probably not the best way though. It (and 'off') are in [context] part so hard to say without source when those kick in/switch. Maybe commenting bias on/off from there and manually setting it once to 'on' would do the trick?
 
Posts: 2,154 | Thanked: 8,464 times | Joined on May 2010
#32
I tried to change 'off' to 'on' but sometimes alsaped disabled it too...
 
Posts: 2,076 | Thanked: 3,268 times | Joined on Feb 2011
#33
Remove all bias stuff from conf and you can be sure it is not alsaped and maybe some other program is interfering (do you have a reproducible case of it going back off?). Not sure how to trace it, but with reproducible case dbus-monitor(?) maybe might help
 
Posts: 567 | Thanked: 2,965 times | Joined on Oct 2009
#34
The interesting stuff for this (i.e. jack stuff) is handled by the compiled prolog files in policy-settings-rx51.
There is http://meego.gitorious.org/maemo-mul...ic/trees/n900/ which is for MeeGo but it doesn't contain any jack stuff in it.
 

The Following 3 Users Say Thank You to jonwil For This Useful Post:
Posts: 2,154 | Thanked: 8,464 times | Joined on May 2010
#35
Code:
$ dbus-monitor --system
...
signal sender=:1.16 -> dest=(null destination) serial=109 path=/com/nokia/policy/decision; interface=com.nokia.policy; member=audio_actions
   uint32 0
   array [
...
      dict entry(
         string "com.nokia.policy.context"
         array [
            array [
               struct {
                  string "variable"
                  variant                      string "jackbias"
               }
               struct {
                  string "value"
                  variant                      string "off"
               }
            ]
       )
...
    ]
...
$ mdbus2 --system -a -p | grep :1.16
:1.16 (818)
$ ps auxf | grep 818
  818 root      8372 S    /usr/sbin/ohmd --no-daemon
So that dbus signal which turn off jack bias was sent from ohmd daemon.
 

The Following 4 Users Say Thank You to pali For This Useful Post:
Posts: 2,154 | Thanked: 8,464 times | Joined on May 2010
#36
And it is send by ohm playback plugin:
https://meego.gitorious.org/maemo-mu...usif.c#line751

app-detect sending informations to ohmd via socket and app-detect binary contains strings:
Code:
usage: %s [-h] [-p priority] [-c class]
        h               print this help message and exit
        p priority      run on run-time priority
        s class         system UI window class
        c class         call UI window class
127.0.0.1
app-detect [ERROR]: Failed to setup connection to policy server port %d. Reason: %s
%d standby
%d %s
active
%d %s
%d standby
systemui
rtcom-call-ui
hp:s:c:
app-detect: Started
_MB_CURRENT_APP_WINDOW
_NET_WM_WINDOW_TYPE
_NET_WM_WINDOW_TYPE_DIALOG
_HILDON_WM_WINDOW_TYPE_APP_MENU
_NET_ACTIVE_WINDOW
_NET_WM_PID
_NET_SHOWING_DESKTOP
_MAEMO_ROTATION_TRANSITION
app-detect [ERROR]: Error during initialization
app-detect [ERROR]: ignoring invalid realtime priority %d
app-detect [ERROR]: Failed to set realtime priority %d. Reason: %s
app-detect: Running on real-time priority %d
app-detect: Waiting for XEvents
systemui popdown
callui popdown
systemui popup
callui popup
rotation-transition %s
Look at rtcom-call-ui and _<X_PROPERTY> strings. My idea is that app-detect reading X properties from X windows and for rtcom-call-ui doing some magic if there is active call. If yes then it send jack bias on.

EDIT:
Also in app-detect binary are strings on and off which application strings ignored.

Last edited by pali; 2012-07-24 at 13:34.
 

The Following 3 Users Say Thank You to pali For This Useful Post:
Posts: 2,154 | Thanked: 8,464 times | Joined on May 2010
#37
Some more info about app-detect:

At startup it open two ipv4 UDP sockets to 127.0.0.1, first to port 3001 and second to 3002.

Then it send string "<number> active\n" to first socket. Number is pid of process with current active window.

When there is incomming call it send string "callui popup\n" to second socket. When call is disconnected it send string "callui popdown\n" to second socket.

I will write my own app which will send this callui strings, maybe this is way how to enable jackbias...
 

The Following 3 Users Say Thank You to pali For This Useful Post:
Posts: 2,154 | Thanked: 8,464 times | Joined on May 2010
#38
not working :-( I killed app-monitor and jack bias is still on active call and off otherwise.
 

The Following 2 Users Say Thank You to pali For This Useful Post:
Posts: 2,154 | Thanked: 8,464 times | Joined on May 2010
#39
With jonwil we decompiled prolog binary code from n900 file:
/usr/share/policy/rules/rx51/policy.plc

And there is really predicates from jack bias. Decompiled prolog code is same as orignal source only variable names are not stored. So code is really nice readable (of cource if you know prolog :-))

Important parts are here:

Code:
context_variable(jackbias, B) :-
	(   headset_accessible,
	    (   call_alerting
	    ;   call_active
	    )
	*-> A=on
	;   A=off
	),
	context_entry(jackbias, A, B).
Code:
headset_accessible :-
	fact_exists('com.nokia.policy.audio_device_accessible', [name, connected], [headset, 1]).
Code:
call_alerting :-
	fact_exists('com.nokia.policy.call', [direction, state], [incoming, created]).
Code:
call_active :-
	fact_exists('com.nokia.policy.active_media_group', [media, group, state], [audio_playback, cscall, on]).
Code:
call_active :-
	fact_exists('com.nokia.policy.playback', [group, setstate], [ipcall, play]).
Code:
context_entry(B, C, A) :-
	A=[context, [variable, B], [value, C]].
Predicate fact_exists is binary code written in C. Source is here: https://meego.gitorious.org/maemo-mu...fact.c#line216

Seems that fact_exists/3 predicate has first param dbus signal interface, second param array of dbus dict values and third param array of dbus dict values.

Thanks jonwil for decompiling prolog code! Now I have all what is needed for enabling jack bias.
 

The Following 6 Users Say Thank You to pali For This Useful Post:
Posts: 567 | Thanked: 2,965 times | Joined on Oct 2009
#40
it would appear as though the policy.dresc file (compiled from policy.dres with dresc compiler) also has a part to play in all this.
We dont have the proper N900 policy.dres file, just this one from MeeGo http://meego.gitorious.org/maemo-mul...cy/policy.dres

What we really need is source code for policy-settings-rx51, that would solve all the mysteries for good (but we dont have that )

Last edited by jonwil; 2012-07-24 at 19:20.
 

The Following 3 Users Say Thank You to jonwil For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 04:51.