misterbo This is an histogram for the occurrencies of the timedif vector, ideally I'd like to have all of them in the 9 bin in order to have a stable output data rate (since I have to do some FFT and FRF computations and I need a constant sampling rate), any idea on how I can make it better?
This is basically just not going to happen using the Linux driver on a single core device. You really need to get the FIFOs working to be able to use this device with a high and reliable sampling rate from Linux. The Bela infrastructure can do no magic in this. In fact, running this outside of a Bela program would give slightly lower jitter values because the SPI thread wouldn't be interrupted from the audio thread.
The other solution suggested above is probably the next-best approach if you cannot get the FIFO to work. If you do all the device setup from C++ on Linux, then it shouldn't be too hard to read one 16-bit word from the device instead of reading from the ADC and pass it on to render() through the BelaContext*.
misterbo Another question: can I use 2 SPI devices? I would need another CS pin for the SPI1 bus or use the SPI0 bus, but I don't think I'm allowed to do that.
There are two SPI devices available on the pins of BelaMini, only one on Bela. The Spi class uses the peripheral's own chip-select. Each peripheral has more than one channel, each with its own CS chip. To use several devices on the same bus, you can use two channels on the same peripheral (e.g.: /dev/spidev2.0 vs /dev/spidev2.1), but then you'd have to make sure you are only using one of these at any time (as they use the same transmission lines). On BelaMini you could use the two different SPI peripherals /dev/spidev1 and /dev/spidev2 independently (i.e.: even at the same time). If the issue is to use the same transmission lines for several different devices (e.g.: more than the channels available on the SPI peripheral), you could repurpose any GPIO to act as a CS and just manually assert and deassert it before and after the calls to single_transfer().
By the way, you don't need to call Spi::setup() in readByte() and writeByte(). Just do it once in setup().
giuliomoro misterbo PS: sorry for multiple posting but if I try to upload everything in a single post I get an internal server error
this should be now fixed. Let me know if you encounter more of these issues.