cancel
Showing results for 
Search instead for 
Did you mean: 

USB to SAI audio streaming: 44.1kHz sampling rate

skson
Associate II

Hello, dear.

I am working with Nucleo-H753ZI board to implement USB in - SAI out streaming.

 

My goal is USB input to SAI output audio streaming for sample rate 48k and 44.1k.

input condition is 44k or 48k, 16bit, 2channel, output condition is 44k or 48k, 32bit, 2channel.

 

I am attaching my project and its files : usbd_audio.c, usbd_conf.h, usbd_audio.h are fixed for my purpose.

It is recognized in PC as selectable audio driver and its SAI FS Frequency follows sample rate.

When setting is 48k sample rate, it sounds well,

But  44.1k sound is not right pitch and speed.

I don't know which is the problem.  

 

Please let me know my problem and how can fix it.

Thank you.

 

From SK Son.

1 REPLY 1
FBL
ST Employee

Hi @skson 

You may need to check you PLL3 configuration feeding SAI peripheral clock.

 // 2. Configure PLL3
    RCC->PLLCKSELR &= ~RCC_PLLCKSELR_DIVM3;
    RCC->PLLCKSELR |= (25 << RCC_PLLCKSELR_DIVM3_Pos);   // M = 25

    RCC->PLL3DIVR = ((200 - 1) << RCC_PLL3DIVR_N3_Pos) |
                    ((17 - 1) << RCC_PLL3DIVR_P3_Pos) |
                    ((2 - 1) << RCC_PLL3DIVR_Q3_Pos) |
                    ((2 - 1) << RCC_PLL3DIVR_R3_Pos);

    RCC->PLL3FRACR = (1 << 16) | 7570; // Enable Fractional, Value = 7570

It seems different to the implementation used in the ioc file.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.