pu2clr / RDA5807

Arduino Library for SINGLE-CHIP BROADCAST FM RADIO TUNER RDA5807
MIT License
94 stars 16 forks source link

Mute when volume = 0 #9

Closed GlebDen closed 1 year ago

GlebDen commented 1 year ago

Hello. According to the RDA5807 documentation, the volume should be muted when set to 0. "When 0000, output mute and output impedance is very large" Do I understand correctly?

pu2clr commented 1 year ago

I used the register 02, bit 14 for muting (0 mute and 1 normal operation).
It works on Digital (i2S) and Analog modes. If you want to use mute via set volume, just call setVolume(0). Right?

GlebDen commented 1 year ago

If I call setVolume(0), then the radio continues to play as if it is a minimum volume like setVolume (1)

pu2clr commented 1 year ago

I think there is an interpretation problem with the text of the Documentation. DAC Gain Control Bits (Volume) - 0000=min; 1111=max. Volume scale is logarithmic. When 0000, output mute and output impedance is very large. Should be "output mutes"? . Or "Output mute" impedance is very large when 0000?

GlebDen commented 1 year ago

Logically, any radio will have silence in the most minimal position of volume.

pu2clr commented 1 year ago

I see... well, in this case, it is up to the developer to decide what best applies to the project. You have the mute function by using setMute(true). If you want total silence, I think the setMute function this is more recommended than setVolume(0). Said that, consider, via programming, testing the volume. When it is 0 (getVolume() is 0) then setMute(true), otherwise setMute(false). I think it will do what you want. Right? This library is just a communication layer for the RDA5807 device. It is not intended to change the original functions of the device in this layer. It can be done during the final project programming.

GlebDen commented 1 year ago

Yes, I think you're right.

pu2clr commented 1 year ago

I fixed some bugs today. The setMute function was modified. I also added the function setAudioOutputHigZ. Both functions deal with audio output and mute the receiver.

GlebDen commented 1 year ago

Thank you! This is like an offtop, but can I suggest adding a choice of an antenna type? Or make reg05-> refined.lna_port_sel = 3; by default.

pu2clr commented 1 year ago

I have just implemented setLnaIcSel and setLnaPortSel. I have not tested it so far. Also I did not selected 3 by default for while due to legacy applications (I need check it before). Can you check these functions and share the results with me? Thanks.

GlebDen commented 1 year ago

Hello. I tested Setlnaicsel and Setlnaportsel. Setlnaportsel definitely works fine. Setlnaicsel I could not understand the changes by ear. Can this affect the RSSI level?

If we return to the initial discussion, then my main idea that I wanted to express is that setVolume(0) gives me a very comfortable low volume level. setVolume(1) is already quite loud to me. Perhaps because of my headphones, I don't know for sure yet.

pu2clr commented 1 year ago

To be honest I have no idea what the LNA IC SEL (Setlnaicsel) really do. I could notice here that the LNA PORT affect the RSSI. I have the same opinion about the volume. I think it is not recommended for using in a real application. I'm not sure. It is better to control the volume with a audio amplifier module. I mean, I think we should use a fixed volume in the RDA5807 or use its high impedance setup to be processed with a good audio amplifier. Thanks for testing.

pu2clr commented 1 year ago

I'm closing this issue. Please, few free to open a new one if you need. Thanks.