Commit ef4494461961743794e948fd4b6660e67fdfe37e

Authored by LuoZheSi
1 parent 9089e6f3

fix(swf of optek link):support sample rate 32K in swf mode

@@ -89,6 +89,10 @@ if (optek_link_mode == TWS_SUBW_W_BT_SF44K || optek_link_mode == TWS_SUBW_W_BT_T @@ -89,6 +89,10 @@ if (optek_link_mode == TWS_SUBW_W_BT_SF44K || optek_link_mode == TWS_SUBW_W_BT_T
89 { 89 {
90 app_main_data.playing_stream_sample_rate = 44100; 90 app_main_data.playing_stream_sample_rate = 44100;
91 } 91 }
  92 +else if (optek_link_mode == SUBW_SF32K_PT2P5MS || optek_link_mode == TWS_SUBW_SF32K_PT5MS)
  93 +{
  94 + app_main_data.playing_stream_sample_rate = 32000;
  95 +}
92 else 96 else
93 { 97 {
94 app_main_data.playing_stream_sample_rate = 48000; 98 app_main_data.playing_stream_sample_rate = 48000;
@@ -846,6 +846,11 @@ void hw_audio_pll_clk_adj_by_drift(double drift) @@ -846,6 +846,11 @@ void hw_audio_pll_clk_adj_by_drift(double drift)
846 //11.2896 11.2896*8*6/24 = 22.5792 846 //11.2896 11.2896*8*6/24 = 22.5792
847 base_val = 22.5792; 847 base_val = 22.5792;
848 } 848 }
  849 + else if (app_main_data.playing_stream_sample_rate == 32000)
  850 + {
  851 + //8.192 8.192*8*6/24 = 16.384
  852 + base_val = 16.384;
  853 + }
849 else 854 else
850 { 855 {
851 //not support now,study later 856 //not support now,study later
@@ -370,6 +370,10 @@ extern FIFO audio_delay_fifo; @@ -370,6 +370,10 @@ extern FIFO audio_delay_fifo;
370 { 370 {
371 app_change_mode_req(SUBW_SF44K_PT2P5MS,24,6); 371 app_change_mode_req(SUBW_SF44K_PT2P5MS,24,6);
372 } 372 }
  373 + else if (app_main_data.playing_stream_sample_rate == 32000)
  374 + {
  375 + app_change_mode_req(SUBW_SF32K_PT2P5MS,24,6);
  376 + }
373 else 377 else
374 { 378 {
375 DBG_Printf("optek link not support sample rate\r\n"); 379 DBG_Printf("optek link not support sample rate\r\n");
@@ -1357,7 +1361,7 @@ u8 optek_link_slave_conn_cb (u8 mode, u8 *slave_max_tx_len, u8 *slave_max_rx_len @@ -1357,7 +1361,7 @@ u8 optek_link_slave_conn_cb (u8 mode, u8 *slave_max_tx_len, u8 *slave_max_rx_len
1357 *slave_max_tx_len = OPTEK_LINK_MASTER_NO_RX_LEN; 1361 *slave_max_tx_len = OPTEK_LINK_MASTER_NO_RX_LEN;
1358 *slave_max_rx_len = 49; 1362 *slave_max_rx_len = 49;
1359 } 1363 }
1360 - else if (mode == SUBW_SF48K_PT2P5MS || mode == SUBW_SF44K_PT2P5MS) 1364 + else if (mode == SUBW_SF48K_PT2P5MS || mode == SUBW_SF44K_PT2P5MS || mode == SUBW_SF32K_PT2P5MS)
1361 { 1365 {
1362 *slave_max_tx_len = OPTEK_LINK_MASTER_NO_RX_LEN; 1366 *slave_max_tx_len = OPTEK_LINK_MASTER_NO_RX_LEN;
1363 *slave_max_rx_len = 24; 1367 *slave_max_rx_len = 24;
Please register or login to post a comment