[pulseaudio-discuss] iec958 (S/PDIF) + USB = 100% CPU usage

Sean Greenslade sean at seangreenslade.com
Fri Sep 8 04:15:46 UTC 2023


On Tue, Aug 29, 2023 at 10:25:03AM -0600, Ismael Farfán wrote:
> Hello pulse
> 
> I'm not sure if it's a bug or not but, I did google around for about an
> hour.
> 
> I noticed that whenever I have a device configured with the S/PDIF profile
> (iec958), PulseAudio uses 100% cpu (2 threads 50% each)
> 
> I have a cheap USB device with optical audio support
> Bus 003 Device 011: ID 0d8c:0012 C-Media Electronics, Inc. USB Audio Device
> Bus 003 Device 010: ID 0d8c:0102 C-Media Electronics, Inc. CM106 Like Sound
> Device
> 
> Here's how top looks when anything is grabbing the output, even if it's a
> paused video. As soon as I close the tab it disappears from top.
> PID   PRI  NI  VIRT   RES   SHR S  CPU%▽MEM%   TIME+  Command
> 1820   9 -11 2218M 46576 28064 S  51.5  0.1  3h41:07 /usr/bin/pulseaudio
> --daemonize=no --log-target=journal
> 55780  -6   0 2218M 46576 28064 S  50.9  0.1  6:23.43 /usr/bin/pulseaudio
> --daemonize=no --log-target=journal
> 
> I changed the profile of my USB headphones to use iec958 and I could see
> pulseaudio again using 100% cpu even though I only hear noise because the
> headphones don't support it.
> 
> So my guess is that it's got something to do with the iec958 encoding.
> 
> Any ideas?
> 
> I'm on Debian stable bookworm with KDE Plasma

Hi, Ismael.

I'm sorry to report that I was unable to reproduce your issue. I managed
to find two different USB audio devices in my collection that enumerate
with an iec958 interface, one with an actual optical S/PDIF port (a Fiio
E10) and one without (a Scarlet Solo). Neither device triggered any sort
of abnormal CPU usage when switched to iec958 compared to the analog
outputs.

That said, I am running Arch instead of Debian, so I likely have a
different kernel (and therefore ALSA drivers) and pulse version than
you. I'm not too familiar with the particulars of Debian, but perhaps
you could enable backports and see if there's a newer version of pulse
you could test?

Otherwise, my suggestion for further troubleshooting would be to check
the pulseaudio logs, increasing the verbosity if need be.

--Sean



More information about the pulseaudio-discuss mailing list