libera/#maemo-leste/ Wednesday, 2024-06-12

freemangordondsc_: please consider adding timestamps in the logs08:12
freemangordonscratch that, I'll implement it08:34
kivashould Maemo Leste be year 2039 compatible? Has anybody noticed that it is shorter time ti to 32-bit time bug than N900 release date?14:16
sicelomost likely not (fully) compatible yet. Debian has fixed this only recently.14:17
kivaActually is that reason why default clock app crash in Pinephone, when try change time?14:19
Wizzupthat seems unlikely14:21
dsc_freemangordon: https://github.com/maemo-leste/conversations/commit/a1253465beba6f1dbd5b814caec1acb005598dad14:28
dsc_this removes AccountChannelPtr too, which is suppose to linger around14:30
dsc_I can get rid of AccountChannelPtr but it requires some changes to Tp14:30
dsc_and possibly affects other parts of conversations too14:30
dsc_the reason AccountChannelPtr stays around is to represent a persistent channel that you have not yet joined14:31
dsc_I talked about this earlier how architecturally the config stuff should be removed from lib/tp.cpp, I was talking about this14:32
dsc_I think 0.7.15 will segfault due to this commit14:34
dsc_yes, after leaving a groupchat it will segfault14:35
dsc_so I will work on tp for the next few days and untangle some stuff14:37
freemangordondsc_: ok, great, just keep in mind I am MIA for 2 weeks starting Friday. Please do not break conversations too much while I am on holiday :p14:38
dsc_the changes required to make lib/tp.cpp more self-contained will be large and breakage might be present14:39
dsc_we can choose to keep the current arch for now and I do an easy fix14:39
freemangordonyeah, I understand14:39
freemangordonI was kidding anyways14:39
dsc_ok :)14:39
dsc_yes ill do my best ^^14:39
freemangordonbut won;t be able to either test or make fixes14:40
freemangordondsc_: https://pastebin.com/xwcPJV0j15:15
freemangordonsomething is broken when saving   date_last_message15:15
freemangordonI put some more traces15:16
freemangordonthis https://pastebin.com/SknCviHd, should not affect the result15:18
freemangordonI wonder if channel gets properly inited on logoff/logon15:18
freemangordonlike, I see configSave(), but no configRead()15:19
dsc_is `channels[channel_str]->date_last_message;` ever set?15:20
freemangordonchannels[channel_str]->date_last_message = epoch;15:20
freemangordonlemme push, you'll see15:20
dsc_unsure if I should look because ill probably be removing AccountChannel today15:21
freemangordonok15:22
freemangordonstill, I'll push the logger changes15:22
dsc_is the issue its not being saved to cfg?15:22
freemangordonrather it is not read back15:22
freemangordontest case is:15:22
freemangordonreceive remote message, but not read it (so it is not marked as read on the server)15:23
freemangordonreconnect the account (so unread messages are delivered as scrollback)15:23
freemangordonthat unread message is duplicated, because timestamp check fails, as date_last_message is 0 (as seen oin the lofs)15:24
freemangordon*logs15:24
dsc_right15:24
freemangordonI suspect channel settings are not re-read on logon15:24
dsc_yes15:25
dsc_AccountChannelPtr(new AccountChannel);15:25
dsc_look for this one15:25
freemangordonyeah, I understand15:25
dsc_right15:25
freemangordonbut now you're going to remove that, I see no reason to fix it15:25
dsc_and configRead() is only in the constructor15:26
dsc_of TelepathyAccount15:26
freemangordonmhm15:26
freemangordonI saw that15:26
dsc_will fix :)15:26
freemangordongreat! ok, lets push few fixes to haze and purple-fb15:27
Wizzupso from my pov apart from the random audio issues where the kernel doesn't set what it should set in calls, the voicecall mgr stuff is working well on my d415:56
WizzupI'll make a PR with the various fixes15:56
Wizzupbut we still need to figure out the kernel audio issues and then we could move a conversations release to stable too15:56
Wizzup(and then we can more easily break -devel)15:57
WizzupI just don't know how to go around debugging this kernel issue15:57
Wizzupuvos: would you agree that switching PA UCM profiles back to HiFi and back to Phone Call should ideally set the regs up properly again?15:57
freemangordonWizzup: If we are to release conversations to stable, the bug I reported ^^^ shall be fixed15:58
freemangordonbut it is up to you and dsc_ to decide15:59
Wizzupok, I don't know what the bug is that you mean, but keep in mind that current conversations stable is like months behind devel15:59
Wizzuplike it'll probably segfault when going online/offline or something15:59
Wizzup(in some edge case)15:59
Wizzupin any case it's all moot until we figure out the kernel audio issue15:59
WizzupI suppose we could decide to debug this, or we can go straight to 6.6 and try to figure out why it doesn't work there16:00
freemangordonno, it will not update last message received timestgamp going offline->online, leading to duplicated scrollback of the unread messages16:00
dsc_i can aim for a stable next week16:00
dsc_if needed16:00
dsc_wait, what day is it even...16:00
freemangordonwednesday16:00
dsc_thanks ;x16:00
freemangordon:)16:00
Wizzupok16:01
Wizzupwell, any suggestions on how to try to debug the call issues I would appreciate16:01
dsc_yes I think we can do a stable soon16:01
Wizzupsince it's also (a similar bug) the only blocker for 6.6 or 6.8 (i forget) kernel16:01
freemangordonWizzup: I guess tmlind is to the rescue :)16:02
WizzupI am not sure if he has a lot of time recently16:02
Wizzupalso for 6.1 (which is not pretty old) it might not be that worth it16:02
Wizzupwhich is now*16:03
WizzupI guess we would need some trace of all alsa state changes or something16:06
Wizzupmaybe cpcap_input_*_mux_set_enum or something will override what's currently set during voice call16:11
Wizzupmust be some race with userspace somehow16:16
Wizzupuvos: should I not see 'VOICE CALL' in dmesg whenever I switch ucm in pavucontrol?16:31
freemangordonAFAIK this is logged by the modem driver when modem reports incoming call16:32
Wizzupno this happens in cpcap_voice_call16:33
freemangordonbut don;t quote me on that one16:33
freemangordonlemme grep16:33
Wizzupsound/soc/codecs/cpcap.c16:33
Wizzupno need to grep16:33
Wizzupthe problem is that bits CPCAP_BIT_MB_ON1R and CPCAP_BIT_MB_ON1L are somehow unset when we are in the actual call16:33
Wizzupand from my understanding16:34
Wizzupmodem -> ofono -> sphone acts on voice call -> starts ringing -> when picked up -> sphone tells PA to switch to voice call UCM16:34
Wizzupand this switch I believe is what should trigger all the right settings to be set, including the DAPM hack for which we print 'VOICE CALL"16:34
Wizzupbut apparently switching UCM *does not* trigger cpcap_voice_call16:35
freemangordonmaybe put printk in cpcap_voice_set_tdm_slot16:37
Wizzupcpcap_voice_set_tdm_slot is what calls cpcap_voice_call16:37
freemangordonmhm16:37
Wizzupyeah so you think this prevents this from being set when we're not in a call?16:37
Wizzupthere's so much jargin in alsa kernel land it's mind boggling :(16:38
Wizzupjargon16:38
freemangordonbut cpcap_voice_set_tdm_slot can return before calling cpcap_voice_call16:38
Wizzupyes exactly16:38
Wizzupbut what is tdm slot even16:38
freemangordonTDM is time division multiplexing, but what it means in this context I have NFC16:38
Wizzupwell I guess the function makes it pretty clear16:39
Wizzupso somehow in the timeslot setting we also actually set up the call regs16:39
WizzupI am not sure why cpcap_voice_set_tdm_slot even needs to check if we are in a call, I guess because it needs to be able to unset somehow?16:40
freemangordonI would trace if cpcap_voice_set_tdm_slot() gets called at all16:40
Wizzupbecause us switching UCM from voice call to HiFi or  vice versa isn't related to this level16:40
Wizzupwell I know that during calls I typically see 'VOICE CALL'16:40
freemangordonso, if it is called but returns early, then yo should check why16:41
WizzupI was just hoping I wouldn't have to keep calling myself just to see how some of this works16:41
freemangordonjust put printk() every other source line16:41
Wizzupalso I wonder if those errors are actually logged16:41
Wizzupor if some alsa debug value is missing16:41
freemangordondev_err() is logged16:41
freemangordonbut I don;t see error printed on calls to regmap16:42
freemangordonnot sure if regmap will print error16:42
Wizzupwell this is called from alsa code16:42
Wizzupsee static const struct snd_soc_dai_ops cpcap_dai_voice_ops16:42
freemangordonyes, I know16:43
freemangordonthats why I said to check if it is called at all when voice fails16:43
Wizzupand yes it is16:43
Wizzupsince 'VOICE CALL' is always printed16:43
freemangordonah16:44
Wizzupand there's some race going on16:44
freemangordonsorry, my bad16:44
Wizzupso I think sound/soc/codecs/motmdm.c calls snd_soc_dai_set_tdm_slot16:44
Wizzupso maybe this has a better clue16:44
freemangordonI was left with the impression that sometimes there is no "VOICE CALL" message16:44
Wizzupha the return value of motmdm_enable_primary_dai is ignored16:44
Wizzupfreemangordon: I will have to triple check, but I am pretty sure that is always set16:45
freemangordonok, ok16:45
Wizzupin codecs/motmdm.c see:16:45
Wizzupif (enable) motmdm_enable_primary_dai(ddata->component);16:45
Wizzupelse motmdm_disable_primary_dai(ddata->component);16:45
Wizzupso it ignores the error tha we bubble up all the way from regmap sets16:45
WizzupI think we should fix that regardless16:45
freemangordonwhy it is called at all from motmdm? isn;t ALSA supposed to call it16:45
Wizzupmotmdm is the codec, so I guess that is part of alsa16:46
WizzupI don't know what the graph of what uses what is here16:46
freemangordonbut it shoudl not call that function directly, no?16:46
freemangordonI am as lost as you are perhaps16:46
Wizzupthe codec seems to find ngsm serdev and see what the call state is16:47
Wizzupthis is managed from /* Read the voice status from dlci1 and let user space handle rest */16:47
Wizzupstatic int motmdm_init_voice_dlci(struct motmdm_driver_data *ddata)16:47
Wizzupit seems16:47
Wizzupwell and of course motmdm_soc_probe16:47
freemangordonwell, I remember motmdm handling calls state16:47
freemangordonmotmdm_enable_primary_dai() is called on incoming call, IIRC16:48
Wizzupthe motmdm codec also registers dtmf/call noise cancel and call volume16:48
freemangordonsee  motmdm_voice_get_state16:49
Wizzupyes, this is what enables or disables the dai16:49
Wizzupso I guess there is no way to trigger it from userspace then16:50
freemangordonmhm16:50
Wizzupor perhaps there is, just not with our ucm16:50
WizzupI suspect there is some race not that voicecall-manager is in play, and somehow the delay makes it worse16:50
Wizzuplike if the ucm is set before or after the kernel performs all of this16:50
freemangordonsounds plausible16:52
freemangordonI wonder if we shall remove the call to  snd_soc_dai_set_tdm_slot() and somehow tie it to UCM16:54
Wizzupwe'd need some mixer/control in alsa to toggle this16:54
freemangordonyes, I know16:55
Wizzupthere's also the whole DAPM hack that we have to do anything, which I still don't really understand, but I think the point is that because the audio does not go through userspace routing, alsa decides that we don't actually use/need it16:55
Wizzupand we haven't found a way to tell alsa not to do it other than force-enable dapm pins/paths16:55
freemangordonwhich obviously does not work properly16:56
Wizzupwell it works ok for us now16:56
Wizzupbut yes it's not ideal16:56
freemangordonas voice calls are not the only issue we have16:56
freemangordonno, mafw suffers as well16:56
Wizzupmafw suffers a lot more than other HiFi though16:56
Wizzupso maybe best to not conflate the issues16:56
Wizzupalso killing mafw-renderer makes it work again when it's restarted, so there's other stuff going on there16:57
freemangordonI doubt mafw does something bad, as it uses PA16:57
Wizzupfine, but mpv with pa usually works fine after audio call16:57
Wizzupand this is not the result of DAPM I am quite sure16:57
freemangordonok16:57
Wizzupit could be however that the tdm from before the call is not saved16:57
Wizzupand this might throw off PA and then everything else16:57
freemangordonbut commenting out line 549 in motmdm makes it working properly16:58
freemangordonbesides that call audio is funny16:58
Wizzupwhat tag/branch are you on16:58
freemangordonI guess master, lemme check16:58
Wizzup549 for me is:16:58
Wizzupstruct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component);16:58
Wizzupoh wait, wrong file :)16:58
Wizzup549 for me is:16:58
Wizzupstrncmp(state, "1,4,0", 5) ||  /* incoming call */16:58
Wizzupwell, !strncmp16:59
freemangordonyes, that one16:59
WizzupI think this just means that by completely nerfing call audio you don't run into the problem16:59
freemangordonmhm16:59
freemangordonthere *is* audio though17:00
Wizzupactually, we could look at this soon if you want17:00
Wizzupwe can check the CPREG_REG_CDI reg17:00
freemangordonjust sounds funny for both sides17:00
Wizzupand see what the time stuff is set to17:00
Wizzupand see if it gets set back properly after the call17:00
Wizzupmy bet is no17:00
freemangordonbecause frequency seems off17:00
Wizzupand this is why you have the issues17:00
freemangordonright17:00
Wizzuplike this force samples rates I think17:00
Wizzupsee cpcap_voice_set_tdm_slot's cpcap_set_samprate17:01
freemangordonright17:01
Wizzupthere's a bunch of dev_dbg that we're missing out on for sound/soc/codecs/cpcap.c17:02
Wizzupwonder how we can get those17:03
Wizzuplike:17:03
Wizzup    dev_dbg(component->dev, "HiFi setup HW params: rate=%d", rate17:03
Wizzup    return cpcap_set_samprate(cpcap, CPCAP_DAI_HIFI, rate);17:03
freemangordonI think they are compiled-out17:03
WizzupI always forget how this works :)17:03
Wizzupbut it seems like component->dev might be what we could enable/filter on in debug msgs17:03
Wizzuphttps://stackoverflow.com/questions/50504516/enable-linux-kernel-driver-dev-dbg-debug-messages17:04
freemangordonI don;t think we have CONFIG_DYNAMIC_DEBUG=y17:04
Wizzupmaybe we should...17:05
freemangordonno17:05
freemangordonthat'd put too much overhead17:05
freemangordonjust compile your kernel17:05
freemangordonthat's what I do when developing17:05
Wizzupit's very inconvenient when you have 5-6 devices but I suppose17:06
freemangordonor, simply change dev_dbg to printk or dev_err :)17:06
WizzupI don't think there'd be a lot of overhead at all17:06
Wizzupbut ymmv17:06
Wizzupinternet seems to say the overhead is quite low17:11
Wizzupit also seems to be default on for most distros17:12
freemangordonwhat about memory overhead?17:15
freemangordonmost distros do not run on n900 :)17:15
WizzupI doubt there would be any?17:15
Wizzupwhat else memory would need to be stored?17:15
Wizzup8 chars for filename?17:16
freemangordon* number of files17:16
Wizzupstill nothing17:16
freemangordonwell, I think we shall not enable unnecessary features that are used rarely17:17
freemangordonbut...17:17
freemangordonI know it is inconvenient, but compiling the kernel is not that hard and you have to do it anyways when making changhes17:17
WizzupI don't mind compiling my own kernel, it's just nice to make our (earlt debugging) life easier17:18
Wizzupit's not just compiling, it's also shutting off,removing sd card, copying dtb/dts, kernel, modules to the right path, depmod -a17:18
Wizzupand booting again17:18
Wizzupbut yeah.17:18
freemangordonno, why?17:18
freemangordonI copy zImage/modules through ssh17:18
freemangordonand just reboot17:19
freemangordonyou don;t need another dtb usually17:19
freemangordonjust zImage/modules17:19
Wizzupstill a lot of effort, more than just 'make'17:19
freemangordonand you cannot avoid it17:20
Wizzupwith dynamic debug you can ;)17:20
freemangordonno, you can only get traces17:20
freemangordonbut can fix nothing :)17:20
Wizzupyes, this helps a ton with reporting issues and even having users debug stuff for/with us17:21
Wizzupbut nevermind, I don't care enough to continue going down this path17:21
freemangordonme neither17:21
freemangordonso if you decide this shall be enabled... ok17:21
freemangordonI am just sharing my opinion17:22
freemangordondsc_: btw, what about just getting the timestamp of the last message for that channel in rtcom db instead of storing it in QSettings?17:34
d4dsctp.cpp is not aware of the last rtcom entry so it would need to query for it17:56
d4dscsure, could do17:56
d4dscit would query for every incoming message, could cache it17:57
d4dscquery itself is ro17:58
d4dsc*is grouped by group-uid and then order by timestamp17:58
Wizzupuvos: sicelo: is there a reason our current devel kernel is 6.1.67 but our maemo-6.1.y branch is on 6.1.80?18:18
Wizzupah, I see, the dtses do not build..18:21
Wizzup[  418.496276] mot-mdm6600-codec 4806a000.serial:modem:audio-codec@2: motmdm_send_command: sending U1848AT+CLVL=020:31
Wizzup[  418.520446] mot-mdm6600-codec 4806a000.serial:modem:audio-codec@2: motmdm_receive_data: received: +CLVL:OK20:31
Wizzupok that works :)20:31
Wizzupuvos: pushed to vcm-fixes, this fixes all issues except for sound, which I am looking at now.20:37
Wizzupuvos: on sphone that is20:37
Wizzuphttps://github.com/maemo-leste/sphone/pull/720:38
WizzupI can't believe this worked in sphone every time, hrm20:47
Wizzuptmlind: uvos: freemangordon: here are some dmesg logs from my droid 4 when I get called, I called myself three times and made three different logs of the relevant parts: https://wizzup.org/dirlist/maemo-leste/call-dmesg-logs/20:49
WizzupThat is done using:20:49
Wizzupecho 'file cpcap.c +p' > /sys/kernel/debug/dynamic_debug/control20:49
Wizzupecho 'file motmdm.c +p' > /sys/kernel/debug/dynamic_debug/control20:49
Wizzupand then using dmesg -w, and I cut off the timestamps to make diffing easier20:49
WizzupThere's a lot of suspicious stuff there...20:50
Wizzupthe main thing to note is that apparently we handle ciev=1,4,0 twice in every log, but in the one where it doesn't work, it comes a lot later20:52
Wizzupthat is:20:52
Wizzupmot-mdm6600-codec 4806a000.serial:modem:audio-codec@2: motmdm_voice_get_state: ciev=1,4,020:52
WizzupWhen it is working we got from 1,4,0 to 1,2,0 to 1,0,0 (done)20:53
Wizzupwhen I get no good audio it goes from 1,4,0 to 1,2,0 to 1,0,0 to 1,4,0 to 1,2,0 and again to 1,2,020:53
WizzupAnd I can assure you I didn't call myself twice20:53
WizzupI'm confused20:54
WizzupAlso the problem is extra apparent when you see the 'VOICE CALL 1' goes to 'VOICE CALL 0' and again to 'VOICE CALL 1'20:54
Wizzupand the same happens with HiFi : it's mute 0 (ringtone), then to 1 (muted), but basicaly it immediately goes back to mute 0 (unmuted)20:55
WizzupI don't know if this is userspace doing something weird but ... it's quite strange20:55
WizzupI will add n_gsm.c to dynamic debug too21:15
Wizzupgreat, with n_gsm.debug set to 255 I can't reproduce it anymore so far22:05
Wizzuphere are some new logs with n_gsm enabled: https://wizzup.org/dirlist/maemo-leste/call-dmesg-logs/new/22:19
Wizzupn_gsm debug enabled*22:19
Wizzuphere there's only 'VOICE CALL' 1/0 once for every session22:21
Wizzupfreemangordon: got a suggestion for a name for our dialer?22:47
Wizzuprtcom-dialer?22:48
Wizzupin fremantle it's rtcom-call-ui22:48
Wizzupbut that's the actual binary22:48
freemangordonWizzup: sorry, just get home, will read the logs tomorrow23:01
Wizzupall good23:01

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!