Date: Wed, 20 Apr 2005 10:27:07 -0700 From: Luigi Rizzo <rizzo@icir.org> To: multimedia@freebsd.org Cc: net@freebsd.org Subject: asterisk and zaptel patches Message-ID: <20050420102707.B20180@xorpc.icir.org>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
[sorry for the crosspost to -net, but it's relevant there too;
please followup to multimedia@ only]
following a discussion on developers@, i am posting here some
patches for asterisk and the zaptel drivers.
If someone feels like committing these, please go ahead.
I am attaching a description below.
cheers
luigi
------------------
These patches are useful to make asterisk and the zaptel drivers
work better with FreeBSD.
In particular:
/usr/ports/net/asterisk:
+ The "wilcalu" module has a bug in the use of poll().
FreeBSD's poll() always checks for exceptions, even if they
are not in the mask passed to the system call. The code in
the module however does not handle this condition, resulting
in an infinite loop around poll() using all available CPU cycles.
The patch in ast20050420b.diff only implements a workaround --
if no data is readable, sleep for 1 second and saving the cpu
for others. I suggest to disable the module, anyways, until a
better fix is available.
+ The rtp module at times complains about invalid RTP checksums,
when all it happens is that there is no data on a socket to read.
I believe this is a perfectly normal event, so the patch in
ast20050420b.diff removes the (misleading) error message altogether.
+ The chan_oss.c code is working very badly with the FreeBSD, partly
because of issues in the driver and partly because the module
itself was not very clean.
ast20050420a.diff contains the diff wrt/ the version in the port,
or if you like it better chan_oss.c contains the whole file.
I have put in some workaround to limit the amount of data
buffered in the driver (to keep the audio queue short), centralize
repeated blocks of code, put global variables into the "oss" structure,
and in general tried to clean the half-duplex support which, however,
i suspect is still broken and probably useless anyways.
/usr/ports/misc/zaptel
+ the zaptel device driver has bugs in the module loading glue which
prevent it from probing the card appropriately in FreeBSD 4.x
The patches patch-zz1 and patch-zz2 (suitable to be put in
/usr/ports/misc/zaptel/files) fix the problem
-- freebsd audio driver --
+ some of the ioctls are not completely implemented causing unexpected
results (e.g. setting block sizes etc). On top of this, individual
device drivers also have issues in the handling of blocksizes,
with results ranging from no or stuttering sound to large delays
in the audio playback. While it would be great to fix the driver,
the problem is that the issues affect so many versions of FreeBSD
that a solution in user space is still preferable if possible.
Nevertheless, a simple patch for sys/dev/sound/pci/ich.c is
attached in ich.c.diff -- this driver (which supports the Intel 82801
chipset) in most cases defaults to using only 2 8K buffers, which
at the speeds of interest for telephony result in interrupts being
250ms apart, way too slow. This patch uses the closest buffer size
compatible with the request, guaranteeing up to 32 interrupts/s
if small blocks are used. The driver still has a 500ms delay in
the output channel at 8KHz, but fixing that requires a more complex
change.
[-- Attachment #2 --]
̏fB ;kwHIG;v>97!z{[=sg~IGuuUu=[voo|ï6}G}oضv{V}QAOv(^N'-nFx6 v+7nXnQMP,[?
ѷUv{_ڐ>;UZ
@K];'PXj4ww+0^b3"@X{;Eua
ZuϯD4E_5HOWWCW~SXZj<Nt:A26;eJX[zE|֖ ^0)_]_Z7z aq : K&cQ4
W<Ǚ-~zՓײy{TW/gz
Yݧy>>OViX4-s_iS wʉXD2tVC{1c[w.[_V؆ 15_6E-fG0~s3#`͉|1'bs.NT`8Co_.?'dq Mn<Ob8uߢdJaAz~70"s}>/Ev5
)8hA7~zrv^yo?too؋} DbӶdńR/qI2ۖ4,MDseY;wPX}2b<&=C? xa)F.(CwĠq
Z@d`L}#. mO|J;WA {& B_՛5kn^2r{-4F1mhi6,aW &uٳݏ5Z#;'[[8;<G@( d5` -숀WU y!HDGhS54'sqB`i,)3A8/c4oC2Uhu+<$1[*éA &A
45p"lD~2BkFp*q/ʼn6dd <;8Vx
>q0WɘHvҊr~b
!=8b5xI]8<%)0Xrk/_jo[yfO!(2^]n,'#6MѨy̫<%y99?ou{f="+Gaª
U XD @/hBh`9&Հ4g3vǖحS0*drΜ;Pn, I9ri(AsD.8#Oa4crTs\7/۠Tz'y>uiaδvH5@ۆb3J
?g!aa0'm'A;WKjw/۷8k'^ӌ$ZĞ8_qIE6h_<*[?7A7
op<e_SKPM(*
Bh@t@L}doôC9xJg1xkZhc
cVVs++1w^߁4S$˪0Ѭa_
ģ J+z 7iZsdhu{u x'mX&@_p'VrIGƢ7sCt-enƋ[FWmUӪoF)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