[oss-devel] A small patch for OSS userland

Yair K cesium2 at gmail.com
Tue Sep 18 04:18:37 EEST 2007


Hi,

I've written a patch for some OSS utilities and had inflicted a part of it  
on the developer forum. Since no one has complained yet, I think it's  
ready to be shown to this list.

It basically does three things:
   1) improve ossxmix.
   2) add stdin support to ossplay and ossrecord.
   3) misc fixes.

The second part has some issues on which guidance will be appericated (see  
"stdin notes" below).

Patches are:

cmd/ossinfo/ossinfo.man
   Correct duplicate "-a" description.

setup/Linux/sbin/soundoff
   when showing which applications are still using OSS, feed the output of  
/proc/cmdline to "sed 's/\x00/ /g' - per proc (5), cmdline contains nulls  
(rather than spaces) to separate between the commandline arguments, and  
the nulls tend to confuse terminals.

cmd/ossrecord
   Document -L and -t options.
   Add support to output via stdout ("ossrecord -").

cmd/ossplay
   Convert to getopt.
   Get rid of gcc -Wall warnings by setting more default values in the  
ms_adpcm decoder matching those already there.
   Add support to input via stdin.

Note: The default MS ADPCM values, ironically, will not play on my ICH  
(SiS 7012) as "1 channel input is not supported" (paraphrasing). I wonder  
how many onboard sound cards are like that. Maybe the default values  
should be changed to match those of stereo output?

cmd/ossxmix
   Convert to getopt.
   Reduce CPU-usage massively by caching the frame title. Earlier ossxmix  
redraw all the frame titles every 100ms, which managed to get 60-70% of a  
Athlon 64 3000+ in powersave mode (1Ghz).
   Add support for systray icon (GTK+ 2.10 and above, new -S option will  
prevent ossxmix from placing an icon there). Also does normal window icons.
   Fix bug where scrollbar wasn't drawn even if the window was too large  
for the screen (scrollwin was changed to GTK_POLICY_AUTOMATIC only after  
the window was shown, which made it assume the original window size was  
OK. Use a slightly different workaround for that GTK bug).
   Can minimize to background upon start ('-b' option).
   Use a consistent length limit to frame name.
   Man page and minor style changes.
Notes:
   a) When compiling with gcc and "-O -fschedule-insns", gcc (v4.1.3 and  
v4.2.1 on x86_64) will abort with a quirky "unable to find a register to  
spill in class ‘DREG’" message (optimization levels above that simply  
segfault upon being run). I wonder if anyone else is getting those too.
   b) I think that polling every 20ms is a bit excessive. KMix polls every  
50ms and works just fine. Gnome polls every 100ms, and some people think  
that's still too much ( http://bugzilla.gnome.org/show_bug.cgi?id=370937  
). This is not so acute, as one advantage of the new minimize to systray  
functionality is that gtk won't poll when ossxmix is hidden.

stdin notes
-------------
  1) when piping from ossrecord e.g. "ossrecord - | ossplay -", ossrecord  
may complain about not finding a mixer unless -R is used. Simply sleeping  
a bit before opening the audio file in ossplay seems to help, but I'm not  
sure why ossplay affects ossrecord in this case and why -R fixes this.
  2) ossrecord can be used in the following manner:
    "ossrecord -ivol - | ossplay - -R" . Could this create a destructive  
sound loop? (maybe just disallowing "vol" by default when writing to  
stdout would be best. Is the name constant or are there variations?)

-- 
   Yours,
	Yair K.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oss-upatch.diff.gz
Type: application/x-gzip
Size: 14908 bytes
Desc: not available
Url : http://mailman.opensound.com/pipermail/oss-devel/attachments/20070918/07879142/attachment.bin 


More information about the oss-devel mailing list