Stalling mp3 Stream on FEZ Hydra

Hi,

I want to receive a mp3 internet radio streams in order to play them on the GHI music module. My board is an FEZ Hydra running .NET 4.3 and the latest GHI libraries. For online connectivity I use the ENC28 ethernet module. First of all my code is running stable but sometimes there are short stallings when the music is playing.
Now the investigation is ongoing what’s the problem here. I have no feeling how much load this setup produces on a NETMF board. But imho this board should be capable playing a 128kbit stream? :open_mouth: No other thins running…

My suppositions to this issue:

  • SPI Speed
    ENC28 and the music module are connected to the same SPI.Is there a bottle neck? I have increased the SPI Speed in the music module driver up to 8000KHz. It seems to me that stuttering is getting a little better but not gone…

  • Buffer size
    The network stream is read in 32byte chunks which get transferred over SPI to the music module. I tried different sizes they didn’t change something…

  • NetworkStream.read() vs spi.write()
    Currently 32 byte get written to the SPI as soon as they are read from the stream. Should I buffer the stream and later write bigger chunks to the SPI bus? Perhaps reading such small chunks from the stream produces a lot o overhead?

  • Hydra is too slow
    Is there a way to determine CPU load? I tried some snipept from here:
    Calculate processor usage (revisited) - General Discussion - Netduino Forums
    Most of the time when doing measurement the ouput shows a high load >75%. Is that a serious check?

Thank you for your help!
Best regards

have you tried to buffer a few seconds before you start to play? This protects against network transients. There should be a queue between the network reading and the music playing.

In this type of an application the correct architecture is very important. with the information you provided, we can only guess what you have done.

Hi,
perhaps you can get some help from These
links

https://www.ghielectronics.com/community/forum/topic?id=5378

https://www.ghielectronics.com/community/codeshare/entry/805

https://www.ghielectronics.com/community/forum/topic?id=12856&page=1

Cheers
Roland