summaryrefslogtreecommitdiff
path: root/firmware/drivers/audio/fiiolinux_codec.c
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2018-02-19 16:28:11 +1100
committerSolomon Peachy <pizza@shaftnet.org>2020-10-31 14:16:31 +0000
commitdd82f13fa1241266576b508180fcf90b8d9bda2c (patch)
treecdae2331353e4f85a296782b14001d021923ddfc /firmware/drivers/audio/fiiolinux_codec.c
parentce9e7e712238dc69a825a49f4f226ff47fbbff69 (diff)
downloadrockbox-dd82f13fa1241266576b508180fcf90b8d9bda2c.tar.gz
rockbox-dd82f13fa1241266576b508180fcf90b8d9bda2c.zip
nwz/alsa: various improvements
Also audiohw driver to specific device name, rewrite alsa controls code to cache more data, thus making the code easier and use less stack. Avoid using short/long in pcm alsa code since it's the wrong size on 64-bit (simulator for example) Change-Id: Ibc1ec44396e37b6cbdedbcf37300878638e5d2d3
Diffstat (limited to 'firmware/drivers/audio/fiiolinux_codec.c')
-rw-r--r--firmware/drivers/audio/fiiolinux_codec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/firmware/drivers/audio/fiiolinux_codec.c b/firmware/drivers/audio/fiiolinux_codec.c
index 8b1f14662e..b2d95c91e9 100644
--- a/firmware/drivers/audio/fiiolinux_codec.c
+++ b/firmware/drivers/audio/fiiolinux_codec.c
@@ -67,7 +67,7 @@ static void hw_close(void)
67 67
68void audiohw_preinit(void) 68void audiohw_preinit(void)
69{ 69{
70 alsa_controls_init(); 70 alsa_controls_init("default");
71 hw_open(); 71 hw_open();
72 // NOTE: 72 // NOTE:
73 // Of the exported controls, only these do anything: 73 // Of the exported controls, only these do anything:
@@ -130,7 +130,7 @@ void audiohw_set_volume(int vol_l, int vol_r)
130 if (!muted) { 130 if (!muted) {
131 alsa_controls_set_ints("DACL Playback Volume", 1, &vol_hw[0]); 131 alsa_controls_set_ints("DACL Playback Volume", 1, &vol_hw[0]);
132 alsa_controls_set_ints("DACR Playback Volume", 1, &vol_hw[1]); 132 alsa_controls_set_ints("DACR Playback Volume", 1, &vol_hw[1]);
133 pcm_alsa_set_digital_volume(vol_sw[0], vol_sw[1]); 133 pcm_set_mixer_volume(vol_sw[0], vol_sw[1]);
134 } 134 }
135} 135}
136 136
@@ -147,13 +147,13 @@ void audiohw_mute(int mute)
147 { 147 {
148 alsa_controls_set_ints("DACL Playback Volume", 1, &vol0); 148 alsa_controls_set_ints("DACL Playback Volume", 1, &vol0);
149 alsa_controls_set_ints("DACR Playback Volume", 1, &vol0); 149 alsa_controls_set_ints("DACR Playback Volume", 1, &vol0);
150 pcm_alsa_set_digital_volume(0, 0); 150 pcm_set_mixer_volume(0, 0);
151 } 151 }
152 else 152 else
153 { 153 {
154 alsa_controls_set_ints("DACL Playback Volume", 1, &vol_hw[0]); 154 alsa_controls_set_ints("DACL Playback Volume", 1, &vol_hw[0]);
155 alsa_controls_set_ints("DACR Playback Volume", 1, &vol_hw[1]); 155 alsa_controls_set_ints("DACR Playback Volume", 1, &vol_hw[1]);
156 pcm_alsa_set_digital_volume(vol_sw[0], vol_sw[1]); 156 pcm_set_mixer_volume(vol_sw[0], vol_sw[1]);
157 } 157 }
158} 158}
159 159