[Gta04-owner] alsaloop and poll issues with the modem ALSA driver.
Dr. H. Nikolaus Schaller
hns at goldelico.com
Sun May 20 21:01:26 CEST 2012
Am 20.05.2012 um 20:42 schrieb Simon Busch:
> On 20.05.2012 19:09, Dr. H. Nikolaus Schaller wrote:
>> Am 20.05.2012 um 18:24 schrieb Denis 'GNUtoo' Carikli:
>>> I am trying to get a good forwarder to work on the gta04 A3 for SHR
>>> (The forwarder is the main blocking thing for me, since I've no gta04 A4).
>>> Here are the result from debugging alsaloop:
>>> If the modem is in call, the poll system call behave normally:
>>> poll took 246094us //from alsaloop
>>> but if the modem is not in a call:
>>> the poll will take a lot less:
>>> poll took 31us //from alsaloop
>>> which will result in 100% or near 100% CPU usage.
> What does "in call" really mean? An active or outgoing call?
The moment where the voice data connection is established.
For an incoming call with "RING" messages, it is some milliseconds
after accepting the call by some AT command.
For an outgoing call it is after doing ATD when the other side
picks up the received and this event has travelled back to the
mobile through the GSM signalling network.
>>> I think that the right thing is to fix the audio driver or the ASOC framework.
>> This may have to do with the PCM clock/frame sync that is coming
>> from the modem. And it starts only at the moment the connection is
>> Maybe, a poll() before the clock arrives fails and returns some error.
>> Could be some error that isn't reported to the user space.
>> Radek & Neil may know a little more about this.
>> To reduce CPU usage, you could try to find some indication about
>> being in call/not in call and sleep the forwarder process a little.
> Can't we power up the alsaloop thing only when a call is active and
> disable it just when a call ends?
Yes, you can start it when ATD begins. But in my experience it may
need 5 seconds until the other side starts to ring and several ringing
tones until the other side picks up. So it may be for 10 seconds in this
100% CPU state - as far as my understanding goes.
> Hm, if I look into the gsmvoice_alsa_forwarder plugin of fsoaudiod it's
> already done this way or do I miss some tiny detail?
More information about the Gta04-owner