From dd82f13fa1241266576b508180fcf90b8d9bda2c Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Mon, 19 Feb 2018 16:28:11 +1100 Subject: 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 --- firmware/drivers/audio/fiiolinux_codec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'firmware/drivers/audio/fiiolinux_codec.c') 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) void audiohw_preinit(void) { - alsa_controls_init(); + alsa_controls_init("default"); hw_open(); // NOTE: // Of the exported controls, only these do anything: @@ -130,7 +130,7 @@ void audiohw_set_volume(int vol_l, int vol_r) if (!muted) { alsa_controls_set_ints("DACL Playback Volume", 1, &vol_hw[0]); alsa_controls_set_ints("DACR Playback Volume", 1, &vol_hw[1]); - pcm_alsa_set_digital_volume(vol_sw[0], vol_sw[1]); + pcm_set_mixer_volume(vol_sw[0], vol_sw[1]); } } @@ -147,13 +147,13 @@ void audiohw_mute(int mute) { alsa_controls_set_ints("DACL Playback Volume", 1, &vol0); alsa_controls_set_ints("DACR Playback Volume", 1, &vol0); - pcm_alsa_set_digital_volume(0, 0); + pcm_set_mixer_volume(0, 0); } else { alsa_controls_set_ints("DACL Playback Volume", 1, &vol_hw[0]); alsa_controls_set_ints("DACR Playback Volume", 1, &vol_hw[1]); - pcm_alsa_set_digital_volume(vol_sw[0], vol_sw[1]); + pcm_set_mixer_volume(vol_sw[0], vol_sw[1]); } } -- cgit v1.2.3