Date: Thu, 17 Jan 2008 02:52:22 +0100 From: "Julian Stacey" <jhs@berklix.org> To: freebsd-multimedia@freebsd.org Cc: jhs@berklix.com Subject: forcing more sound buffering Message-ID: <200801170152.m0H1qMpA065499@fire.js.berklix.net>
next in thread | raw e-mail | index | archive | help
Hi multimedia@ people, I had sticky (intermittent breaks) sound on 2 slow hosts with 7-PRERELEASE The causes of the stickiness are various &/or compound, (eg slow CPU, DMA off (must be on mine), & PS2 mouse Giant on 7 generic src/ etc) & I ve been reading & posting over on stable@ about issues, & noting my configs for hosts lapd & lapn at: http://berklix.com/~jhs/hardware/laptops/index.html#hosts Issues causing breaks are dealt with on stable@, not here, but sound specific work- rounds to breaks discussed here: /boot/loader.conf: hw.snd.feeder_buffersize=65536 # default 16384, read only after boot. # Helped my intermittent music playing a lot (for .wav perfect, mp3 improved from awful. Maybe it should be ref'd in more manuals/ docs? & docs should explain what it is: Buffer size in bytes maybe ? & how it relates to max delay expected from disc feeding audio data. ie (I'm guessing, it's late & I haven't read source yet) if file reports eg audio_01.mp3: MPEG ADTS, layer III, v1, 128 kBits, 44.1 kHz, JntStereo Does 64K give me just a half second of buffer ? (not enough here !) I guess ksmp3play uses less internal buffering than mplayer, ? With a .jpg: 133MHz hw.snd.feeder_buffersize=16384 mplayer : ran a bit rough. 133MHz hw.snd.feeder_buffersize=65536 ksmp3play : awful 133MHz hw.snd.feeder_buffersize=65536 mplayer : still a bit broken. 166MHz hw.snd.feeder_buffersize=16384 ksmp3play : awful 166MHz hw.snd.feeder_buffersize=16384 mplayer: : much better 166MHz hw.snd.feeder_buffersize=65536 ksmp3play : broke up 166MHz hw.snd.feeder_buffersize=65536 mplayer : pretty good, not perfect. hw.snd.feeder_buffersize Max is 64K. I need more. Dont know if 64K is a horrible Intel '86 IO seg limit, or just random choice. I'll try to tweak it. What is the lowest speed CPU for playing `normal mp3 music (ie `file' above) Am I being over ambitious or reasonable ? What about decompression load on CPUs, buffering etc ? BTW I earlier tried tweaking hw.snd.latency (without knowing what it was) beyond max 10, but despite tweaking header (below) it went silent > 10. Anything else I should be tweaking ? ------- http://berklix.com/~jhs/src/bsd/fixes/freebsd/src/jhs/sys/dev/sound/pcm/channel.h.REL=ALL.diff Experimental patch for my slow 7-PRERELEASE hosts by jhs@@berklix.com to allow more than hw.snd.latency=10 in /boot/loader.conf It applies & runs, but if you use above 10, no sound. If you reduce to 5, sound seems somewhat worse, more interrupted, but even with this patch, beyond 10 it goes silent. See Also http://berklix.com/~jhs/hardware/laptops/index.html#sound *** 7.0-PRERELEASE-ctm-79/src/sys/dev/sound/pcm/channel.h Wed Jan 16 16:19:03 2008 --- jhs-experimental/src/sys/dev/sound/pcm/channel.h Wed Jan 16 16:20:37 2008 *************** *** 343,349 **** #define CHN_N_TRIGGER 0x00000010 #define CHN_LATENCY_MIN 0 ! #define CHN_LATENCY_MAX 10 #define CHN_LATENCY_DEFAULT 5 #define CHN_POLICY_MIN CHN_LATENCY_MIN #define CHN_POLICY_MAX CHN_LATENCY_MAX --- 343,350 ---- #define CHN_N_TRIGGER 0x00000010 #define CHN_LATENCY_MIN 0 ! /* #define CHN_LATENCY_MAX 10 JJDEBUG */ ! #define CHN_LATENCY_MAX 40 /* used by channel.c & feeder.c */ #define CHN_LATENCY_DEFAULT 5 #define CHN_POLICY_MIN CHN_LATENCY_MIN #define CHN_POLICY_MAX CHN_LATENCY_MAX ------- Julian -- Julian Stacey. Munich Consultant: BSD Linux Unix. http://berklix.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801170152.m0H1qMpA065499>