In the past week, I have started to look at the possibility of using
RDS to synchronise the clock of a DAP. Of course this is only possible
with a DAP having an RDS-capable FM chip (gigabeat s, sansa clip zip,
RDS sends a CT (clock-time) message once a minute, containing the
current time with one minute resolution:
* date as modified julian date (which is basically UTC date with
* hours and minutes
* local time offset (in units of a half hour)
What I've seen so far is that all-but-one of the strong FM transmitters
in my area (netherlands, at UTC +1:00 right now) transmit a correct
UTC time (including a correct local time offset of +1:00). One FM
transmitter sends local time with a local time offset of +0:00.
So the *local* time is actually correct for all stations I tried.
My proposal is:
** tuner driver side **
Upon reception of an RDS CT message, the RDS code performs basic
checks on the RDS CT packet, like range of hours (0-23) minutes
(0-59) and date (later than 2012-1-1). It then calculates local
time by summing UTC time and offset.
The reception of RDS time is advertised as an RDS event.
The radio API gets a new property to retrieve the RDS time
(in seconds since 1970-1-1 0:00 in local time).
** radio code side **
When the radio code sees that an RDS time was received, the RDS
time is stored along with a timestamp taken from the RTC.
The radio menu gets a new menu, "Sync to RDS time" (or similar).
When the user selects this menu, he/she is presented with a new time,
calculated from the latest received RDS time and the stored RTC
timestamp, and the user can check/confirm before actually updating
* UTC vs local time? Since the raw RDS time + offset is apparently
wrong for some stations, but local time is OK, I propose to send
local time over the tuner api.
* Should we put the synchronisation in some time&date menu, or in
the fm radio menu?
* Should RDS clock sync be automatic or manual? I propose manual
because I don't trust RDS time to be accurate everytime
(because of bad fm reception for example).
Any ideas for changes/improvements on this proposal?
With kind regards,
Received on 2012-02-12