**** BEGIN LOGGING AT Wed Apr 02 02:59:59 2014 Apr 02 08:42:05 moin :) Apr 02 11:56:32 Hmm .. turns out dmix seems to use a significant amount of CPU :( Apr 02 12:26:17 * Maxdamantus wonders how pulseaudio uses less CPU. Apr 02 13:11:19 Maxdamantus: never heard of that Apr 02 13:11:35 usually it's PA that hogs CPU Apr 02 13:12:47 Maxdamantus: make sure your ALSA is correctly configured Apr 02 13:13:46 for dmix the IPC is very important Apr 02 13:14:34 on a desktop where cmus is playing mp3s pa usually takes more cpu than cmus Apr 02 13:15:11 Was trying mplayer and mpd. Apr 02 13:15:30 mpd was at around 90% Apr 02 13:15:35 mplayer about 30% Apr 02 13:25:26 what do you have to do WRT IPC? Apr 02 13:26:03 type dmix Apr 02 13:26:03 ipc_key 1532 Apr 02 13:28:40 you can just try it in normal Freemantle with mplayer: echo 'pcm.meh { type dmix; ipc_key 1532; pcm.slave "hw:0,0"; }' >>/etc/asound.conf Apr 02 13:28:52 mplayer foo.mp3 -ao alsa:device=meh Apr 02 13:29:16 uses 30% of CPU for me, and audio is choppy. Apr 02 13:30:07 with the default alsa pulse plug thing, about 9% of CPU in pulseaudio and 5% in mplayer. Apr 02 13:30:52 (the 30% in the first one is in mplayer) Apr 02 13:31:56 I think the 5% remaining in mplayer is basically just decoding this flac. Apr 02 13:35:47 flac ? foo.mp3 ? Apr 02 13:36:08 was an example. Apr 02 13:36:17 * Maxdamantus doesn't actually have a file called foo.mp3 Apr 02 13:36:25 :) Apr 02 13:36:41 Well, there's probably a foo.mp3 in /tmp on my main computer, because I don't clear /tmp Apr 02 13:36:49 or not. Apr 02 13:37:07 foo.aux foo.c foo.cpp foo.git foo.gitearly foo.hs foo.java foo.log foo.o foo.ogg foo.pdf foo.py foo.tar.gz foo.tex foo.w Apr 02 13:37:20 ooh, foo.ogg Apr 02 13:37:21 :)) Apr 02 13:39:32 $ cat foo.w | sed 's/^ */ /' | tr -d \\n; echo foo ::= a @ v:a -| ( b:(a, a) ::= (v, v); return b ); return foo <- 4 Apr 02 13:39:46 er .. foo ::= a @ v:a -| ( b:(a, a) ::= (v, v); return b ); return foo <- 4 Apr 02 13:39:47 obviously. Apr 02 13:39:57 some language I made a few years ago. Apr 02 13:53:00 Hm. Significantly better using aplay/dmix rather than mplayer/dmix Apr 02 13:53:30 Maybe it has to do with buffer sizes used or something. Apr 02 13:54:30 ah, aplay's not causing it to be resampled. Apr 02 13:55:15 still far better than mplayer .. even better than pulseaudio. Apr 02 13:55:23 7% Apr 02 13:56:56 aplay doesn't work with pulse. Maybe aplay takes shortcuts that mplayer doesn't. Apr 02 13:58:22 Maxdamantus: hmm, no rate conversion Apr 02 13:59:17 I hadn't specified a pcm.meh.pcm.rate Apr 02 14:00:25 I get buffer underflows with aplay/dmix though. Apr 02 14:01:13 underrun* Apr 02 14:02:20 your pcm.meh doesn't look correct Apr 02 14:03:14 well, it kinda looks syntactically correct, but it lacks a rate inside dmix, and a rate conversion aka pcm type "plug" before the dmix Apr 02 14:04:22 I added a rate next to the slave afterwards. Apr 02 14:04:26 and I think the hw pcm needs some buffersize etc as well Apr 02 14:04:37 was under the impression dmix already did resampling. Apr 02 14:04:46 nope, it doesn't Apr 02 14:05:08 it's even worse since it can only have hw slave Apr 02 14:05:11 It doesn't pick a sensible buffer_size etc by default? Apr 02 14:05:19 and only works with sample rate of that slave Apr 02 14:05:42 So who's resampling? aplay? Apr 02 14:05:56 since my wave file is 44.1 kHz Apr 02 14:06:05 not necessarily, the application can define a range of preferred buffer sizes etc, and it will pick one from that Apr 02 14:06:44 I dunno. aplay source is pretty short, and educational Apr 02 14:07:01 check aplay -vv parameter Apr 02 14:07:19 it helps a lot for analyzing what's going on in alsa stack Apr 02 14:07:58 buffer_size : 1536; period_size : 512; period_time : 11609 Apr 02 14:08:31 you also see sample rates Apr 02 14:08:50 of each pcm, in and out Apr 02 14:09:16 alas not for pukeaudio Apr 02 14:09:27 obviously Apr 02 14:09:49 Direct Stream Mixing PCM: exact rate : 44100 (44100/1) Apr 02 14:10:04 o.O Apr 02 14:10:27 wasn't N900 audiocard fixed to 48k sampelrate? Apr 02 14:10:54 afaik, which is why I've been presuming dmix has been resampling. Apr 02 14:10:59 or something under the dmix device. Apr 02 14:11:05 rather than the application. Apr 02 14:11:18 obviously nothing does Apr 02 14:11:34 which might explain why you get lots of buffer underruns Apr 02 14:11:38 Doesn't seem to underrun with period and buffer size 1024 and 8192 Apr 02 14:12:49 They weren't constant before, but it happened every 10s or so. Apr 02 14:14:50 ah, setting the rate in also actually halved the CPU usage in mplayer. Apr 02 14:15:34 so it looks like mplayer was spending lots of time doing its own resampling (it listed the alsa output as 48 kHz, but played normally) Apr 02 14:18:12 wait, that's with 44100 in asound.conf Apr 02 14:18:18 not 48000 Apr 02 14:18:50 maybe the hardware does do 44100 Apr 02 14:20:39 so mpd is also around 15% like that, which seems acceptable. Apr 02 14:21:07 * Maxdamantus thinks he might have a few songs in 48 kHz Apr 02 14:29:09 oops, was using hw:0,0 in mpd. Apr 02 14:29:51 mk, so still at 15% with mpd/dmix, but it can't play 48 kHz songs. Apr 02 14:29:58 only have one in my library, actually. Apr 02 14:30:18 Radiohead, Supercollider Apr 02 14:38:19 mplayer can almost downsample it without breaks. Apr 02 14:38:49 AUDIO: 48000 Hz, 2 ch, s32le, 1424.2 kbit/46.36% (ratio: 178022->384000) Apr 02 14:46:59 Mm, mpd has a cheaper "internal" resampler than the default libsample one. Apr 02 20:58:34 What the hell is this? Apr 02 20:58:41 Who are you chuckle brothers? Apr 02 20:59:05 And why are there so many people here? Apr 02 20:59:23 Already ab is my favourite guy here Apr 02 20:59:27 You joker! Apr 02 21:19:23 wat **** ENDING LOGGING AT Thu Apr 03 02:59:59 2014