nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0136-Improve-spkmodem-reliability-by-adding-a-separator-b.patch

f96e0b
From 259d86f862615a6135d96553768b564785f56a30 Mon Sep 17 00:00:00 2001
f96e0b
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
f96e0b
Date: Mon, 21 Jan 2013 21:05:33 +0100
f96e0b
Subject: [PATCH 136/482] Improve spkmodem reliability by adding a separator
f96e0b
 between bytes.
f96e0b
f96e0b
---
f96e0b
 grub-core/term/spkmodem.c | 14 +++++++-------
f96e0b
 1 file changed, 7 insertions(+), 7 deletions(-)
f96e0b
f96e0b
diff --git a/grub-core/term/spkmodem.c b/grub-core/term/spkmodem.c
f96e0b
index 5bff429..f20a27d 100644
f96e0b
--- a/grub-core/term/spkmodem.c
f96e0b
+++ b/grub-core/term/spkmodem.c
f96e0b
@@ -70,12 +70,7 @@ put (struct grub_term_output *term __attribute__ ((unused)), const int c)
f96e0b
 {
f96e0b
   int i;
f96e0b
 
f96e0b
-  if (!inited)
f96e0b
-    {
f96e0b
-      make_tone (GRUB_SPEAKER_PIT_FREQUENCY / 50, 20);
f96e0b
-      inited = 1;
f96e0b
-    }
f96e0b
-
f96e0b
+  make_tone (GRUB_SPEAKER_PIT_FREQUENCY / 200, 4);
f96e0b
   for (i = 7; i >= 0; i--)
f96e0b
     {
f96e0b
       if ((c >> i) & 1)
f96e0b
@@ -84,12 +79,17 @@ put (struct grub_term_output *term __attribute__ ((unused)), const int c)
f96e0b
 	make_tone (GRUB_SPEAKER_PIT_FREQUENCY / 4000, 40);
f96e0b
       make_tone (GRUB_SPEAKER_PIT_FREQUENCY / 1000, 10);
f96e0b
     }
f96e0b
-  make_tone (GRUB_SPEAKER_PIT_FREQUENCY / 50, 0);
f96e0b
+  make_tone (GRUB_SPEAKER_PIT_FREQUENCY / 200, 0);
f96e0b
 }
f96e0b
 
f96e0b
 static grub_err_t
f96e0b
 grub_spkmodem_init_output (struct grub_term_output *term)
f96e0b
 {
f96e0b
+  /* Some models shutdown sound when not in use and it takes for it
f96e0b
+     around 30 ms to come back on which loses 3 bits. So generate a base
f96e0b
+     200 Hz continously. */
f96e0b
+
f96e0b
+  make_tone (GRUB_SPEAKER_PIT_FREQUENCY / 200, 0);
f96e0b
   grub_terminfo_output_init (term);
f96e0b
 
f96e0b
   return 0;
f96e0b
-- 
f96e0b
1.8.2.1
f96e0b