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: mlelstv%serpens.de@localhost (Michael van Elst)
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: xsrc/52341: xset doesn't properly adjust bell volume
Date: Mon, 26 Jun 2017 13:48:16 -0000 (UTC)

 paul%whooppee.com@localhost 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 */
                         }
                         else
                                 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;
                 break;
 
 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
 Internet: mlelstv%serpens.de@localhost
                                 "A potential Snark may lurk in every tree."
 


Home | Main Index | Thread Index | Old Index