『探討』Android 系統上的 gpsd 到底是什麼 ?

前一陣子手上的 Samsung Galaxy S3 莫名其妙的發燙與耗電,於是透過內建的電池記錄功能來進行初步的檢測,發覺怎麼跑出一個從來沒看過的 gpsd 的名稱而且損耗的電力還是第二名說!接著點到歷程記錄詳細資料來觀看,發覺 GPS 的部份也沒有被長時間的開啟,那 gpsd 到底是什麼東西呢?怎麼會忽然間跑出來而且還這麼耗電說!

▼左圖:電池使用狀態。
▼右圖:歷程記錄詳細資料的相關資訊。


▼左圖:利用 Battery Monitor Widget 記錄到的電池耗電狀況。
▼右圖:利用 GSam Battery Monitor 找到的 gpsd 藏在 System(sh)服務當中。

由於這現象非常的奇怪,回到家後上網搜尋了一下相關的資訊!發現其實在著名的 XDA 論壇有許多人在討論同樣的問題,但是說真的都沒辦法找到比較正確的答案,於是上網搜尋了一會找到以下說明提供給大家參考看看

  • GPSD is a translator and replicator daemon for GPS devices, AIS radios, and other navigational sensors. It understands NMEA and many vendor proprietary protocols, and outputs NMEA or a simple text protocol over TCP to an arbitrary number of clients.。出處:http://www.catb.org/gpsd/
  • GPSD is a service daemon that handles GPSes and other navigation-related sensors reporting over USB, serial, TCP/IP, or UDP connections and presents reports in a well-documented JSON application on port 2749. It dymnamically autconfigures for a wide rang。出處:https://savannah.nongnu.org/projects/gpsd
  • gpsd is a daemon that receives data from a GPS receiver, and provides the data back to multiple applications such as Kismet or GPS navigation software. It thus provides a unified interface to receivers of different types, and allows concurrent access by multiple applications.
    It is commonly used on Linux and FreeBSD systems [1] [2] [3]. Distributed under a permissive free software license, gpsd is free software. 出處:http://en.wikipedia.org/wiki/Gpsd
就 Leo 自己爬完文之後與朋友討論之後的一些心得與感想得到以下的結論,如果有誤也歡迎大家一起來討論一番!畢竟這方面並不是 Leo 的專長,也希望有先進指點一下迷津囉!

什麼是 gpsd ?

 gpsd 其實就是在 Android 系統當中提供給各軟體 GPS 資訊的一個背景服務程序,透過 gpsd 可讓 Android 系統上有需要 GPS 資訊的軟體同時擷取資料到該軟體當中使用,屆此規避掉硬體上的限制,因為如果不透過 gpsd 來讀取 GPS 晶片上的資料的話,將會造成同時間只能讓一個軟體讀取到 GPS 資訊。簡單來說從使用者端來看 ,gpsd 是一個統整 GPS 資訊給予查詢的服務。

感想

當我們了解了什麼是 gpsd 之後那為什麼 gpsd 會忽然間不斷的被執行而無法停止造成異常的耗電,Leo 確認過當時並沒有其他軟體在要求 GPS  座標資訊,因此實在不知道為什麼會發生這樣的狀況,而且也找不到方式來將 gpsd 停止運作,為一解決的方式就是將 Android 手機重新開啟之後,gpsd 就不會持續運作。自從這次發現這個狀況之後,Leo 後續也沒在發生過  gpsd 異常耗電的狀況,因此透過今天這篇文章記錄一番,如果有神人知道 Android 系統上的 gpsd 運作原理的話希望能指點一下迷津囉!


用LINE傳送
加入LINE頻道 加入TG頻道

Leo
Leo

喜愛旅遊並沉迷科技應用數十年無法自拔的重度 3C 上癮者!

1 則留言

發表迴響