summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/SOURCES3
-rw-r--r--apps/id3.h (renamed from firmware/export/id3.h)0
-rw-r--r--apps/mpeg.c25
-rw-r--r--apps/mpeg.h (renamed from firmware/export/mpeg.h)0
-rw-r--r--apps/recorder/pcm_record.c (renamed from firmware/pcm_record.c)1
-rw-r--r--apps/recorder/pcm_record.h (renamed from firmware/export/pcm_record.h)0
-rw-r--r--apps/recorder/recording.c1
-rw-r--r--apps/replaygain.h (renamed from firmware/export/replaygain.h)0
-rw-r--r--firmware/SOURCES3
-rw-r--r--firmware/drivers/mas.c17
-rw-r--r--firmware/drivers/tuner/s1a0903x01.c3
-rw-r--r--firmware/export/audio.h2
-rw-r--r--firmware/export/mas.h6
-rw-r--r--firmware/mp3_playback.c5
-rw-r--r--firmware/powermgmt.c3
15 files changed, 42 insertions, 27 deletions
diff --git a/apps/SOURCES b/apps/SOURCES
index 7622b416f7..3fce356092 100644
--- a/apps/SOURCES
+++ b/apps/SOURCES
@@ -116,6 +116,9 @@ codecs.c
116dsp.c 116dsp.c
117#ifdef HAVE_RECORDING 117#ifdef HAVE_RECORDING
118enc_config.c 118enc_config.c
119#ifndef SIMULATOR
120recorder/pcm_record.c
121#endif /* SIMULATOR */
119#endif 122#endif
120eq.c 123eq.c
121#if defined(CPU_COLDFIRE) 124#if defined(CPU_COLDFIRE)
diff --git a/firmware/export/id3.h b/apps/id3.h
index da2faf1b12..da2faf1b12 100644
--- a/firmware/export/id3.h
+++ b/apps/id3.h
diff --git a/apps/mpeg.c b/apps/mpeg.c
index 2c65e46060..b570f41b28 100644
--- a/apps/mpeg.c
+++ b/apps/mpeg.c
@@ -2432,6 +2432,15 @@ void audio_set_recording_options(struct audio_recording_options *options)
2432 2432
2433 DEBUGF("mas_writemem(MAS_BANK_D0, ENCODER_CONTROL, %x)\n", shadow_encoder_control); 2433 DEBUGF("mas_writemem(MAS_BANK_D0, ENCODER_CONTROL, %x)\n", shadow_encoder_control);
2434 2434
2435#if CONFIG_TUNER & S1A0903X01
2436 /* Store the (unpitched) MAS PLL frequency. Used for avoiding FM
2437 interference with the Samsung tuner. */
2438 if (rec_frequency_index)
2439 mas_store_pllfreq(24576000);
2440 else
2441 mas_store_pllfreq(22579000);
2442#endif
2443
2435 shadow_soft_mute = options->rec_editable?4:0; 2444 shadow_soft_mute = options->rec_editable?4:0;
2436 mas_writemem(MAS_BANK_D0, MAS_D0_SOFT_MUTE, &shadow_soft_mute,1); 2445 mas_writemem(MAS_BANK_D0, MAS_D0_SOFT_MUTE, &shadow_soft_mute,1);
2437 2446
@@ -2484,22 +2493,6 @@ void audio_set_recording_gain(int left, int right, int type)
2484 mas_codec_writereg(0x0, shadow_codec_reg0); 2493 mas_codec_writereg(0x0, shadow_codec_reg0);
2485} 2494}
2486 2495
2487#if CONFIG_TUNER & S1A0903X01
2488/* Get the (unpitched) MAS PLL frequency, for avoiding FM interference with the
2489 * Samsung tuner. Zero means unknown. Currently handles recording from analog
2490 * input only. */
2491int mpeg_get_mas_pllfreq(void)
2492{
2493 if (mpeg_mode != MPEG_ENCODER)
2494 return 0;
2495
2496 if (rec_frequency_index == 0) /* 44.1 kHz / 22.05 kHz */
2497 return 22579000;
2498 else
2499 return 24576000;
2500}
2501#endif /* CONFIG_TUNER & S1A0903X01 */
2502
2503/* try to make some kind of beep, also in recording mode */ 2496/* try to make some kind of beep, also in recording mode */
2504void audio_beep(int duration) 2497void audio_beep(int duration)
2505{ 2498{
diff --git a/firmware/export/mpeg.h b/apps/mpeg.h
index ce2cff0069..ce2cff0069 100644
--- a/firmware/export/mpeg.h
+++ b/apps/mpeg.h
diff --git a/firmware/pcm_record.c b/apps/recorder/pcm_record.c
index 0e0102af97..b1ea535470 100644
--- a/firmware/pcm_record.c
+++ b/apps/recorder/pcm_record.c
@@ -18,6 +18,7 @@
18 * KIND, either express or implied. 18 * KIND, either express or implied.
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "pcm_record.h"
21#include "system.h" 22#include "system.h"
22#include "kernel.h" 23#include "kernel.h"
23#include "logf.h" 24#include "logf.h"
diff --git a/firmware/export/pcm_record.h b/apps/recorder/pcm_record.h
index f805313fe5..f805313fe5 100644
--- a/firmware/export/pcm_record.h
+++ b/apps/recorder/pcm_record.h
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index 6f5c7df09a..d29db390c7 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -40,6 +40,7 @@
40#include "spdif.h" 40#include "spdif.h"
41#endif 41#endif
42#endif /* CONFIG_CODEC == SWCODEC */ 42#endif /* CONFIG_CODEC == SWCODEC */
43#include "pcm_record.h"
43#include "recording.h" 44#include "recording.h"
44#include "mp3_playback.h" 45#include "mp3_playback.h"
45#include "mas.h" 46#include "mas.h"
diff --git a/firmware/export/replaygain.h b/apps/replaygain.h
index dbc079b1d3..dbc079b1d3 100644
--- a/firmware/export/replaygain.h
+++ b/apps/replaygain.h
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 9f7007245d..2cd1ba131c 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -191,9 +191,6 @@ pcm_sampr.c
191pcm.c 191pcm.c
192#ifdef HAVE_RECORDING 192#ifdef HAVE_RECORDING
193enc_base.c 193enc_base.c
194#ifndef SIMULATOR
195pcm_record.c
196#endif /* SIMULATOR */
197#endif /* HAVE_RECORDING */ 194#endif /* HAVE_RECORDING */
198#endif /* BOOTLOADER */ 195#endif /* BOOTLOADER */
199 196
diff --git a/firmware/drivers/mas.c b/firmware/drivers/mas.c
index 9d1761b419..4f384d3b98 100644
--- a/firmware/drivers/mas.c
+++ b/firmware/drivers/mas.c
@@ -466,3 +466,20 @@ unsigned long mas_readver(void)
466} 466}
467 467
468#endif 468#endif
469
470#if CONFIG_TUNER & S1A0903X01
471static int pllfreq;
472
473void mas_store_pllfreq(int freq)
474{
475 pllfreq = freq;
476}
477
478int mas_get_pllfreq(void)
479{
480 return pllfreq;
481}
482#endif
483
484
485
diff --git a/firmware/drivers/tuner/s1a0903x01.c b/firmware/drivers/tuner/s1a0903x01.c
index 517d41984d..f6442b269f 100644
--- a/firmware/drivers/tuner/s1a0903x01.c
+++ b/firmware/drivers/tuner/s1a0903x01.c
@@ -26,7 +26,6 @@
26#include "kernel.h" 26#include "kernel.h"
27#include "tuner.h" /* tuner abstraction interface */ 27#include "tuner.h" /* tuner abstraction interface */
28#include "fmradio.h" /* physical interface driver */ 28#include "fmradio.h" /* physical interface driver */
29#include "mpeg.h"
30#include "sound.h" 29#include "sound.h"
31 30
32#define DEFAULT_IN1 0x100003 /* Mute */ 31#define DEFAULT_IN1 0x100003 /* Mute */
@@ -64,7 +63,7 @@ int s1a0903x01_set(int setting, int value)
64 int pitch = 1000; 63 int pitch = 1000;
65 64
66 /* 4th harmonic falls in the FM frequency range */ 65 /* 4th harmonic falls in the FM frequency range */
67 int if_freq = 4 * mpeg_get_mas_pllfreq(); 66 int if_freq = 4 * mas_get_pllfreq();
68 67
69 /* shift the mas harmonic >= 300 kHz away using the direction 68 /* shift the mas harmonic >= 300 kHz away using the direction
70 * which needs less shifting. */ 69 * which needs less shifting. */
diff --git a/firmware/export/audio.h b/firmware/export/audio.h
index 9530082050..661247df2f 100644
--- a/firmware/export/audio.h
+++ b/firmware/export/audio.h
@@ -30,8 +30,6 @@
30#include "pcm_sampr.h" 30#include "pcm_sampr.h"
31#include "pcm.h" 31#include "pcm.h"
32#ifdef HAVE_RECORDING 32#ifdef HAVE_RECORDING
33#include "pcm_record.h"
34#include "id3.h"
35#include "enc_base.h" 33#include "enc_base.h"
36#endif /* HAVE_RECORDING */ 34#endif /* HAVE_RECORDING */
37#endif /* CONFIG_CODEC == SWCODEC */ 35#endif /* CONFIG_CODEC == SWCODEC */
diff --git a/firmware/export/mas.h b/firmware/export/mas.h
index ab6135cbfa..493ed6a63c 100644
--- a/firmware/export/mas.h
+++ b/firmware/export/mas.h
@@ -163,3 +163,9 @@ int mas_codec_readreg(int reg);
163unsigned long mas_readver(void); 163unsigned long mas_readver(void);
164 164
165#endif 165#endif
166
167#if CONFIG_TUNER & S1A0903X01
168void mas_store_pllfreq(int freq);
169int mas_get_pllfreq(void);
170#endif
171
diff --git a/firmware/mp3_playback.c b/firmware/mp3_playback.c
index 66ea3159e3..2bbd08d789 100644
--- a/firmware/mp3_playback.c
+++ b/firmware/mp3_playback.c
@@ -26,7 +26,6 @@
26#include "debug.h" 26#include "debug.h"
27#include "panic.h" 27#include "panic.h"
28#include <kernel.h> 28#include <kernel.h>
29#include "mpeg.h" /* ToDo: remove crosslinks */
30#include "mp3_playback.h" 29#include "mp3_playback.h"
31#include "sound.h" 30#include "sound.h"
32#ifndef SIMULATOR 31#ifndef SIMULATOR
@@ -76,6 +75,10 @@ bool audio_is_initialized = false;
76 75
77/* FIX: this code pretty much assumes a MAS */ 76/* FIX: this code pretty much assumes a MAS */
78 77
78/* dirty calls to mpeg.c */
79extern void playback_tick(void);
80extern void rec_tick(void);
81
79#ifndef SIMULATOR 82#ifndef SIMULATOR
80 83
81unsigned long mas_version_code; 84unsigned long mas_version_code;
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index f0fbd7df92..86fadff2a2 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -46,9 +46,6 @@
46#ifdef HAVE_LCD_BITMAP 46#ifdef HAVE_LCD_BITMAP
47#include "font.h" 47#include "font.h"
48#endif 48#endif
49#if defined(HAVE_RECORDING) && (CONFIG_CODEC == SWCODEC)
50#include "pcm_record.h"
51#endif
52#include "logf.h" 49#include "logf.h"
53#include "lcd-remote.h" 50#include "lcd-remote.h"
54#ifdef SIMULATOR 51#ifdef SIMULATOR