forked from len0rd/rockbox
WAV recording plugin: Fix distortion when feeding a full-range digital signal (most noticeable from S/PDIF), and make it obvious that S/PDIF recording ignores the defined sample rate.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13435 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
0671cee53a
commit
e09b87a31f
1 changed files with 10 additions and 4 deletions
|
@ -3524,8 +3524,6 @@ static int record_file(char *filename)
|
||||||
rb->lcd_puts(0, 0, filename);
|
rb->lcd_puts(0, 0, filename);
|
||||||
rb->snprintf(buf, sizeof(buf), "%sHz 16bit %s",
|
rb->snprintf(buf, sizeof(buf), "%sHz 16bit %s",
|
||||||
samplerate_str[reccfg.samplerate], channel_str[reccfg.channels]);
|
samplerate_str[reccfg.samplerate], channel_str[reccfg.channels]);
|
||||||
rb->lcd_puts(0, 1, buf);
|
|
||||||
rb->lcd_update();
|
|
||||||
|
|
||||||
switch (reccfg.source)
|
switch (reccfg.source)
|
||||||
{
|
{
|
||||||
|
@ -3545,9 +3543,13 @@ static int record_file(char *filename)
|
||||||
#ifdef HAVE_SPDIF_IN
|
#ifdef HAVE_SPDIF_IN
|
||||||
case SRC_SPDIF:
|
case SRC_SPDIF:
|
||||||
rb->mas_codec_writereg(0, 0x01);
|
rb->mas_codec_writereg(0, 0x01);
|
||||||
|
rb->snprintf(buf, sizeof(buf), "16bit %s",
|
||||||
|
channel_str[reccfg.channels]);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
rb->lcd_puts(0, 1, buf);
|
||||||
|
rb->lcd_update();
|
||||||
|
|
||||||
mas = 0x0060 /* no framing, little endian */
|
mas = 0x0060 /* no framing, little endian */
|
||||||
| ((reccfg.channels == 0) ? 0x10 : 0) /* mono/stereo */
|
| ((reccfg.channels == 0) ? 0x10 : 0) /* mono/stereo */
|
||||||
|
@ -3569,6 +3571,10 @@ static int record_file(char *filename)
|
||||||
mas = 0x2125; /* recording, ADC input, validate */
|
mas = 0x2125; /* recording, ADC input, validate */
|
||||||
rb->mas_writemem(MAS_BANK_D0, PCM_MAIN_IO_CONTROL, &mas, 1);
|
rb->mas_writemem(MAS_BANK_D0, PCM_MAIN_IO_CONTROL, &mas, 1);
|
||||||
|
|
||||||
|
mas = 0x80001; /* avoid distortion (overflow on full-range input samples) */
|
||||||
|
rb->mas_writemem(MAS_BANK_D0, PCM_VOL_IN_LL, &mas, 1); /* LL */
|
||||||
|
rb->mas_writemem(MAS_BANK_D0, PCM_VOL_IN_RR, &mas, 1); /* RR */
|
||||||
|
|
||||||
hijack_interrupts(true);
|
hijack_interrupts(true);
|
||||||
rec_tick_enable(true);
|
rec_tick_enable(true);
|
||||||
recording = true;
|
recording = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue