Menu

High CPU Load - Raspberry Pi - Python

Help
Owen
2014-11-06
2018-07-27
  • Owen

    Owen - 2014-11-06

    Using IDJC, as it's the only decent working application for streaming with icecast2/shoutcast, on my raspberry pi. The CPU is overclocked to 1.1GHz.

    The issue is that when running the application, the core gets hit hard by python to about 80%. When playing an audio file and streaming to icecast2, the core gets nailed to 100%. This has the stuttering effect on the stream.

    I'm using ices at the moment, but it really isn't what I'm looking for since it utilises a static playlist. The reason this is, is because Ices uses 1% CPU, and that's streaming MP3 to icecast2. I would really like to use IDJC instead.

    Any ideas?

    Thanks.

     
  • Stephen Fairchild

    Turning down the settings in 'Preferences->General->Feature Set' should help.

    Make sure you are running JACK with a sampling rate of 44100Hz to prevent resampling of media player audio and set player resampling quality to 'Fast'.

    The stream quality setting should be lowered.

     
  • Owen

    Owen - 2014-11-07

    Hi,

    None of what you suggested made any difference. I tried altering the Sample Rate in JACK after stopping the server, then starting JACK and it still appears to use 48000Hz. I also found that ".jackdrc" doesn't exist inside my user home folder "~/".

    Not sure what you mean by "Turning down the settings in 'Preferences->General->Feature Set'" since there isn't anything I can find too turn down other than limit how many simultaneous streams can play etc. Anyway I selected "Basic Streamer" and it brought the CPU down to 70-80%, and the stuttering in the stream is still there; but it's also still way to high for a simple stream. I attached a screenshot showing the output of htop.

    Thanks.

     

    Last edit: Owen 2014-11-07
  • Brian Millham

    Brian Millham - 2015-08-20

    I know this is an old thread, but I just got a Pi 2 Model B, and am happy to report that using IDJC works.

    There is only one thing I can get working without lots of Xruns, and that's using DSP (via jack-rack) to add compression to the stream.

    So far, everything else works fine, but i haven't actually done a stream yet.

    On the Pi 2, I am running Ubuntu Mate. The Pi 2 is overclocked to 1.075 GHz (it hangs if I try 1.1Ghz)

    So in conclusion, it looks like the Pi 2 is a viable solution for running IDJC, as long as you don't care about using DSP.

    Brian

     
  • Moonbase

    Moonbase - 2018-02-17

    I finally got myself a Raspberry Pi 3 Model B (1.2 GHz, 1 GB RAM), in an Element 14 "Desktop" case, and full Raspbian Stretch, which I boot from an attached 2.5" 1TB HDD drive. The goal (actually a Proof-of-Concept) was to build a very small, portable mini broadcasting system.

    After LOTS of fiddling with JACK2, I finally found a setting that seems to work without XRUNs, even when I use Clementine to select and prelisten songs (from a base of ~125k songs). My .jackdrc looks like this:

    /usr/bin/jackd -P50 -p128 -t2000 -dalsa -r44100 -p1024 -n3 -s -D -Chw:Device,0 -Phw:Device,0
    

    (I use a cheap $8 USB headset adapter which is based on the C-Media HS100B chipset.)

    Even if this thread is quite old, I do hope it helps somebody. :-)

     
    • SimonR

      SimonR - 2018-03-05

      Even if this thread is quite old, I do hope it helps somebody. :-)

      It certainly does. Using your settings, I even was able to use netjack to send the audio from idjc from the Raspberry Pi 3 to another computer running another instance of idjc. Thus, the litte Pi can, e.g., be used for a co-host / co-DJ playout station - which we found quite useful.

       
  • Moonbase

    Moonbase - 2018-07-27

    Unbelievable … even using netjack! Glad it helped, thanks for the kind words!

     

Log in to post a comment.