diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2020-10-12 11:09:55 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2020-10-12 15:33:32 +0000 |
commit | 078c34e951049741cd6681e0219561eec67e071b (patch) | |
tree | 734edf13fae68177e832d9869061777eb424d481 /firmware/drivers/audio/rocker_codec.c | |
parent | 01dc81cd943719dc0ba380774b332f6c2ee0d67e (diff) | |
download | rockbox-078c34e951049741cd6681e0219561eec67e071b.tar.gz rockbox-078c34e951049741cd6681e0219561eec67e071b.zip |
hosted: More PCM muting work
* Track mute state, only call hw if actual change is needed
* Don't unmute in audiohw_postinit()
* sample rate tracking fixes
* erosq: Don't start up muted
Change-Id: I004f787a4b7ea73c16b6ec9818ec29a12c89f46b
Diffstat (limited to 'firmware/drivers/audio/rocker_codec.c')
-rw-r--r-- | firmware/drivers/audio/rocker_codec.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/firmware/drivers/audio/rocker_codec.c b/firmware/drivers/audio/rocker_codec.c index e5573df843..e34cb87e9b 100644 --- a/firmware/drivers/audio/rocker_codec.c +++ b/firmware/drivers/audio/rocker_codec.c | |||
@@ -32,6 +32,8 @@ static int fd_hw; | |||
32 | static long int vol_l_hw = 255; | 32 | static long int vol_l_hw = 255; |
33 | static long int vol_r_hw = 255; | 33 | static long int vol_r_hw = 255; |
34 | 34 | ||
35 | static int muted = -1; | ||
36 | |||
35 | static void hw_open(void) | 37 | static void hw_open(void) |
36 | { | 38 | { |
37 | fd_hw = open("/dev/snd/controlC0", O_RDWR); | 39 | fd_hw = open("/dev/snd/controlC0", O_RDWR); |
@@ -46,6 +48,11 @@ static void hw_close(void) | |||
46 | 48 | ||
47 | void audiohw_mute(int mute) | 49 | void audiohw_mute(int mute) |
48 | { | 50 | { |
51 | if (muted == mute) | ||
52 | return; | ||
53 | |||
54 | muted = mute; | ||
55 | |||
49 | if(mute) | 56 | if(mute) |
50 | { | 57 | { |
51 | long int ps0 = 0; | 58 | long int ps0 = 0; |
@@ -67,10 +74,7 @@ void audiohw_preinit(void) | |||
67 | 74 | ||
68 | void audiohw_postinit(void) | 75 | void audiohw_postinit(void) |
69 | { | 76 | { |
70 | long int hp = 2; | 77 | logf("hw postinit"); |
71 | |||
72 | /* Output port switch set to Headphones */ | ||
73 | //alsa_controls_set_ints("Output Port Switch", 1, &hp); // Unmute happens on PCM start | ||
74 | } | 78 | } |
75 | 79 | ||
76 | void audiohw_close(void) | 80 | void audiohw_close(void) |