With 06-fix-m-option.patch you add these two lines in
src/osdsh/controlsh.c:load_plugin():

        mod_mixerdev = dlsym(module, "mixerdevice");
        *mod_mixerdev = mixerdevice;

I presume what you intended to accomplish here is to tell the module
which user-specified mixer device to use since it now no longer has a
compiled-in default.  You don't need to do that and you should remove
those lines.  Since the module now refers to "mixerdevice" as an
external globally-declared variable the dynamic linker resolves its
symbol for you upon loading the module with dlopen().  While looking
into this I simply commented these two lines out, recompiled, and the
SIGSEGV disappeared.

You can check with readelf.  For 0.7.0-10.3 the output was:

$ readelf --dyn-syms /usr/bin/osdsh |grep mixerdevice
    51: 0000000000006320  4097 OBJECT  GLOBAL DEFAULT   25 mixerdevice
$ readelf --dyn-syms /usr/lib/osdsh/libosdshmixer.so |grep mixerdevice
    31: 000000000000c260  4097 OBJECT  GLOBAL DEFAULT   23 mixerdevice

Here the plugin has its own separate object for the "mixerdevice"
symbol.  For 0.7.0-10.4 it is:

$ readelf --dyn-syms /usr/bin/osdsh |grep mixerdevice
    51: 0000000000006320  4097 OBJECT  GLOBAL DEFAULT   25 mixerdevice
$ readelf --dyn-syms /usr/lib/osdsh/libosdshmixer.so |grep mixerdevice
    10: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND mixerdevice

Here the plugin lacks the separate object for the symbol, thus the
dynamic linker knows that it has to resolve that symbol from
/usr/bin/osdsh when loading libosdshmixer.so.

With that change "osdctl -s foobar" displays "foobar" in the
upper-left corner of the screen as it should.  I modprobe'd
snd-mixer-oss to see of the mixer_watch code still does anything
useful.  When I start it with "osdsh -m /dev/mixer1" and then run
"osdctl -m 1" the word "Muted" is shown in the bottom-left corner of
the screen (this is under Buster with xorg 2:1.20.4-1+deb10u2).  I
also tried under Bullseye with Xwayland, but apparently the latter
does not like the way osdsh writes its updates to the screen, and it
forces me to restart Xwayland.  Since I know next to nothing about the
Xorg-Xwayland transition I won't look into that.

N.B.: When starting osdsh I get this message:

 /usr/lib/osdsh/libosdshapm.so: cannot open shared object file: No such file or 
directory

Apparently 12-disable-apm.patch disables compilation of the module,
but does not remove/comment out the corresponding module-loading code
in src/osdsh/osdsh.c:load_basic_plugins().

Reply via email to