DPA has quit [Ping timeout: 256 seconds]
DPA has joined #maemo-leste
maemish_ has quit [Quit: Connection closed for inactivity]
<Wizzup> sicelo: with improved pm it makes much more sense for us to try to see what's up with the calls
<Wizzup> (audio) on n900
DPA has quit [Ping timeout: 276 seconds]
<Wizzup> for me the n900 i/o is still slower than I'd expect it to be
<Wizzup> but maybe my sd card is poor (I think I got this one for free..)
Danct12 has joined #maemo-leste
nmdv has joined #maemo-leste
nmdv has quit [Ping timeout: 276 seconds]
macros_ has quit [Ping timeout: 246 seconds]
macros_ has joined #maemo-leste
joerg has quit [Ping timeout: 265 seconds]
joerg has joined #maemo-leste
<freemangordon> Wizzup: yes (one wire change)
<freemangordon> tmlind: according to MC13783 we can read for pairs of battery U/I samples at once, have you ever tried that?
<freemangordon> hmm, actually this seems to be already supported byt the iio driver
Danct12 has quit [Quit: WeeChat 3.8]
xmn has quit [Ping timeout: 248 seconds]
xmn has joined #maemo-leste
<freemangordon> tmlind: please help, I have hard times understanding what in_voltage16_xxx and in_current17_xxx are in terms of cpcap iio driver
<freemangordon> my gut feeling tells me those shall read 8 samples of battery voltage and 4 pairs of battery voltage/current, but I can't understand how shall I get to those
<freemangordon> or, maybe this is not implemented?
xmn has quit [Quit: ZZZzzz…]
Twig has quit [Remote host closed the connection]
Twig has joined #maemo-leste
xmn has joined #maemo-leste
xmn has quit [Ping timeout: 255 seconds]
DPA has joined #maemo-leste
Twig has quit [Remote host closed the connection]
arno11 has joined #maemo-leste
<tmlind> freemangordon: 16 and 17 seem to be some battery related values
<tmlind> probably not ocv values though, but maybe some longer term sampling values?
<freemangordon> tmlind: IIUC MC13783 UG correctly, those should provide either 8 samples of voltage in a row or 4 pairs of voltage/current in a row
<tmlind> see the driver for "remuxed" for those two channesl
<freemangordon> yes, but driver seems to read only one value
<tmlind> oh so is the mc13783 actually saying something about those two extra channels?
<freemangordon> yes
<tmlind> interesting
<freemangordon> see 9.5.1
<tmlind> ok
lexik has quit [Quit: Bella ciao.]
<freemangordon> if we have that in cpcap, then we'll be able to estimate charge without coloumb
<tmlind> yeah i think they provide multiple samples, no idea for how long period though
lexik has joined #maemo-leste
<freemangordon> because we'll have correct readings of BATT and BATTISNS
<freemangordon> tmlind: but, I have hard times finding how to return those smaples to userspace
<freemangordon> seems read_raw_multi() is limited to 4 values
<freemangordon> iio core that is
<tmlind> hmm
<tmlind> i think the driver currently only works in single channel mode though
<freemangordon> also, iiuc vendor kernel reads 8 values at once
<tmlind> ok then maybe the mainline kernel can too, we should have it initialized to the same register values
<freemangordon> see adc_result() in vendor kernel
<freemangordon> it does for (i = CPCAP_REG_ADCD0; i <= CPCAP_REG_ADCD7; i++) { ...
<freemangordon> but then again, how to return 8 values?
<tmlind> no idea..
<freemangordon> :(
<freemangordon> would upstream accept if I use low/half words of those 4 inegers to store 16bit signed values?
<freemangordon> low/high
<freemangordon> sounds terrible though
<freemangordon> tmlind: hmm, about single-channel:
<freemangordon> "In single channel mode, with RAND=1, ADSEL=0, ADA1[2:0]=001, the converted result is available in 4 pairs of battery voltage and current reading"
<freemangordon> I just cannot find the equivalent BATICON bit in cpcap
<tmlind> what are the four registers to read from?
<tmlind> or is that 8 registers then?
<tmlind> my guess is the stock v3.0.8 kernel is using this mode, so comparing register values should make the mode work
<freemangordon> those are 8 channels
<freemangordon> still, there is one bit I cannot find
<freemangordon> BATICON
<freemangordon> without that set we'll have no input current sense readings
<tmlind> have you checked v3.0.8 kernel ADC_* defines in include/linux/spi/cpcap-regbits.h?
<freemangordon> yes
<tmlind> ok
<freemangordon> maybe it is CPCAP_BIT_AD4_SELECT
<freemangordon> this is nowhere used though
<freemangordon> well, I can start setting bits until I get 4x2 similar readings :)
<freemangordon> but, lets first verify the theory:
<freemangordon> if we have correct readings of battery voltage *and* current, samples take at exactly the same moment, that will allow us to correctly calculate Ri and thus OCV, no?
<tmlind> yup
<tmlind> well i know nothing about the OCV part
<freemangordon> also, do I get it right that despite that we read one channel actually all 8 channels ard ADC-ed?
<freemangordon> *are
<tmlind> yes might be
<freemangordon> ok
<tmlind> but these two extra channels are special somehow, they need to be muxed/routed or something to read the saved values
<freemangordon> I don;t get that part - what do you mean 'mixed'?
<freemangordon> value1 |= CPCAP_BIT_RAND1; ?
<tmlind> well those two extra channels seem to be sampling in the back ground, and to read the values you need to partially reconfigure the adc to read those two extra channels or something
<freemangordon> this is not clear from the driver code. Or I don;t get it
<freemangordon> I am still reading through it
<freemangordon> the only special thing I can found about it is this https://github.com/maemo-leste/droid4-linux/blob/maemo-6.1.y/drivers/iio/adc/cpcap-adc.c#L558
<tmlind> yeah i'm totally unsure about this too, might be worth checking the v3.0.8 kernel..
<freemangordon> they have this CPCAP_ADC_TYPE_BATT_PI type there
<freemangordon> which does value1 |= CPCAP_BIT_RAND1;
<freemangordon> hmm:
<freemangordon> if (req->type == CPCAP_ADC_TYPE_BATT_PI)
<freemangordon> tbl_index = (tbl_index % 2) ? CPCAP_ADC_BATTI_ADC :
<freemangordon> CPCAP_ADC_BATTP;
<freemangordon> looks like I am on something :)
<freemangordon> this looks exactly like even channels being U and odd - I
<tmlind> ok
<freemangordon> will put some printks
<tmlind> you are aware of REGMAP_ALLOW_WRITE_DEBUGFS, right?
<tmlind> define it in the driver
<freemangordon> I prefer to patch the driver
<tmlind> ok
<freemangordon> ok, thanks, will let you know if I have any progress :)
<tmlind> ok cool
<freemangordon> Wizzup: is kernel 6.1.y released?
<freemangordon> I mean maemo-6.1.y branch?
<freemangordon> tmlind: heh https://pastebin.com/6f7ffLQu
<freemangordon> :)
<freemangordon> I don;t understand why there is a difference though
<Wizzup> freemangordon: I am not sure if I understand your question, do you mean did kernel.org release it?
<Wizzup> I think if we are at 6.1.y then that usually means it is, as I think uvos rebases on stable
<freemangordon> no, do we released it, like if we have it in the repo
<freemangordon> at least chimaera is on 6.1.0.9-1+m7.1
<freemangordon> so maybe it is released for beowulf only
<freemangordon> if at all
<Wizzup> huh
Twig has joined #maemo-leste
<Wizzup> I think it's on the devices?
<freemangordon> 6.1.0.9-1+m7.1 is -rc8 or something
<Wizzup> maybe we did not rebase on stable
<freemangordon> what do you mean 'devices'? my d4 is device, no? :p
<Wizzup> my device is some 6.1.x
<Wizzup> I don't know if it is rc or stable
<Wizzup> probably best to ask uvos, or take my word for it :D
<Wizzup> he's been managing it
<freemangordon> what apt-cache policy linux-image-omap says about it?
<Wizzup> I am restarting my d4 since the screen did not want to turn on, even though it was in leste
<Wizzup> so give me a minute
<Wizzup> but I am sure it will show the same as yours
<freemangordon> maybe you have -experimental enabled, thas whay
<freemangordon> *why
<tmlind> freemangordon: cool so looks like you have some data :) i don't understand what difference you're talking about though.. do you mean variation in the sampled data?
<freemangordon> yes
<freemangordon> betweeh channel 16 and 17
<tmlind> don't you get values both for 16 and 17 the same time?
<tmlind> if you read 16 separately from 17, then it's a new set of sampled values for 17 already?
<freemangordon> both seems to produce U/I pairs, but reading 16 seems to produce slightly high I readings
<freemangordon> no, values for 16 and 17 are in consecutive reads
<freemangordon> one read reads 8 channels
<freemangordon> producing 4 pairs of values
<freemangordon> see the patch
<freemangordon> so, it seems setting CPCAP_BIT_RAND1 is enough for multi-channel read
<tmlind> ok
<Wizzup> freemangordon: it says 6.1.0-rc8 for me
<Wizzup> bbiab
<Wizzup> (uname -a)
<freemangordon> Wizzup: does not sound like .y :)
<freemangordon> same here though
<freemangordon> -rc8
<freemangordon> so, we have 6.1.y, but not released it seems
<Wizzup> how about this
<Wizzup> the branch was called .y as -rc already
<Wizzup> and we never actually rebased upon release
<freemangordon> no, because I just built it:
<freemangordon> Linux devuan-droid4 6.1.9-34584-gf5555be2e326-dirty #2 SMP PREEMPT Sat Mar 18 12:37:36 UTC 2023 armv7l GNU/Linux
<Wizzup> ok, weird...
<Wizzup> maybe uvos didn't release
<Wizzup> bbiab now
<freemangordon> mhm
<freemangordon> at least that boots :)
<arno11> Hi guys. what is controlling apt-worker on startup?
<freemangordon> HAM
<arno11> it causes slowness during several minutes
<arno11> ok
<freemangordon> well, it does apt-get update
<freemangordon> more or less
<arno11> more
<arno11> yes i know
<arno11> that s the problem
<arno11> there was a similar issue in fremantle iirc
<freemangordon> right
<sixwheeledbeast> is it the same thing that checks repos every 24hour?
<freemangordon> yes
<arno11> that's why the 2 first boots with clean chimaerq are complicates
<sixwheeledbeast> there was some setting for that
<freemangordon> you wanted fremantle experience, no :p
* freemangordon hides
<arno11> no probs for me
<freemangordon> it is responsible for the blinking yellow icon "update available" in the status menu
<freemangordon> you can set the check timeout though
<freemangordon> don;t remember where in gconf is the parameter
<arno11> no probs
<arno11> i know the parameters
<arno11> but on clean install it s complicated
<arno11> because of slowness
<arno11> that s why i m asking
<arno11> i think it should be easier if it was complately disable on fresh install
<arno11> i mean from user POV
<freemangordon> why? like, when will apt-get update happen then?
<arno11> on first boot with no swap and rootfs not extanded device is really slow
<arno11> when you try
<arno11> connecting to wifi
<arno11> apt-worker start
<arno11> and device is unresponsive
<freemangordon> but that means that we shall enable swap and extend rootfs, no?
<arno11> yes indeed
<arno11> but on first boot apt-worker arrive too quickly
<arno11> with 100% cpu
<arno11> on n900 it means too much processes at same time
<arno11> killing it quickly solve issue
<arno11> but not really user friendly lol
<freemangordon> did you check the nice value?
<arno11> ?
<freemangordon> the process priority
<freemangordon> apt-worker process
<freemangordon> it should run with low prio (high nice value)
<freemangordon> if not, something got broken
<arno11> ah ok i understand
<freemangordon> so, if it runs with low prio, 100% cpu usage is not an issue
<arno11> i ve to check
<arno11> makes sense
<freemangordon> and most-probably slowness comes from lack of memory
<freemangordon> mamory/swap
<freemangordon> *memory
<freemangordon> have to run, ttyl
<arno11> ok
<arno11> thx
<arno11> ttyl
<sixwheeledbeast> gconftool -g /apps/hildon/update-notifier/check_interval
<sixwheeledbeast> it's in hours
<arno11> yes no surprise 24 hours
<arno11> like fremantle
<arno11> but do you think setting a big value will be persistent?
<arno11> anyway set 2147483647
<arno11> let's see if it works
<sixwheeledbeast> well I recall 5 years being common mod, but I don't believe it stops the check on boot?
<arno11> agree
<arno11> i reboot and we'll have the answer
arno11 has left #maemo-leste [#maemo-leste]
xmn has joined #maemo-leste
arno11 has joined #maemo-leste
<arno11> surprisingly seems deactivated on boot
<sixwheeledbeast> check interval and the orange notification have separate keys
<arno11> interval has not been reset
<arno11> cooll
<arno11> orange notif has never worked in leste with my device
<arno11> anyway that's fine
pere has quit [Ping timeout: 276 seconds]
<Wizzup> arno11: I think the i/o load is weird
<Wizzup> on n900
<Wizzup> it really slows down a lot
<arno11> really ?
<Wizzup> maybe my card is slow
<Wizzup> but that is what I think I see
<Wizzup> I have emmc swap and memory was nowhere near full
<Wizzup> but apt indeed slows down device a lot
<Wizzup> and I think it is i/o related
<arno11> so probably the sdcard ?
<arno11> or 125mhz opp
<arno11> still slow if you use cpufreq performance mode ?
maemish_ has joined #maemo-leste
noidea_ has quit [Remote host closed the connection]
noidea_ has joined #maemo-leste
akossh has joined #maemo-leste
<Wizzup> arno11: will check in a bit
<arno11> ok
<freemangordon> tmlind: ok, with proper phase and convert I am getting sane values for U/I pairs
<freemangordon> with charger connected
<tmlind> freemangordon: cool. if you read the values in a loop, do they only update every 250ms?
<tmlind> i recall that's what the sample rate configure is
<freemangordon> could be
<freemangordon> but, I am not reading in a loop
<freemangordon> also, I think sample rate can be changed
<tmlind> yeah probably no need to change it, just wondering
<freemangordon> anyway, now the question is - how to provide that info to battery driver?
<tmlind> the battery driver can use the iio api.. how about calculate average for voltage and current and provide only two values?
<tmlind> or four values of mW?
<freemangordon> I was thinking abot that
<freemangordon> *about
<freemangordon> but that will not allow me to correctly calculate Ri
<tmlind> hmm knowing the voltage is important too..
<freemangordon> anyway, have to run now
<tmlind> yeah ttyl
<freemangordon> ttyl
pere has joined #maemo-leste
arno11 has quit [Quit: Lost terminal]
arno11 has joined #maemo-leste
xmn has quit [Ping timeout: 276 seconds]
parazyd has quit [Ping timeout: 248 seconds]
parazyd has joined #maemo-leste
maemish_ has quit [Quit: Connection closed for inactivity]
gliffy has joined #maemo-leste
arno11 has left #maemo-leste [#maemo-leste]
Twig has quit [Remote host closed the connection]
Twig has joined #maemo-leste
nmdv has joined #maemo-leste
maemish_ has joined #maemo-leste
nmdv has quit [Ping timeout: 246 seconds]
pere has quit [Ping timeout: 256 seconds]
arno11 has joined #maemo-leste
gliffy has quit [Quit: Leaving]
Twig has quit [Remote host closed the connection]
k1r1t0 has quit [Read error: Connection reset by peer]
pere has joined #maemo-leste
arno11 has left #maemo-leste [#maemo-leste]
<freemangordon> tmlind: I think I got it. First of all - channels 16&17 are not really correct - basically both do ADC on channels 0/1, because CPCAP_BIT_ADA0..3=000. CPCAP_BIT_ADAx are used for channel selection when doing single channel ADC
maemish_ has quit [Quit: Connection closed for inactivity]
<freemangordon> in general, single-channel adc gets 8 samples of the same channel, besides when BATICON (the mystery bit) is set, then 4 pairs of U/I are taken
maemish_ has joined #maemo-leste
Daanct12 has quit [Quit: Quitting]
<freemangordon> CPCAP_BIT_RAND1 selects single channel ADC
Danct12 has joined #maemo-leste
<freemangordon> maybe in cpcap this bit is missing and channel 0 is always read as pairs while the other channels are read normally (8 samples)
<freemangordon> BTW, there is MC13892 pdf available that has some more info, includein calibration and couloumb counter
akossh has quit [Quit: Leaving.]
<maemish_> Started to search info cause wanted to understand your finds. Found this but did not help me. https://github.com/analogdevicesinc/linux/blob/master/drivers/iio/adc/cpcap-adc.c#L1
<freemangordon> hmm?
<freemangordon> you don;t really want to go into that
<freemangordon> tmlind: sorry, not channel 0 but channel 1
<freemangordon> I will play a bit more with it though
<freemangordon> but, maybe doing average of 4 samples and returning as a pair (which iio read_raw() allows) is the way to go
Twig has joined #maemo-leste
mro has joined #maemo-leste
Twig has quit [Remote host closed the connection]
mro has quit [Quit: Leaving...]