All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Pfetzing <dreamind@dreamind.de>
To: linuxppc-dev@lists.linuxppc.org
Subject: Dmasound for iBook2
Date: Thu, 27 Sep 2001 00:55:41 +0200	[thread overview]
Message-ID: <20010927005541.A10663@server> (raw)

[-- Attachment #1: Type: text/plain, Size: 221 bytes --]

Hi,

i recently tested the Dmasound patch for the ibook2, which is now in benh's
tree. I noticed that the volume got really loud even if at approx 10%...
Hope this little patch solves that, for me it does.

bye

dreamind

[-- Attachment #2: dmasound_for_ibook2_volume_fix.patch --]
[-- Type: text/plain, Size: 1146 bytes --]

diff -urN linux-benh.orig/drivers/sound/dmasound/tas3001c.c linux-benh/drivers/sound/dmasound/tas3001c.c
--- linux-benh.orig/drivers/sound/dmasound/tas3001c.c	Mon Sep 24 22:24:31 2001
+++ linux-benh/drivers/sound/dmasound/tas3001c.c	Tue Sep 25 02:09:10 2001
@@ -52,11 +52,13 @@
 #define VOL_MAX ((1<<20) - 1)

 void tumbler_get_volume(uint * left_vol, uint  *right_vol) {
-  *left_vol = cur_left_vol>>4;
-  *right_vol = cur_right_vol>>4;
+  *left_vol = cur_left_vol;
+  *right_vol = cur_right_vol;
 }

 int tumbler_set_volume(uint left_vol, uint right_vol) {
+  uint left_vol_pers = left_vol;
+  uint right_vol_pers = right_vol;
   unsigned char block[6];

   if (! tumbler_client) {
@@ -64,8 +66,11 @@
     return -1;
   }

-  left_vol<<=4;
-  right_vol<<=4;
+  left_vol>>=6;
+  right_vol>>=6;
+
+  left_vol*=left_vol;
+  right_vol*=right_vol;

   if (left_vol > VOL_MAX)
     left_vol = VOL_MAX;
@@ -85,8 +90,8 @@
     printk("tumbler: failed to set volume \n");
     return -1;
   } else {
-    cur_left_vol = left_vol;
-    cur_right_vol = right_vol;
+    cur_left_vol = left_vol_pers;
+    cur_right_vol = right_vol_pers;
   }

   return 0;

                 reply	other threads:[~2001-09-26 22:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010927005541.A10663@server \
    --to=dreamind@dreamind.de \
    --cc=linuxppc-dev@lists.linuxppc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.