DUDU-Meng
TP/TA is part of FM radio RDS features and as such should be handled by radio core services/MCU. It's quite similar situation like with the AF function, you've enhanced earlier.
Right now this is not working at all on Dudu devices.
I'll try to explain how it should work correctly.
The traffic information signaling on RDS consist of two flags - TP (Traffic Program Indication) and TA (Traffic Announcement) and those two flags needs to be handled together.
The TP flag indicates that the currently played station offers traffic program somewhere in their schedule or in case of traffic accidents etc. This flag is usually set permanently on such station, so it is also used to automatically tune to a station that offers traffic program.
The TA flag is set during an ongoing traffic announcement. It is usually set only few times an hour, ONLY during traffic announcement. Headunit should react to this flag by:
- Increasing audio volume to user defined level for TA
- If the user is playing music from another source, pause the playback and switch to FM radio during the traffic announcement
- Display notification window about ongoing traffic announcement with the ability for the user to end it
- Automatically switch back to previous playback source.
That said, the TA switch in the radio settings makes no sense and its wrong, it should be TP switch.
Imagine this real-life scenario: You're driving on a highway and you're listening for example to your favourite album on Spotify. But also you want to be informed in case some accident happens on a higway so you can take a detour. So, you have the TP switch in the radio settings set to ON. If the currently tuned radio station has the TP flag set, it jus stays on that frequency and waits for TA, if the TP is not set, just tune up to another station with TP on (this search may be actually also user selectable).
Now you're listening to your album, but the radio service in backgroud detects from the RDS, that the tuned station sets the TA flag, so it is right now broadcasting the traffic announcement. So the headunit pauses the Spotify playbacka and switches to FM radio, so you can listen to the important traffic announcement about car crash, traffic jam etc. And when this traffic announcement ends, indicated by the TA flag being set off, the headunit resumes the Spotify playback.
(Just for the note, there can also be the EON information broadcasted,which enhances the described scheme by the ability to switch to the traffic announcement on another radio network, but let's not comlicate it with this for now)
I hope I explained it well enough, in cace you'll need some more info or examples, just ask. Or you can find lot of information over the internet. The RDS is about a 30-years old system and as such is very well documented and described...