NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: xsrc/52341: xset doesn't properly adjust bell volume

The following reply was made to PR xsrc/52341; it has been noted by GNATS.

From: (Michael van Elst)
Subject: Re: xsrc/52341: xset doesn't properly adjust bell volume
Date: Mon, 26 Jun 2017 13:48:16 -0000 (UTC) writes:
 >Note that none of the xset commands (not even "xset b" which should set
 >everything to defaults) affects the volume of the bell.
 That's the compatibility code:
             case KDMKTONE:
                 req = WSKBDIO_COMPLEXBELL;
 #define d (*(long *)data)
                 if (d) {
 #define PCVT_SYSBEEPF   1193182 
                         if (d >> 16) {
                                 bd.which = WSKBD_BELL_DOPERIOD;
                                 bd.period = d >> 16; /* ms */
                                 bd.which = 0;
                         if (d & 0xffff) {
                                 bd.which |= WSKBD_BELL_DOPITCH;
                                 bd.pitch = PCVT_SYSBEEPF/(d & 0xffff); /* Hz */
                 } else
                         bd.which = 0; /* default */
 #undef d
                 arg = &bd;
 where the high bits of d are computed as ((duration*loudness/50) << 16).
 This is used because the X server bsd_init routine uses the first console
 driver (pcvt) that reports success and wscons is the last one in the list.
 The pcvt driver works because we provide enough compatibility ioctls.
                                 Michael van Elst
                                 "A potential Snark may lurk in every tree."

Home | Main Index | Thread Index | Old Index