https://bugs.dragonflybsd.org/https://bugs.dragonflybsd.org/favicon.ico?16293952082006-01-09T16:32:20ZDragonFlyBSD bugtrackerDragonFlyBSD - Bug #48: turning off the beephttps://bugs.dragonflybsd.org/issues/48?journal_id=1572006-01-09T16:32:20Zqhwt+dfly
<ul></ul><p>On Mon, Jan 09, 2006 at 02:02:32AM -0500, Erik V. Smith wrote:</p>
<blockquote>
<p>With 1.4.0 Release, "kbdcontrol -b quiet.off" should turn off the <br />keyboard beep, however it is not being disabled. Furthermore, <br />"kbdcontrol -b visual" does not cause the screen to flash at the <br />appropriate time.</p>
</blockquote>
<p>I don't see a difference between `-b off' and `-b quiet.off', as the<br />former has always worked for me to turn off the beep. The patch below<br />should make `-b quiet.off' a synonym to `-b off'. Do you like it?<br />As for `-b visual', it works as it is; the screen flashes, for instance,<br />when I hit backspace at the beginning of line, or when I run printf '\007' .</p>
<p>Index: kbdcontrol.c
===================================================================<br />RCS file: /home/source/dragonfly/cvs/src/usr.sbin/kbdcontrol/kbdcontrol.c,v<br />retrieving revision 1.5<br />diff <del>u -r1.5 kbdcontrol.c<br />--</del> kbdcontrol.c 30 Oct 2005 23:00:57 <del>0000 1.5<br />+<ins>+ kbdcontrol.c 9 Jan 2006 08:09:58 -0000<br /><code>@ -868,7 +868,7 </code>@<br /> else if (!strcmp(opt, "normal"))<br /> duration = 5, pitch = 800;<br /> else if (!strcmp(opt, "off"))<br /></del> duration = 0, pitch = 0;<br /></ins> bell = 0, duration = 0, pitch = 0;<br /> else {<br /> char *v1;</p> DragonFlyBSD - Bug #48: turning off the beephttps://bugs.dragonflybsd.org/issues/48?journal_id=1582006-01-09T16:46:10Zqhwt+dfly
<ul></ul><p>On Mon, Jan 09, 2006 at 05:24:25PM +0900, YONETANI Tomokazu wrote:</p>
<blockquote>
<p>On Mon, Jan 09, 2006 at 02:02:32AM -0500, Erik V. Smith wrote:</p>
<blockquote>
<p>With 1.4.0 Release, "kbdcontrol -b quiet.off" should turn off the <br />keyboard beep, however it is not being disabled. Furthermore, <br />"kbdcontrol -b visual" does not cause the screen to flash at the <br />appropriate time.</p>
</blockquote>
<p>I don't see a difference between `-b off' and `-b quiet.off', as the<br />former has always worked for me to turn off the beep. The patch below<br />should make `-b quiet.off' a synonym to `-b off'. Do you like it?<br />As for `-b visual', it works as it is; the screen flashes, for instance,<br />when I hit backspace at the beginning of line, or when I run printf '\007' .</p>
</blockquote>
<p>And this one should also fix `-b quiet.visual' which drhodus@ mentioned<br />earlier on kernel@ with a subject "BEEPING":<br /><a class="external" href="http://leaf.dragonflybsd.org/mailarchive/kernel/2005-08/msg00050.html">http://leaf.dragonflybsd.org/mailarchive/kernel/2005-08/msg00050.html</a></p>
<p>Index: kbdcontrol.c
===================================================================<br />RCS file: /home/source/dragonfly/cvs/src/usr.sbin/kbdcontrol/kbdcontrol.c,v<br />retrieving revision 1.5<br />diff <del>u -r1.5 kbdcontrol.c<br />--</del> kbdcontrol.c 30 Oct 2005 23:00:57 -0000 1.5<br />+++ kbdcontrol.c 9 Jan 2006 08:34:39 -0000<br /><code>@ -858,7 +858,7 </code>@
{<br /> int bell, duration, pitch;</p>
<p>- bell = 0;<br />+ bell = duration = pitch = 0;<br /> if (!strncmp(opt, "quiet.", 6)) {<br /> bell = 2;<br /> opt <ins>= 6;<br /><code>@ -868,7 +868,7 </code>@<br /> else if (!strcmp(opt, "normal"))<br /> duration = 5, pitch = 800;<br /> else if (!strcmp(opt, "off"))<br />- duration = 0, pitch = 0;<br /></ins> bell = 0;<br /> else {<br /> char *v1;</p> DragonFlyBSD - Bug #48: turning off the beephttps://bugs.dragonflybsd.org/issues/48?journal_id=1592006-01-09T16:58:20Zqhwt+dfly
<ul></ul><p>On Mon, Jan 09, 2006 at 05:41:44PM +0900, YONETANI Tomokazu wrote:</p>
<blockquote>
<p>And this one should also fix `-b quiet.visual' which drhodus@ mentioned<br />earlier on kernel@ with a subject "BEEPING":<br /><a class="external" href="http://leaf.dragonflybsd.org/mailarchive/kernel/2005-08/msg00050.html">http://leaf.dragonflybsd.org/mailarchive/kernel/2005-08/msg00050.html</a></p>
</blockquote>
<p>No, forget about this; I thought that the reason that the bell doesn't<br />go away is because the variables duration and pitch are uninitialized <br />in `-b quiet.visual' case, but then I noticed those variables aren't<br />used at all when "quiet." is used, right after I sent the previous message...</p> DragonFlyBSD - Bug #48: turning off the beephttps://bugs.dragonflybsd.org/issues/48?journal_id=1652006-01-09T23:15:30Zerikvsmith
<ul></ul><p>YONETANI Tomokazu wrote:</p>
<blockquote>
<p>+ bell = 0, duration = 0, pitch = 0;</p>
</blockquote>
<p>variable "bell" is being initialized to zero on line 861 of<br />kbdcontrol.c, so I'm affraid this won't work.</p> DragonFlyBSD - Bug #48: turning off the beephttps://bugs.dragonflybsd.org/issues/48?journal_id=1682006-01-10T00:09:20Zqhwt+dfly
<ul></ul><p>On Mon, Jan 09, 2006 at 10:07:22AM -0500, Erik V. Smith wrote:</p>
<blockquote>
<p>YONETANI Tomokazu wrote:</p>
<blockquote>
<p>+ bell = 0, duration = 0, pitch = 0;</p>
</blockquote>
<p>variable "bell" is being initialized to zero on line 861 of<br />kbdcontrol.c, so I'm affraid this won't work.</p>
</blockquote>
<p>Well, I missed the tilde here:<br /> if ((bell & ~2) == 0)<br /> fprintf(stderr, "\x1B[=%d;%dB", pitch, duration);<br />which made me interpret the statement as `when quiet bit not set'...</p>
<p>Anyway, it turned out that both `-b off' and '-b quiet.off' turns off<br />the bell for me, without or without the patch :-] Do you see something<br />if you change the line calling ioctl() to something below?</p>
<pre><code>if (ioctl(0, CONS_BELLTYPE, &bell) -1)<br /> perror("CONS_BELLTYPE");<br /> if ((bell & ~2) 0)<br /> fprintf(stderr, "\x1B[=%d;%dB", pitch, duration);</code></pre>
<p>If so, you may have to dig into scioctl() to find where it's failing<br />to set flags or flash the screen.</p> DragonFlyBSD - Bug #48: turning off the beephttps://bugs.dragonflybsd.org/issues/48?journal_id=1712006-01-10T04:24:20Zerikvsmith
<ul></ul><p>YONETANI Tomokazu wrote:</p>
<blockquote>
<p>Anyway, it turned out that both `-b off' and '-b quiet.off' turns off<br />the bell for me, without or without the patch :-] Do you see something<br />if you change the line calling ioctl() to something below?</p>
<p>if (ioctl(0, CONS_BELLTYPE, &bell) -1)<br />perror("CONS_BELLTYPE");<br />if ((bell & ~2) 0)<br />fprintf(stderr, "\x1B[=%d;%dB", pitch, duration);</p>
<p>If so, you may have to dig into scioctl() to find where it's failing<br />to set flags or flash the screen.</p>
</blockquote>
<p>thank you for the help, looks like I'm digging into scioctl() :</p>
<ol>
<li>kbdcontrol -b visual<br />CONS_BELLTYPE: Inappropriate ioctl for device</li>
<li>kbdcontrol -b quiet.off<br />CONS_BELLTYPE: Inappropriate ioctl for device</li>
</ol> DragonFlyBSD - Bug #48: turning off the beephttps://bugs.dragonflybsd.org/issues/48?journal_id=1742006-01-10T09:33:49Zerikvsmith
<ul></ul><p>ah ha! the following properly shuts off the beep from within xorg<br />xset b off</p> DragonFlyBSD - Bug #48: turning off the beephttps://bugs.dragonflybsd.org/issues/48?journal_id=1762006-01-10T09:43:20Zcorecode
<ul></ul><p>Erik V. Smith wrote:</p>
<blockquote>
<p>ah ha! the following properly shuts off the beep from within xorg<br />xset b off</p>
</blockquote>
<p>well, in xorg, yes. I guess we all thought you were playing on the console.</p>
<p>cheers<br /> simon</p> DragonFlyBSD - Bug #48: turning off the beephttps://bugs.dragonflybsd.org/issues/48?journal_id=1772006-01-10T09:57:07Zcorecode
<ul></ul><p>pilot error</p>