From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "T.V Raman" Newsgroups: gmane.emacs.devel Subject: Re: battery.el broken? Date: Fri, 11 Jun 2021 07:30:09 -0700 Message-ID: <24771.29553.344941.739549@retriever.mtv.corp.google.com> References: <20210605135544.0203EC207FB@raman-glaptop.localdomain> <87lf7oj6lj.fsf@tcd.ie> <87o8cchdxa.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34008"; mail-complaints-to="usenet@ciao.gmane.io" Cc: raman@google.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: contovob@tcd.ie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 11 16:31:21 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lriBt-0008dN-Fc for ged-emacs-devel@m.gmane-mx.org; Fri, 11 Jun 2021 16:31:21 +0200 Original-Received: from localhost ([::1]:42734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lriBs-00066X-Gg for ged-emacs-devel@m.gmane-mx.org; Fri, 11 Jun 2021 10:31:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lriAr-0004NE-KC for emacs-devel@gnu.org; Fri, 11 Jun 2021 10:30:17 -0400 Original-Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:36859) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lriAp-0002HH-Hl for emacs-devel@gnu.org; Fri, 11 Jun 2021 10:30:17 -0400 Original-Received: by mail-pj1-x102e.google.com with SMTP id s17-20020a17090a8811b029016e89654f93so771094pjn.1 for ; Fri, 11 Jun 2021 07:30:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:mime-version:content-transfer-encoding:message-id:date:to:cc :subject:in-reply-to:references; bh=1K/7gYMjcYxRrOeTn2WTYywD+PUtrnWvlMsLvg40j/U=; b=IUXkGVTq59MMOkx8LLh6uRXWYmgr26F8KF/Ty3iAyTlAvalDcIb1CI9IfjIOJgWQLA J+Ul6ZEByycGcU7ARVRLbJ4Ro8En80pH09XAKKS+rB/wj8o0ZV5XI9xJ2kH0ZoWegRyT UAJVMUoRP5dp//PVXi9wfcDFZv/hiWJ89j5YSOM93UAtHkT/EUBoB5D0c2F54ap5psrY 0bWRz0c+hO5MC4sZzaj/64qxW4TIJQoS67QR97zG60tKDqf21BvIrttVZMp8Eb0KjLki 4qJuwCP/tlU2o4X2LEeyavfPaOR+qRLudO4p1qOJwdXs8K5LK+/iJF66O7Uo+zEv9hKs xvBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:content-transfer-encoding :message-id:date:to:cc:subject:in-reply-to:references; bh=1K/7gYMjcYxRrOeTn2WTYywD+PUtrnWvlMsLvg40j/U=; b=EQtCvvQ3a5mN/jrO4BRufCZpiC1rtNWM6DONFuxezJgo+ejIf7CqHKBCQrQpln7TXZ d9blN4YR8+po9liuk5H3jx2yPk1lNaI1acKl8bZPCvVDnfJ9Rr0V5NkmOcnjb3GWNh+Y fqHI4hOFL/MgACvTe0BuZrzE3Wgtfq9NdJYVQpvV8ejenItyuACU1coaxtsuONm5oeKZ JIFDMNCx4vTM5sJsdECq9JYtKfwyHVS/7Px8n7zi0oAjEKswml06oMs+Th53IYVkcJ+3 iQN1Bvfh5Mxh51p6pUvEHdTx5HynreF9yXLm6rCIzRUqJ6jaM9yt8DekyM2bKm7i+fG+ Ovgw== X-Gm-Message-State: AOAM530rV7X6q3g47Xw+40AudFQa4E14wUpnK51aLNh/xt4hNw2D18k+ m7U//18helC+4ZpXeQiaru4s94CJ18ttVA== X-Google-Smtp-Source: ABdhPJw1Q2nq8GdGzN3sCIcEL6rbkvUSc0QagbA8aRdEJXehSj19t+lRcgfTbT/mbd7iQap17av7SQ== X-Received: by 2002:a17:90b:b18:: with SMTP id bf24mr4796115pjb.220.1623421811868; Fri, 11 Jun 2021 07:30:11 -0700 (PDT) Original-Received: from retriever.mtv.corp.google.com ([2620:0:1000:1510:73cd:9c4a:1c59:fe37]) by smtp.gmail.com with ESMTPSA id j10sm5317730pjb.36.2021.06.11.07.30.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jun 2021 07:30:10 -0700 (PDT) In-Reply-To: <87o8cchdxa.fsf@tcd.ie> X-Mailer: VM 8.1.1 under 28.0.50 (x86_64-pc-linux-gnu) Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=raman@google.com; helo=mail-pj1-x102e.google.com X-Spam_score_int: -175 X-Spam_score: -17.6 X-Spam_bar: ----------------- X-Spam_report: (-17.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:270701 Archived-At: yes, looks like some upower dbus bug; separatley, for the longest time the dbus api has been reporting AC power connect/disconnect *much* after the event. It's pretty broken, and not Emacs' fault. the upower commandline utility gives the right value by the way Basil L. Contovounesios writes: > "T.V Raman" writes: >=20 > > I am mostly convinced this is a dbus/upower bug since I too checke= d and > > nothing has changed on the Emacs side on the machine, still runni= ng > > Emacs from Github@HEAD. > > > > Will now try some of the other status functions, I think the outpu= t > > stopped telling me time left likely a couple of days ago. > > > > Typing this with the machine fully charged and not plugged into th= e AC > > jack, but the upower output shown below appears to think it's on A= C > > Power. > > > > battery-status-function =3D=3D battery-upower > > > > (mapcar #'battery--upower-device-properties > > (battery--upower-devices) > > ) > > > > ((("NativePath" . "AC") ("Vendor" . "") ("Model" . "") ("Serial" .= "") > > ("UpdateTime" . 1622943939) ("Type" . 1) ("PowerSupply" . t) ("Has= History") > > ("HasStatistics") ("Online") ("Energy" . 0.0) ("EnergyEmpty" . 0.0= ) ...) > > (("NativePath" . "BAT0") ("Vendor" . "SMP") ("Model" . "01AV431") = ("Serial" > > . "5195") ("UpdateTime" . 1622944181) ("Type" . 2) ("PowerSupply" = . t) > > ("HasHistory" . t) ("HasStatistics" . t) ("Online") ("Energy" . 51= .36) > > ("EnergyEmpty" . 0.0) ...) (("NativePath" . "ucsi-source-psy-USBC0= 00:001") > > ("Vendor" . "") ("Model" . "") ("Serial" . "") ("UpdateTime" . 162= 2943939) > > ("Type" . 1) ("PowerSupply" . t) ("HasHistory") ("HasStatistics") = ("Online" . t) > > ("Energy" . 0.0) ("EnergyEmpty" . 0.0) ...) (("NativePath" > > . "ucsi-source-psy-USBC000:002") ("Vendor" . "") ("Model" . "") ("= Serial" . "") > > ("UpdateTime" . 1622943940) ("Type" . 1) ("PowerSupply" . t) ("Has= History") > > ("HasStatistics") ("Online") ("Energy" . 0.0) ("EnergyEmpty" . 0.0= ) ...)) >=20 > Hm, did you always have those ucsi-source-psy entries=3F Searching = for > them online led me to the following relatively recent discussions on= > USB-C power sources, UPower, and Linux: >=20 > https://forum.manjaro.org/t/upowerd-not-recognising-usb-c-path-charg= er-is-usb-c > https://gitlab.freedesktop.org/upower/upower/-/issues/126 > https://bugs.launchpad.net/ubuntu/+source/upower/+bug/1891799 >=20 > In particular I notice that the first of the two ucsi-source-psy ent= ries > says ("Online" . t), which seems contradictory and is probably what > throws battery-upower off. >=20 > --=20 > Basil --=20 Thanks, --Raman(I Search, I Find, I Misplace, I Research) =E2=99=89 Id: kg:/m/0285kf1 =F0=9F=A6=AE -- Thanks, --Raman(I Search, I Find, I Misplace, I Research) ♉ Id: kg:/m/0285kf1 🦮