Hi Colin,<div>Yeah, I'm using TCP because the source audio is generated on a different machine from the one that has the USB sound card.</div><div>I have a laptop with an internet music player on it, and I have a settop PC (pretty wimpy) that has a USB audio card connected to my stereo.</div>
<div>I run the music player on my laptop because I want to control the audio from my laptop, and running the player on the settop and using vnc/nx is way to slow.</div><div><br></div><div>So maybe the pulseaudio isn't doing any resampling work and is just churning to copy bytes around. Is there any optimizations I should have set up? In my /etc/pulse/<a href="http://default.pa">default.pa</a> I have:</div>
<div> load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;<a href="http://192.168.0.0/16">192.168.0.0/16</a> port=8675</div><div><br></div><div>On the whole, I'm pretty happy with the setup. I'm trying to become an audio-snob :) and so wanted to make sure all my audio bits from the music player were getting to the sound card without unnecessary transformations.</div>
<div><br></div><div>Josh</div><div><br></div><div><div class="gmail_quote">On Sat, Jul 16, 2011 at 1:23 PM, Colin Guthrie <span dir="ltr"><<a href="mailto:gmane@colin.guthr.ie">gmane@colin.guthr.ie</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Josh,<br>
<br>
'Twas brillig, and Joshua Redstone at 16/07/11 18:50 did gyre and gimble:<br>
<div class="im">> I'm running pulseaudio 0.9.22-24-g67d18 on Ubuntu 11.04, with a source<br>
> at "s16le 2ch 44100Hz" and a USB card that is configured the same way.<br>
> I see CPU usage at 25% - I would have thought that if the source/sink<br>
> sample rates are identical and there is nothing else going on in the<br>
> system, that pulseaudio would have no sample conversion work to do.<br>
> Is there a setting to get more info on what it's doing? I've tried<br>
> 'pulseaudio -vv' and I see:<br>
<br>
</div>...sniped...<br>
<div class="im"><br>
> D: alsa-util.c: rate : 44100<br>
> D: alsa-util.c: exact rate : 44100 (44100/1)<br>
><br>
</div><div class="im">> and later on, when I play a stream:<br>
><br>
> I: sink-input.c: Created input 0 "ALSA Playback" on<br>
> alsa_output.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00-default.analog-stereo<br>
> with sample spec s16le 2ch 44100Hz and channel map<br>
> front-left,front-right<br>
</div>> I: sink-input.c: <a href="http://media.name" target="_blank">media.name</a> <<a href="http://media.name" target="_blank">http://media.name</a>> = "ALSA Playback"<br>
> I: sink-input.c: <a href="http://application.name" target="_blank">application.name</a> <<a href="http://application.name" target="_blank">http://application.name</a>> =<br>
<div class="im">> "ALSA plug-in [chrome]"<br>
> I: sink-input.c: native-protocol.peer = "TCP/IP client from<br>
</div>> <a href="http://192.168.0.200:46969" target="_blank">192.168.0.200:46969</a> <<a href="http://192.168.0.200:46969" target="_blank">http://192.168.0.200:46969</a>>"<br>
<div class="im">><br>
> It seems like they match up exactly, or am I missing something?<br>
<br>
</div>This is interesting.....<br>
<br>
The rates match up directly but it seems you are using TCP for<br>
communications. This means that the client application (Chrome in this<br>
case) is talking over a network socket to the daemon.<br>
<br>
This method is inefficient if you don't *have* to use it like this.<br>
<br>
In a typical setup PA client and server will both be run by the same<br>
user. When this happens, the client can talk to the server via a local<br>
domain socket which is more efficient. But more importantly than TCP vs.<br>
local domain, one of the key things the latter enables is SHM data<br>
transfer. Rather than copying audio data over the "wire" to the server,<br>
SHM, allows the client to just share it's memory space with the server<br>
allowing for lower overhead.<br>
<br>
I suspect you are using padevchooser which is basically cocking this all<br>
up. This is one of the many reasons we deprecated padevchooser many<br>
years ago and do not recommend it's usage.<br>
<br>
I still wouldn't expect such high CPU usage rates, so perhaps PA is<br>
waking up more than it needs to to service your USB speakers still, but<br>
getting a proper connection working is a good first step all the same.<br>
<br>
Col<br>
<br>
--<br>
<br>
Colin Guthrie<br>
gmane(at)<a href="http://colin.guthr.ie" target="_blank">colin.guthr.ie</a><br>
<a href="http://colin.guthr.ie/" target="_blank">http://colin.guthr.ie/</a><br>
<br>
Day Job:<br>
Tribalogic Limited [<a href="http://www.tribalogic.net/" target="_blank">http://www.tribalogic.net/</a>]<br>
Open Source:<br>
Mageia Contributor [<a href="http://www.mageia.org/" target="_blank">http://www.mageia.org/</a>]<br>
PulseAudio Hacker [<a href="http://www.pulseaudio.org/" target="_blank">http://www.pulseaudio.org/</a>]<br>
Trac Hacker [<a href="http://trac.edgewall.org/" target="_blank">http://trac.edgewall.org/</a>]<br>
<br>
_______________________________________________<br>
pulseaudio-discuss mailing list<br>
<a href="mailto:pulseaudio-discuss@lists.freedesktop.org">pulseaudio-discuss@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss" target="_blank">http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Josh<br>
</div>