Can low jitter be achieved with STM32 microcontroller

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
By the way, be sure I will become a big fan of the remarkable 10 Mbit/s "pseudo-async" audio stuff that you succeeded in programming on the STM32F4, in case your github lists the systems (and possible software updates) that can be used as audio source.

Windows XP laptops and desktops ?
Windows 7 laptops and desktops ?
Windows 8 laptops and desktops ?
Windows 10 laptops and desktops ?

Android smartphones, tablets, TV boxes ?

macOS laptops and desktops ?
iOS smartphones, tablets, TV boxes ?

Regards (and sympathic encouragements),
Steph
 
Hi Steph_tsf,

All the code for the Nucleo stm32F746 is available on Github. It has been tested with Windows 7, Windows 10 and Linux. No reason that it doesn't work with MacOS. It is seen as a standard audio device.

I'm where it meets all my requirements to drive my speakers and enjoy music :)

I have no intention for the moment to work on 24bits 96k, as my music is basically all 16bits and 44,1k.

I will post upgrades of the software on Github.

No external clock module, as nobody jumped in to develop such module. Il delieve thqt in my case it is not needed as the outputs are SPDIF, with SPDIF decoders on the amplifier side. It would make more sense with amplifiers with I2S inputs.

Best regards,

JMF
 
Interesting approach

Hi Steph_tsf,

All the code for the Nucleo stm32F746 is available on Github.
----------------------------

Well done! I'm working on a commercial project using a STM32F407. We are using the same development environment with some additions:

1. HAL library is used for all low-level hardware (like i2s/i2c/usb)
2. ST USB library used to implement USB device
3. CMSIS DSP library is used for FIR filters and other DSP stuff.

Due to the complexity we have found it necessary to use FreeRTOS to provide efficient multitasking and software partitioning

All audio processing is 16-bit at 48 KHz sampling. The CMSIS DSP library allows other formats such as floating point. Our code does a sampling rate conversions to get to and from the 48 KHz rate.

All of this is available on the STM32F7 processors as well. You will find DSP operation is greatly enhanced if you can place code and data in coupled ram memory (ie zero wait state)

ST provide a lot of good free stuff and documentation. The key is that you have to look and use some intelligence. They certainly don't hold your hand.

One DIY project I am interested is a Power DAC which:

1. Accepts an input from a PC via S/PDIF

2. Transcodes the PCM to 1-bit DSD, 1-bit Delta-Sigma or quantized PWM

3. Drives external analogue switches and filters to produce audio

4. Incorporates feedback loops by sampling audio output and processing digitally.

The processing power required exceeds that provided by an STMF4 or F7. FPGA is the solution?
 
Use the processor to do cycle counting.

I have in mind to do it in the following way in coming weeks if I succeed to implement it.
.
The professional way seems to be called "profiling" but I didn't found a How-to do it on the framework provided by ST.

JMF

Processor includes support for cycle counting. ie

Code:
[INDENT]/* start debug cycle counting */ 
void StartCycleCount(void) 
{ 
    /* enable data watchpoint and trace unit */ 
    CoreDebug->DEMCR |= 0x01000000; 
    /* reset the cycle counter */ 
    DWT->CYCCNT = 0; 
    /* enable the cycle counting */ 
    DWT->CTRL |= 0x00000001; 
} 
 
/* stop counting and return count value */ 
uint32_t StopCycleCount(void) 
{ 
    /* stop counting */ 
    DWT->CTRL &= 0xFFFFFFFE; 
    /* return value */ 
    return DWT->CYCCNT; 
} 
[/INDENT]
This very simple and you may like to refine it. Further details are found in the processor datasheets.
 
Hello,

I'm looking at the code found here: https://github.com/jmf13

Great job JMF, this looks promising. I'm interested in using it as the codebase for my project. The project is an asynchonous USB soundcard with 4 analog inputs where we can apply mixing (ADC + USB Audio) and effects. The result is a Async USB Audio + 4 channel ADC ->DSP -> I2C...

I think this project would be a great starting point. Can you confirm that it's licensed under GNU 3.0? Under the "Const_DSP_I2S_DAC" project it has a License. Under the other two projects I didn't see a license.

I'd be happy to contribute my findings, but this is a commercial project. Please advise me on the license for your projects so I know if I can move forward. Also, let me know if you are accepting side jobs and would consider my project. Thanks!

Jay
 
Hi Jay,

Yes, my code is intended to be under GNU 3.0 licence. I'm not a professional of Github and don't really know how to add the license status at the top. Feel free to use it, and just report if you find bugs and have proposals to improve :)

Part of the libraries are under ST license. Their license statements are included in the code.

Cheers,

JMF
 
Last edited:
Is anyone on this thread interested in some paid work to further develop this project? Anyone with real world experience in this please PM me. I'm interested in using JMF11's code to create a USB soundcard with microphone inputs, mixed through the Audio DSP for realtime live audio (low latency)... I hope the processor is powerful enough...
 
I agree with Tiboucha that it is the way to go now (it was not exixting when I started my project). I don't know if it has the ASync USB feature, but I believe that it is not mandatory for a karaoke application.

The guy behind Audio weaver is one of THE audio DSP expert.

JMF
 
Hello,


Sorry to disappoint you, but this code was more a proof of concept, an early prototype, than a clean implementation of the function. And I didn't touched the code nor the environment since 4 years. It would only run on one nucleo board it was compiled for... So the bin is useless.


The other code F7USBAudio is more finalized but implements fake DSP filters (as LXmini filters have some IP). So here also, the bin would be useless. However that code drives my system since 4 years without bugs.


JMF
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.