[oss-devel] libgstoss4audio / SNDCTL_MIX_READ

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[oss-devel] libgstoss4audio / SNDCTL_MIX_READ

Clive Wright
The recently added gstreamer plugin for OSS4 has problems handling the
value returned by SNDCTL_MIX_READ for control type MIXT_MONOSLIDER16
(and I suspect MIXT_MONOSLIDER).

See attached extract of oss4_mixer.log

This appears to be caused by stereo values being returned by
SNDCTL_MIX_READ for these control types.

The OSS v4 Programmer's guide is not explicit in this situation stating
only that:

"The current value of the mixer control will be returned in the value
field".

This is elaborated on in the next section on scaling but does not
discuss differences between values returned by mono and stereo controls
(or is this because they are treated identically).

Perhaps this should be filed as a bug report but I am mindful of getting
into the not uncommon situation where two projects claim that it is the
other projects responsibility.

A quick fix in the form of a patch for gstreamer-plugins-bad is attached.

Whether this is the correct solution for this problem depends on if the
values being returned by SNDCTL_MIX_READ are correct. OSS project please
clarify.

Kind regards,
Clive


0:00:26.238536358 29311 0x8055488 LOG              oss4mixer oss4-mixer.c:637:gst_oss4_mixer_get_control_val:<oss4mixer0> got value 0x00be00be from vmix0-vol)
0:00:26.238654023 29311 0x8055488 LOG              oss4mixer oss4-mixer-slider.c:141:gst_oss4_mixer_slider_get_volume:<GstOss4MixerSlider@0x814a320> volume: mono=12452030



Only in gst-plugins-bad/sys/oss4: .deps
Only in gst-plugins-bad/sys/oss4.bak: libgstoss4audio.la
Only in gst-plugins-bad/sys/oss4.bak: libgstoss4audio_la-oss4-audio.lo
Only in gst-plugins-bad/sys/oss4.bak: libgstoss4audio_la-oss4-audio.o
Only in gst-plugins-bad/sys/oss4.bak: libgstoss4audio_la-oss4-mixer-enum.lo
Only in gst-plugins-bad/sys/oss4.bak: libgstoss4audio_la-oss4-mixer-enum.o
Only in gst-plugins-bad/sys/oss4.bak: libgstoss4audio_la-oss4-mixer.lo
Only in gst-plugins-bad/sys/oss4.bak: libgstoss4audio_la-oss4-mixer.o
Only in gst-plugins-bad/sys/oss4.bak: libgstoss4audio_la-oss4-mixer-slider.lo
Only in gst-plugins-bad/sys/oss4.bak: libgstoss4audio_la-oss4-mixer-slider.o
Only in gst-plugins-bad/sys/oss4.bak: libgstoss4audio_la-oss4-mixer-switch.lo
Only in gst-plugins-bad/sys/oss4.bak: libgstoss4audio_la-oss4-mixer-switch.o
Only in gst-plugins-bad/sys/oss4.bak: libgstoss4audio_la-oss4-property-probe.lo
Only in gst-plugins-bad/sys/oss4.bak: libgstoss4audio_la-oss4-property-probe.o
Only in gst-plugins-bad/sys/oss4.bak: libgstoss4audio_la-oss4-sink.lo
Only in gst-plugins-bad/sys/oss4.bak: libgstoss4audio_la-oss4-sink.o
Only in gst-plugins-bad/sys/oss4.bak: libgstoss4audio_la-oss4-source.lo
Only in gst-plugins-bad/sys/oss4.bak: libgstoss4audio_la-oss4-source.o
diff -uar gst-plugins-bad/sys/oss4.bak/oss4-mixer-slider.c gst-plugins-bad/sys/oss4/oss4-mixer-slider.c
--- gst-plugins-bad/sys/oss4.bak/oss4-mixer-slider.c 2008-05-08 13:41:58.000000000 +0100
+++ gst-plugins-bad/sys/oss4/oss4-mixer-slider.c 2008-05-08 13:47:27.000000000 +0100
@@ -96,15 +96,15 @@
 
   val = (guint32) v;
   switch (s->mc->mixext.type) {
-    case MIXT_MONOSLIDER:
-    case MIXT_MONOSLIDER16:
     case MIXT_SLIDER:
       volumes[0] = val;
       break;
+    case MIXT_MONOSLIDER:
     case MIXT_STEREOSLIDER:
       volumes[0] = (val & 0x00ff);
       volumes[1] = (val & 0xff00) >> 8;
       break;
+    case MIXT_MONOSLIDER16:
     case MIXT_STEREOSLIDER16:
       volumes[0] = (val & 0x0000ffff);
       volumes[1] = (val & 0xffff0000) >> 16;

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel