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

With pulse/pulseaudio, snapclient keeps logging no chunks available and keeps soundcard from suspending. #927

Closed
nkvoll opened this issue Oct 17, 2021 · 0 comments

Comments

@nkvoll
Copy link
Contributor

nkvoll commented Oct 17, 2021

When using snapclient --player pulse, the client logs [Info] (Stream) No chunks available every second. While the logging does not bother me, it seems it also does not release the sound cards, so they're kept in RUNNING state perpetually:

$ pactl list sinks short
0       alsa_output.pci-0000_05_00.0.analog-stereo      module-alsa-card.c      s16le 2ch 48000Hz       RUNNING
1       alsa_output.usb-Creative_Technology_Ltd_Sound_Blaster_Play__3_00237830-00.analog-stereo module-alsa-card.c      s16le 2ch 48000Hz       RUNNING
2       alsa_output.usb-Solid_State_System_Co._Ltd._USB_Gaming_Box_1234567896F3-00.analog-stereo        module-alsa-card.c      s24le 2ch 48000Hz       RUNNING

In a setup where I'm running 4 snapclients I'm also noting that this seems to cause pulseaudio to take roughly 10% CPU (recent AMD Ryzen 5), and each snapclient instance taking around 1%. In my setup, pulseaudio is also doing some remixing, but if I stop the snapclients, its CPU drops to 0%, so it looks like it's processing silence? If this is the case, would it be possible to stop playing / sending sound when the stream they're following is idle?

Steps to Reproduce

  1. Start a snapserver with any config
  2. Start a snapclient like in the below example
  3. Check pactl list sinks short.

Environment

  • OS: debian
  • Snapcast version 0.25.0 (tested with the latest release and last build from the develop branch.)

Logfile

$ snapclient -h 192.168.2.234 --player pulse --mixer hardware --logfilter debug
2021-10-17 22-36-32.885 [Debug] (Snapclient) Trying to get PCM device for player: pulse, parameter: , card: default
2021-10-17 22-36-32.898 [Info] (Snapclient) Version 0.25.0, revision 4f2f16db
2021-10-17 22-36-32.898 [Info] (Connection) Resolving host IP for: 192.168.2.234
2021-10-17 22-36-32.898 [Info] (Connection) Connecting
2021-10-17 22-36-32.898 [Notice] (Connection) Connected to 192.168.2.234
2021-10-17 22-36-32.898 [Info] (Connection) My MAC: "52:54:00:53:68:47", socket: 8
2021-10-17 22-36-32.921 [Debug] (Connection) outstanding async_write
2021-10-17 22-36-32.922 [Info] (Controller) ServerSettings - buffer: 1000, latency: 0, volume: 100, muted: 0
2021-10-17 22-36-32.922 [Warn] (Connection) Failed to deserialize message of type: StreamTags
2021-10-17 22-36-32.923 [Info] (Controller) Codec: flac, sampleformat: 48000:16:2
2021-10-17 22-36-32.923 [Info] (Player) Player name: pulse, device: default, description: Let PulseAudio server choose the device, idx: 7, sharing mode: unspecified, parameters: <none>
2021-10-17 22-36-32.923 [Info] (Player) Mixer mode: hardware, parameters: <none>
2021-10-17 22-36-32.923 [Info] (Player) Sampleformat: 48000:16:2, stream: 48000:16:2
2021-10-17 22-36-32.923 [Info] (PulsePlayer) Setting property "application.icon_name" to "snapcast"
2021-10-17 22-36-32.923 [Info] (PulsePlayer) Setting property "media.role" to "music"
2021-10-17 22-36-32.923 [Info] (PulsePlayer) Using buffer_time: 100 ms, server: default
2021-10-17 22-36-32.923 [Debug] (PulsePlayer) State changed 2: authorizing
2021-10-17 22-36-32.929 [Debug] (PulsePlayer) State changed 3: setting name
2021-10-17 22-36-32.932 [Debug] (PulsePlayer) State changed 4: ready
2021-10-17 22-36-32.934 [Info] (Stream) outputBufferDacTime > bufferMs: 139692691104 > 1000
2021-10-17 22-36-32.934 [Debug] (Stream) Failed to get chunk, returning silence
2021-10-17 22-36-32.935 [Debug] (PulsePlayer) event_type: 0, facility: 2
2021-10-17 22-36-32.935 [Info] (Stream) No chunks available
2021-10-17 22-36-32.936 [Debug] (PulsePlayer) pa_context_get_sink_info_by_index info: 1, eol: 0
2021-10-17 22-36-32.936 [Debug] (PulsePlayer) Volume changed: 1, muted: 0
2021-10-17 22-36-32.936 [Debug] (PulsePlayer) Last volume change by server: 2 ms => ignoring volume change
2021-10-17 22-36-32.936 [Debug] (PulsePlayer) pa_context_get_sink_info_by_index info: 0, eol: 1
2021-10-17 22-36-32.962 [Info] (Controller) diff to server [ms]: 0.006
2021-10-17 22-36-33.019 [Info] (Stream) No chunks available
2021-10-17 22-36-33.939 [Debug] (Stream) Failed to get chunk, returning silence
2021-10-17 22-36-34.029 [Info] (Stream) No chunks available
2021-10-17 22-36-34.959 [Debug] (Stream) Failed to get chunk, returning silence
2021-10-17 22-36-35.009 [Info] (Stream) No chunks available
2021-10-17 22-36-35.979 [Debug] (Stream) Failed to get chunk, returning silence
2021-10-17 22-36-36.019 [Info] (Stream) No chunks available
2021-10-17 22-36-36.988 [Debug] (Stream) Failed to get chunk, returning silence
2021-10-17 22-36-37.009 [Info] (Stream) No chunks available
2021-10-17 22-36-37.999 [Debug] (Stream) Failed to get chunk, returning silence
2021-10-17 22-36-38.029 [Info] (Stream) No chunks available
2021-10-17 22-36-39.009 [Info] (Stream) No chunks available
2021-10-17 22-36-39.009 [Debug] (Stream) Failed to get chunk, returning silence
2021-10-17 22-36-40.019 [Info] (Stream) No chunks available
2021-10-17 22-36-40.019 [Debug] (Stream) Failed to get chunk, returning silence
2021-10-17 22-36-41.010 [Info] (Stream) No chunks available
2021-10-17 22-36-41.029 [Debug] (Stream) Failed to get chunk, returning silence
2021-10-17 22-36-42.019 [Info] (Stream) No chunks available
2021-10-17 22-36-42.039 [Debug] (Stream) Failed to get chunk, returning silence

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

2 participants