Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop Running 100% cpu on one core #36

Closed
cosmo6110 opened this issue Mar 4, 2016 · 8 comments
Closed

Develop Running 100% cpu on one core #36

cosmo6110 opened this issue Mar 4, 2016 · 8 comments

Comments

@cosmo6110
Copy link

Hi!
Thank's for a great program.
I'm using the master bransh with a Rasperry PI, it's working very good.
But when i try the devel bransh i have problem with the processor load,
its only using one core 100% and the rest about 5-10% and the sound is jittering.
I'm running Volumio 1.5 with iqaudio Pi-dac+ Server and client.
It's it anything i can try to avoid the jittering?
I compiled from the source code, Kernel 3.18.5-v7+, no pulse audio, gcc version 4.9.2 (Raspbian 4.9.2-10). I got same problem with the deb package.
br
Tommy

@badaix
Copy link
Owner

badaix commented Mar 4, 2016

Which process is causing the load? Client or server?
Does is make a difference if audio is playing or not?

@cosmo6110
Copy link
Author

It's /usr/sbin/snapserver -d
7364 root 20 0 51844 2420 2148 S ** CPU100,0 %** 0,2 4:15.62 snapserver
It's 100 % all the time.
It's make no difference if audio is playing.
Snapclient is using about 3%

This is from the Master bransh.
7797 root 20 0 70676 2496 2216 S CPU 6,2 % 0,3 0:18.77 snapserver

@badaix
Copy link
Owner

badaix commented Mar 4, 2016

can you see something suspicious in syslog?
cat /var/log/syslog

You can also stop the service and start snapserver manually on the command line to see, if an error is logged.

@cosmo6110
Copy link
Author

I got this when i start the service manually and without any FIFO stream.

Settings file: /home/pi/.config/snapcast/server.json
2016-03-04 23-38-04 [out] Adding service 'Snapcast'
2016-03-04 23-38-04 [err] Stream: ReaderUri: pipe:///tmp/snapfifo?name=default
2016-03-04 23-38-04 [err] PcmReader sampleFormat: 48000:16:2
2016-03-04 23-38-04 [7] {"fragment":"","host":"","id":"pipe:///tmp/snapfifo","pa th":"/tmp/snapfifo","query":{"buffer_ms":"20","codec":"flac","name":"default","s ampleformat":"48000:16:2"},"scheme":"pipe","uri":"pipe:///tmp/snapfifo?name=defa ult"}
2016-03-04 23-38-04 [err] PcmReader start: 48000:16:2
2016-03-04 23-38-05 [out] Service 'Snapcast' successfully established.
2016-03-04 23-38-05 [err] Exception: end of file
I got this message all the time [err] Exception: end of file
and the core is on 100 %

If i first start the mpd with FIFO (streaming) then starting the server deamon. then i don't get the [err] Exception: end of file and it's working. :)
It seems that the error messages lock the cpu to 100%

2890 root 20 0 32388 3200 2924 S cpu 3,3 % 0,3 0:02.79 snapserver

2016-03-05 00-22-57 [err] PcmReader start: 48000:16:2
2016-03-05 00-22-57 [out] onResync (default): 124ms
2016-03-05 00-22-58 [out] onResync (default): 3ms
2016-03-05 00-22-58 [5] StreamServer::NewConnection: 192.168.2.182
2016-03-05 00-22-58 [out] Hello from , host: volumio, v0.5.0-be ta-1
2016-03-05 00-22-58 [out] {
2016-03-05 00-22-58 [7] "jsonrpc": "2.0",
2016-03-05 00-22-58 [7] "method": "Client.OnConnect",
2016-03-05 00-22-58 [7] "params": {
2016-03-05 00-22-58 [7] "data": {
2016-03-05 00-22-58 [7] "IP": "192.168.2.182",
2016-03-05 00-22-58 [7] "MAC": "",
2016-03-05 00-22-58 [7] "connected": true,
2016-03-05 00-22-58 [7] "host": "volumio",
2016-03-05 00-22-58 [7] "lastSeen": {
2016-03-05 00-22-58 [7] "sec": 1457133778,
2016-03-05 00-22-58 [7] "usec": 556574
2016-03-05 00-22-58 [7] },
2016-03-05 00-22-58 [7] "latency": 0,
2016-03-05 00-22-58 [7] "name": "",
2016-03-05 00-22-58 [7] "stream": "pipe:///tmp/snapfifo",
2016-03-05 00-22-58 [7] "version": "0.5.0-beta-1",
2016-03-05 00-22-58 [7] "volume": {
2016-03-05 00-22-58 [7] "muted": false,
2016-03-05 00-22-58 [7] "percent": 100
2016-03-05 00-22-58 [7] }
2016-03-05 00-22-58 [7] }
2016-03-05 00-22-58 [7] }
2016-03-05 00-22-58 [7] }
2016-03-05 00-22-58 [out] Service 'Snapcast' successfully established.
2016-03-05 00-22-58 [out] onResync (default): 1ms
2016-03-05 00-23-33 [out] onResync (default): 5ms

@cosmo6110
Copy link
Author

Little more info, when i start from /etc/init.d/snapserver start
i got 100% cpu on one core.
If i start manually without deamon mode it's working.

@cosmo6110
Copy link
Author

Hi!
The problem is gone with your latest release. :)
br Tommy

@badaix
Copy link
Owner

badaix commented Mar 9, 2016

Cool, acutally I wasn't able to reproduce the issue (using the latest version)

@1337sup3rh4x0r
Copy link

Actually I am now seeing exactly the same behaviour with the latest snapserver 0.10 on FreeBSD. If I run it as deamon, load rises to 100% as soon as a client is connected.
If I run it manually, all is good.

Syslogs don't show anything. How could I help debugging this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants