diff --git a/firmware/SOURCES b/firmware/SOURCES index 628e96d428..9fa380a99a 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -133,12 +133,16 @@ target/hosted/sonynwz/audio-nwz.c target/hosted/sonynwz/debug-nwz.c target/hosted/sonynwz/nvp-nwz.c target/hosted/sonynwz/nwz-db.c +target/hosted/sonynwz/nwzlinux-codec.c +#endif + +#if ((defined(HIBY_LINUX) || defined(FIIO_M3K_LINUX) || defined(SAMSUNG_YPR0) || defined(SAMSUNG_YPR1) || defined(SONY_NWZ_LINUX)) && !defined(SIMULATOR)) +target/hosted/pcm-alsa.c +target/hosted/alsa-controls.c #endif #if ((defined(HIBY_LINUX) || defined(FIIO_M3K_LINUX)) && !defined(SIMULATOR)) drivers/lcd-memframe.c -target/hosted/alsa-controls.c -target/hosted/pcm-alsa.c target/hosted/backtrace-glibc.c target/hosted/filesystem-unix.c target/hosted/kernel-unix.c @@ -154,18 +158,21 @@ target/hosted/power-linux.c target/hosted/agptek/button-agptek.c target/hosted/agptek/debug-agptek.c target/hosted/agptek/powermgmt-agptek.c +target/hosted/agptek/rocker_codec.c #endif #if defined(SURFANS_F28) && !defined(SIMULATOR) target/hosted/surfans/button-f28.c target/hosted/surfans/debug-f28.c target/hosted/surfans/powermgmt-f28.c +target/hosted/surfanslinux_codec.c #endif #if (defined(XDUOO_X3II) || defined(XDUOO_X20)) && !defined(SIMULATOR) target/hosted/xduoo/button-xduoo.c target/hosted/xduoo/debug-xduoo.c target/hosted/xduoo/powermgmt-xduoo.c +target/hosted/xduoo/xduoolinux_codec.c #endif #if defined(HIBY_LINUX) && !defined(SIMULATOR) @@ -180,6 +187,7 @@ target/hosted/fiio/debug-fiio.c target/hosted/fiio/powermgmt-fiio.c target/hosted/fiio/system-fiio.c target/hosted/fiio/usb-fiio.c +target/hosted/fiio/fiiolinux_codec.c #endif #if (defined(EROS_Q)) && !defined(SIMULATOR) @@ -187,6 +195,7 @@ target/hosted/aigo/button-erosq.c target/hosted/aigo/debug-erosq.c target/hosted/aigo/power-erosq.c target/hosted/aigo/powermgmt-erosq.c +target/hosted/aigo/erosqlinux_codec.c #endif #if defined(SAMSUNG_YPR0) && !defined(SIMULATOR) @@ -549,40 +558,21 @@ drivers/audio/es9018.c drivers/audio/es9218.c #endif /* defined(HAVE_*) */ #else /* PLATFORM_HOSTED */ -#if defined(SAMSUNG_YPR0) && defined(HAVE_AS3514) +#if defined(HAVE_AS3514) drivers/audio/as3514.c -target/hosted/pcm-alsa.c -#elif defined(SAMSUNG_YPR1) && defined(HAVE_WM8978) +#elif defined(HAVE_WM8978) drivers/audio/wm8978.c -target/hosted/pcm-alsa.c -#elif defined(HAVE_NWZ_LINUX_CODEC) -drivers/audio/nwzlinux-codec.c -target/hosted/alsa-controls.c -target/hosted/pcm-alsa.c -#elif defined(HAVE_ROCKER_CODEC) && !defined(SIMULATOR) -drivers/audio/rocker_codec.c -#elif defined(HAVE_SURFANS_LINUX_CODEC) && !defined(SIMULATOR) -drivers/audio/surfanslinux_codec.c -#elif defined(HAVE_XDUOO_LINUX_CODEC) && !defined(SIMULATOR) -drivers/audio/xduoolinux_codec.c -#elif defined(HAVE_FIIO_LINUX_CODEC) && !defined(SIMULATOR) -drivers/audio/fiiolinux_codec.c -#elif defined(HAVE_EROSQ_LINUX_CODEC) && !defined(SIMULATOR) -drivers/audio/erosqlinux_codec.c #elif defined(HAVE_SDL_AUDIO) drivers/audio/sdl.c - #if (CONFIG_PLATFORM & PLATFORM_MAEMO5) target/hosted/maemo/pcm-gstreamer.c #else target/hosted/sdl/pcm-sdl.c #endif /* (CONFIG_PLATFORM & PLATFORM_MAEMO) */ - #elif defined(CTRU) drivers/audio/ctru.c #endif #endif /* (CONFIG_PLATFORM & PLATFORM_NATIVE) */ - #endif /* !defined(BOOTLOADER) */ /* build erosqn codec in bootloader for detection */ @@ -2034,10 +2024,10 @@ target/hosted/android/pcm-android.c target/hosted/android/powermgmt-android.c target/hosted/android/system-android.c target/hosted/android/telephony-android.c +target/hosted/android/android-codec.c #ifdef APPLICATION target/hosted/android/app/button-application.c #endif -drivers/audio/android.c #endif #if defined(DX50) || defined(DX90) diff --git a/firmware/export/audiohw.h b/firmware/export/audiohw.h index 98f0857daf..9f79a881b6 100644 --- a/firmware/export/audiohw.h +++ b/firmware/export/audiohw.h @@ -223,9 +223,10 @@ struct sound_settings_info #include "es9018.h" #elif defined(HAVE_ES9218) #include "es9218.h" -#elif ((CONFIG_PLATFORM & (PLATFORM_ANDROID | PLATFORM_MAEMO \ - | PLATFORM_PANDORA | PLATFORM_SDL | PLATFORM_CTRU)) | defined(RG_NANO)) -#include "hosted_codec.h" +#elif (CONFIG_PLATFORM & PLATFORM_ANDROID) +#include "android_codec.h" +#elif ((CONFIG_PLATFORM & (PLATFORM_MAEMO | PLATFORM_PANDORA | PLATFORM_SDL | PLATFORM_CTRU)) | defined(RG_NANO)) +#include "sdl_codec.h" #elif defined(DX50) #include "codec-dx50.h" #elif defined(DX90) diff --git a/firmware/drivers/audio/rocker_codec.c b/firmware/target/hosted/agptek/rocker_codec.c similarity index 100% rename from firmware/drivers/audio/rocker_codec.c rename to firmware/target/hosted/agptek/rocker_codec.c diff --git a/firmware/export/rocker_codec.h b/firmware/target/hosted/agptek/rocker_codec.h similarity index 100% rename from firmware/export/rocker_codec.h rename to firmware/target/hosted/agptek/rocker_codec.h diff --git a/firmware/drivers/audio/erosqlinux_codec.c b/firmware/target/hosted/aigo/erosqlinux_codec.c similarity index 100% rename from firmware/drivers/audio/erosqlinux_codec.c rename to firmware/target/hosted/aigo/erosqlinux_codec.c diff --git a/firmware/export/erosqlinux_codec.h b/firmware/target/hosted/aigo/erosqlinux_codec.h similarity index 100% rename from firmware/export/erosqlinux_codec.h rename to firmware/target/hosted/aigo/erosqlinux_codec.h diff --git a/firmware/drivers/audio/android.c b/firmware/target/hosted/android/android-codec.c similarity index 93% rename from firmware/drivers/audio/android.c rename to firmware/target/hosted/android/android-codec.c index 7a5f34ea48..d2c650f348 100644 --- a/firmware/drivers/audio/android.c +++ b/firmware/target/hosted/android/android-codec.c @@ -22,10 +22,10 @@ #include "config.h" #include "audiohw.h" +#include "pcm-android.h" void audiohw_set_volume(int volume) { - extern void pcm_set_mixer_volume(int); pcm_set_mixer_volume(volume); } @@ -36,6 +36,5 @@ void audiohw_set_balance(int balance) void audiohw_close(void) { - extern void pcm_shutdown(void); pcm_shutdown(); } diff --git a/firmware/export/hosted_codec.h b/firmware/target/hosted/android/android_codec.h similarity index 76% rename from firmware/export/hosted_codec.h rename to firmware/target/hosted/android/android_codec.h index 1a689c534b..a68faae848 100644 --- a/firmware/export/hosted_codec.h +++ b/firmware/target/hosted/android/android_codec.h @@ -18,19 +18,9 @@ * KIND, either express or implied. * ****************************************************************************/ -#ifndef HOSTED_CODEC_H -#define HOSTED_CODEC_H +#ifndef __ANDROID_CODEC_H +#define __ANDROID_CODEC_H -#if (defined(HAVE_SDL_AUDIO) \ - && !(CONFIG_PLATFORM & PLATFORM_MAEMO5)) \ - || (CONFIG_PLATFORM & PLATFORM_CTRU) -AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -80, 0, 0) -#else -#define AUDIOHW_CAPS (MONO_VOL_CAP) -AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -99, 0, 0) -#endif /* CONFIG_PLATFORM & PLATFORM_SDL */ - -#if (CONFIG_PLATFORM & PLATFORM_ANDROID) /* Bass and treble tone controls */ #ifdef AUDIOHW_HAVE_BASS AUDIOHW_SETTING(BASS, "dB", 0, 1, -24, 24, 0) @@ -49,6 +39,5 @@ AUDIOHW_SETTING(BASS_CUTOFF, "", 0, 1, 1, 4, 1) #if defined(AUDIOHW_HAVE_TREBLE_CUTOFF) AUDIOHW_SETTING(TREBLE_CUTOFF, "", 0, 1, 1, 4, 1) #endif -#endif /* CONFIG_PLATFORM & PLATFORM_ANDROID */ -#endif /* HOSTED_CODEC_H */ +#endif /* __ANDROID_CODEC_H */ diff --git a/firmware/target/hosted/android/pcm-android.h b/firmware/target/hosted/android/pcm-android.h new file mode 100644 index 0000000000..39d7308df7 --- /dev/null +++ b/firmware/target/hosted/android/pcm-android.h @@ -0,0 +1,7 @@ +#ifndef __PCM_ANDROID_H +#define __PCM_ANDROID_H + +void pcm_set_mixer_volume(int volume); +void pcm_shutdown(void); + +#endif /* __PCM_ANDROID_H */ diff --git a/firmware/drivers/audio/fiiolinux_codec.c b/firmware/target/hosted/fiio/fiiolinux_codec.c similarity index 100% rename from firmware/drivers/audio/fiiolinux_codec.c rename to firmware/target/hosted/fiio/fiiolinux_codec.c diff --git a/firmware/export/fiiolinux_codec.h b/firmware/target/hosted/fiio/fiiolinux_codec.h similarity index 100% rename from firmware/export/fiiolinux_codec.h rename to firmware/target/hosted/fiio/fiiolinux_codec.h diff --git a/firmware/export/codec-dx50.h b/firmware/target/hosted/ibasso/dx50/codec-dx50.h similarity index 100% rename from firmware/export/codec-dx50.h rename to firmware/target/hosted/ibasso/dx50/codec-dx50.h diff --git a/firmware/export/codec-dx90.h b/firmware/target/hosted/ibasso/dx90/codec-dx90.h similarity index 100% rename from firmware/export/codec-dx90.h rename to firmware/target/hosted/ibasso/dx90/codec-dx90.h diff --git a/firmware/target/hosted/sdl/sdl_codec.h b/firmware/target/hosted/sdl/sdl_codec.h new file mode 100644 index 0000000000..b5c1d81374 --- /dev/null +++ b/firmware/target/hosted/sdl/sdl_codec.h @@ -0,0 +1,33 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2010 by Thomas Martitz + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifndef _SDL_CODEC_H +#define _SDL_CODEC_H + +#if (defined(HAVE_SDL_AUDIO) \ + && !(CONFIG_PLATFORM & PLATFORM_MAEMO5)) \ + || (CONFIG_PLATFORM & PLATFORM_CTRU) +AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -80, 0, 0) +#else +#define AUDIOHW_CAPS (MONO_VOL_CAP) +AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -99, 0, 0) +#endif /* CONFIG_PLATFORM & PLATFORM_SDL */ + +#endif /* _SDL_CODEC_H */ diff --git a/firmware/drivers/audio/nwzlinux-codec.c b/firmware/target/hosted/sonynwz/nwzlinux-codec.c similarity index 100% rename from firmware/drivers/audio/nwzlinux-codec.c rename to firmware/target/hosted/sonynwz/nwzlinux-codec.c diff --git a/firmware/export/nwzlinux_codec.h b/firmware/target/hosted/sonynwz/nwzlinux_codec.h similarity index 100% rename from firmware/export/nwzlinux_codec.h rename to firmware/target/hosted/sonynwz/nwzlinux_codec.h diff --git a/firmware/drivers/audio/surfanslinux_codec.c b/firmware/target/hosted/surfans/surfanslinux_codec.c similarity index 100% rename from firmware/drivers/audio/surfanslinux_codec.c rename to firmware/target/hosted/surfans/surfanslinux_codec.c diff --git a/firmware/export/surfanslinux_codec.h b/firmware/target/hosted/surfans/surfanslinux_codec.h similarity index 100% rename from firmware/export/surfanslinux_codec.h rename to firmware/target/hosted/surfans/surfanslinux_codec.h diff --git a/firmware/drivers/audio/xduoolinux_codec.c b/firmware/target/hosted/xduoo/xduoolinux_codec.c similarity index 100% rename from firmware/drivers/audio/xduoolinux_codec.c rename to firmware/target/hosted/xduoo/xduoolinux_codec.c diff --git a/firmware/export/xduoolinux_codec.h b/firmware/target/hosted/xduoo/xduoolinux_codec.h similarity index 100% rename from firmware/export/xduoolinux_codec.h rename to firmware/target/hosted/xduoo/xduoolinux_codec.h