Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Audio Playback, Database and Playlists
| | |-+  Toggle playback sample rate iriver H100 H300?
« previous next »
  • Print
Pages: [1]

Author Topic: Toggle playback sample rate iriver H100 H300?  (Read 3551 times)

Offline Julian67

  • Member
  • *
  • Posts: 116
Toggle playback sample rate iriver H100 H300?
« on: July 19, 2013, 09:59:35 PM »
I noticed that on my Clip+ current git versions of Rockbox allow me to toggle the playback sample rate between 44100 and 48000 Hz so avoiding using a sample rate converter.   The hardware in my iRiver H140 and H340 also supports 48000 Hz sample rate and the original firmware apparently plays either 44100 or 48000 without rate conversion.  Is the ability to toggle the supported playback sample rate coming to the iRiver port?
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8963
Re: Toggle playback sample rate iriver H100 H300?
« Reply #1 on: July 19, 2013, 10:31:08 PM »
The H100/H300 doesn't support 48k as far as I know, so that option isn't possible.
Logged

Offline Julian67

  • Member
  • *
  • Posts: 116
Re: Toggle playback sample rate iriver H100 H300?
« Reply #2 on: July 19, 2013, 11:05:41 PM »
The hardware datasheet for the Philips UDA1380 states:

Quote
Supports sample frequencies from 8 to 55 kHz for the
ADC part, and 8 to 100 kHz for the DAC part. The ADC
does not support DVD audio (96 kHz audio), only
Mini-Disc (MD), Compact-Disc (CD) and Moving Picture
Experts Group Layer-3 Audio (MP3). For playback
8 to 100 kHz is specified. DVD playback is supported.

In fact the datasheet offers most of its specs for 48 KHz audio.  My H140 no longer has iRiver firmware but I have the manual in pdf form.  It contains the following:

On the section on recording (page 34 of paper manual):

Quote
When saving as WAV file, the Bitrate generally is 1411Kbps.
(44.1 KHz, 16Bit, Stereo)
When saving the optical signal with 48KHz as WAV file,
the Bitrate is 1536Kbps. (48 KHz, 16Bit, Stereo)

and

Quote
Optical recording can sample at 44.1KHz or 48KHz.

On page 2 of the paper manual, section Unique Features:

Quote
Multi-Codec Player
Supports MP3, Ogg Vorbis, WMA, ASF, and WAV formats as a multi-Codec
player.
The H140 supports WAV types of 11/22/44/48KHz, 16bit, Mono/Stereo.

So it seems the hardware does support 48000 for playback and recording.

edit: also on the H340 if I play a 48 KHz wav file in original firmware the OF's WPS displays at the bottom of the screen "codec" "rate" "bitrate", for example "WAV" "48KHz" "1536K".  Judging by my always reliable tin ear I don't believe there is any sample rate conversion, and the on screen indicators are a true indication of what is being ouput (not some trick reference to a pre-conversion state).

« Last Edit: July 20, 2013, 12:14:08 AM by Julian67 »
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8963
Re: Toggle playback sample rate iriver H100 H300?
« Reply #3 on: July 20, 2013, 02:29:00 AM »
The DAC supports it but as far as I know the player does not.  Playback of 48k files is normal they're just trampled.
Logged

Offline Julian67

  • Member
  • *
  • Posts: 116
Re: Toggle playback sample rate iriver H100 H300?
« Reply #4 on: July 20, 2013, 09:14:14 AM »
Quote from: saratoga on July 20, 2013, 02:29:00 AM
The DAC supports it but as far as I know the player does not.  Playback of 48k files is normal they're just trampled.

This "trampling" doesn't seem to be the case.  I performed a practical test/demonstration to check:

I made two 10000 Hz test tones, one 44100 and the other 48000.  I chose 10000 Hz because it is very easy to hear and also because sample rate conversion of a 10000 Hz tone produces clear audible difference in pitch even with high quality resampler such as SRC best or SoX.  With medium or low quality rate conversion the differences are gross.

I used sox to make the test tones like so:

Code: [Select]
sox -n -b 16 -c2 -r44100 44_10000.wav synth 30 sine 10000 dither -s

sox -n -b 16 -c2 -r48000 48_10000.wav synth 30 sine 10000 dither -s

When I play the two files on my H340 with iRiver firmware each file sounds absolutely identical.  The only way to detect a difference is by checking the on-screen status indicators for sample rate and bit rate.

Next I boot my H340 to Rockbox daily build of July 18.

The 44100 file sounds normal (just like in iRiver firmware or like on my desktop SPDIF>receiver)  but the 48000 file's tone is completely different.

By comparison on my PC if I play the two files SPDIF>Home Theatre Receiver they sound identical.  If I use the PC's system sample rate converter (SRC at best quality, default rate 44100) there is a difference in tone.  If I set my system rate converter to linear at 44100 the 48000 file now produces a tone like the rate converter in Rockbox.

So to me it looks like:

The hardware definitely supports 48000 KHz files without rate conversion both for playback and recording.

The manufacturer states the device supports 48000 KHz files, implicitly without rate conversion for playback, explicitly so for recording.

44100 and 48000 Hz tones sound absolutely identical in iRiver H340 with iRiver firmware, which is not the case with even very high quality sample rate converters available for PC.

It's not likely that iRiver devised the world's best sample rate converter but kept silent about it, instead deciding to misreport sample rate and bit rate on the display.

Conclusion: the H340 (and implicitly the H140) does support 48000 KHz playback without sample rate conversion.
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8963
Re: Toggle playback sample rate iriver H100 H300?
« Reply #5 on: July 20, 2013, 12:22:58 PM »
The sample rate test does not do what you think it does, but by all means if I'm remembering wrong feel free to figure out how to clock the device at 48k.
Logged

Offline Julian67

  • Member
  • *
  • Posts: 116
Re: Toggle playback sample rate iriver H100 H300?
« Reply #6 on: July 20, 2013, 03:09:35 PM »
Quote from: saratoga on July 20, 2013, 12:22:58 PM
The sample rate test does not do what you think it does, but by all means if I'm remembering wrong feel free to figure out how to clock the device at 48k.

I'm a user asking a question on a support forum so it hardly seems reasonable to offer zero information and instead respond by "inviting" me to figure out how to clock the device.

Saying "such and such does not do what you think it does" doesn't resolve any question or issue.  One person's "insight" into what another person is supposedly thinking doesn't address anything of the questions posed or points raised.

I'll try again, hoping for an informative response:

The H140 manual states on page 34:
Quote
When saving the optical signal with 48KHz as WAV file,
the Bitrate is 1536Kbps. (48 KHz, 16Bit, Stereo)

The H140 manual on page 35 states:
Quote
Optical recording can sample at 44.1KHz or 48KHz.

On page 2 (referring to play back):
Quote
The H140 supports WAV types of 11/22/44/48KHz, 16bit, Mono/Stereo.

I have just checked with a 22050 Hz sample rate 10000 Hz tone and again this plays back without any sign of sample rate conversion and with the OF's display  indicating "22KHz" sample rate and "705K" bit rate.

In the OF the 10000 Hz test tones at sample rates 22050, 44100 and 48000 Hz all play back at identical pitch.  In contrast in Rockbox (as with any device using sample rate conversion) each file plays back with clearly different pitch.

The capability to play audio at various sample rates is supported by the codec hardware data sheet, by the specs offered by the device manufacturer, and by the device manufacturer's user manual.  In practice the H300 with original firmware does indeed play back 22050 Hz, 44100 Hz and 48000 Hz wav files as claimed in the documentation, which is to say without any sign of sample rate conversion.

It's unclear why playing back the test tones of different sample rates and noting what the device indicates, if the pitch changes, and how this compares to device specification and also other known hardware (with and without sample rate conversion) is held to be an exercise of no value.  It seems to demonstrate that either iRiver made the best ever sample rate converter or that the device plays back wav files of supported rates exactly as claimed and indicated.  If it doesn't demonstrate this then what is the error in the method?

How is it possible to assert that the device is can't support 48 KHz audio files without sample rate conversion?



Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8963
Re: Toggle playback sample rate iriver H100 H300?
« Reply #7 on: July 20, 2013, 04:07:53 PM »
Quote from: Julian67 on July 20, 2013, 03:09:35 PM
I'm a user asking a question on a support forum so it hardly seems reasonable to offer zero information and instead respond by "inviting" me to figure out how to clock the device.

And I answered you:

'The H100/H300 doesn't support 48k as far as I know, so that option isn't possible.'

If you don't agree, then you get to figure it out yourself or hope that someone else does for you.

Quote from: Julian67 on July 20, 2013, 03:09:35 PM
In the OF the 10000 Hz test tones at sample rates 22050, 44100 and 48000 Hz all play back at identical pitch.  In contrast in Rockbox (as with any device using sample rate conversion) each file plays back with clearly different pitch.

Well resampling doesn't change the pitch (by definition, resampling is the process of changing sampling rate without changing pitch).  So I have no idea what you're doing or what those results mean, but its definitely not what you think it is. 
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8963
Re: Toggle playback sample rate iriver H100 H300?
« Reply #8 on: July 20, 2013, 04:31:16 PM »
I searched and found this:

Quote
amiconn   kugel (Buschel, saratoga - logs): There are several stable targets which don't support 48kHz, e.g. *all* the coldfire targets only support 44.1/22.05/11.025 (and some of them 88.2)
11:44   amiconn   Supporting (96/64)/48/32/24/16/12/8 on those targets would require a different base clock xtal - and then they wouldn't support 44.1 & related rates
...
12:22   kugel   amiconn: could you possibly switch between the modes?

12:27   amiconn   kugel: You can switch between (88.2)/44.1/22.05/11.025.
12:28   amiconn   Different xtal for the base clock offering the other sample rates means soldering
...
12:30   amiconn   This is a limitation of the audio clock generation in the MCF5249 and MCF5250
...
12:32   amiconn   *Iiuc* it could be solved if the dac would be clock master, but since the targets aren't designed that way, this isn't possible either
12:32   amiconn   Audio clock master I mean
12:34   amiconn   This is why the H1x0 can record non-44.1 S/PDIF natively (and pass it through), but not record analog signals or play back at that rate.
12:35   amiconn   In case of s/pdif recording the input is audio clock master

http://www.rockbox.org/irc/log-20120929#11:43:05

So it looks like you can do 48k if you're willing to solder a new crystal to the board, but otherwise you have to resample. 
Logged

Offline Julian67

  • Member
  • *
  • Posts: 116
Re: Toggle playback sample rate iriver H100 H300?
« Reply #9 on: July 20, 2013, 05:29:43 PM »
Thank you for your very informative reply.

I can demonstrate that low quality sample rate conversion does change pitch.  It does so by introducing tones which were not originally present so while the new file does still contain the tone at the original frequency it now also has other tones.  Result:  the pitch is measurably and audibly different.

Example: source file is 2 channel 16-bit 48KHz file of a 10000 Hz tone.



Convert to 22050 sample rate using low quality (linear interpolator) conversion:
Code: [Select]
sndfile-resample -to 22050 -c 4 48_10000.wav linear.wav
Result:



Listening to the sample rate converted file it has a very obviously lower pitch exactly as suggested by the spectrogram.  That is of course a crude example for the purpose of illustration but the difference in sound is practically identical as when toggling between a 44.1KHz and 48KH file on my Rockboxed H140 or H340.  One can hear similar tonal differences with most sample rate conversions except the good quality ones at medium and high quality settings.

It doesn't seem likely that iRiver found a way to run a highly demanding good quality SRC on the H340 as the processing power limitation is exactly the same as for Rockbox, so reason suggests they must also be using something like a linear interpolator, as found as default in most PC operating systems and portable audio players. But the original firmware on my H340 can render 22050, 44100 and 48000 Hz files apparently as perfectly as if no rate conversion has taken place, or as though there has been, in real time, extremely high quality conversion that would tax even a processor several times more powerful.  If the info from the chat logs above is accurate then how is this possible?  Or maybe the H100 and H300 CPUs are not as identical as it appears?

Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8963
Re: Toggle playback sample rate iriver H100 H300?
« Reply #10 on: July 20, 2013, 05:44:37 PM »
Bad resampling introduces distortion, but generally preserves pitch.   You can see that in the images you posted where the 10khz tone continues to be 10khz. 

Its not generally possible to determine that audio is not being resampled by listening to it, so my assumption would be that they're also resampling.  You're welcome to investigate this however. 
Logged

Offline Julian67

  • Member
  • *
  • Posts: 116
Re: Toggle playback sample rate iriver H100 H300?
« Reply #11 on: July 20, 2013, 07:53:52 PM »
Yes, I did note that the original 10000 Hz tone is still present but also that other audible tones are introduced (the distortion you mention) so the overall pitch is not preserved.  The difference is as easy to hear as it is to see in those images.

So accepting that that the iRiver original firmware is performing SRC (because the hardware is incapable of supporting 48KHz due to the XTAL rate) then Rockbox's sample rate converter is performing much worse than the OF's.  Playing back non-44.1KHz files in Rockbox introduces tonal change while no such change is heard when using the OF.  But I can't help feeling almost totally sceptical that iRiver over ten years ago achieved on very low power devices the kind of high quality SRC that would have been too demanding to be practical on most desktop CPUs of the time.

What looks more likely is that Rockbox's (linear?) SRC is performing much the same as any other default (bad but fast and it will work) SRC as found on any number of devices and operating systems, while iRiver OF is playing back at native sample rates exactly as claimed.  As you can tell I'm no engineer but this second scenario seems normal while the first requires iRiver to have achieved something extraordinary, still unmatched by anyone else, for this to have passed completely unnoticed, and for them to have decided to mislead their users for several years instead of exploiting their potentially lucrative miracle breakthrough.
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8963
Re: Toggle playback sample rate iriver H100 H300?
« Reply #12 on: July 21, 2013, 03:11:30 PM »
Newer versions of Rockbox actually use cubic hermite rather than linear.

Removing aliasing from high frequency pure tones when resampling is actually quite easy/fast.  I didn't bother implementing it yet because it doesn't help with real music. 
Logged

Offline Julian67

  • Member
  • *
  • Posts: 116
Re: Toggle playback sample rate iriver H100 H300?
« Reply #13 on: July 22, 2013, 11:25:17 AM »
Thank you very much for your explanations and information, and patience.  I am about to fly to S. Korea to find the guy who wrote the iRiver H100 manuals and encourage him to enjoy the left overs of the crow I am currently eating.

I'm surprised (but probably shouldn't be) that iRiver could be so misleading in the way they present the product info and that they did so more than once.  In the H140 manual their info on the supported sample rates is in places inaccurate and misleading while in the H340 manual it varies between vague and absent.

btw in the searching and reading I've been doing I did actually find one person who soldered a different crystal to the board of his H140 to reclock it....

Is Rockbox using either of the Speex or SoX sample rate converters?  Something else?
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8963
Re: Toggle playback sample rate iriver H100 H300?
« Reply #14 on: July 22, 2013, 11:34:22 AM »
Quote from: Julian67 on July 22, 2013, 11:25:17 AM
I'm surprised (but probably shouldn't be) that iRiver could be so misleading in the way they present the product info and that they did so more than once.  In the H140 manual their info on the supported sample rates is in places inaccurate and misleading while in the H340 manual it varies between vague and absent.

Quote from: Julian67 on July 22, 2013, 11:25:17 AM
Is Rockbox using either of the Speex or SoX sample rate converters?  Something else?

Its a custom one that jhMikeS and I wrote. 
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Audio Playback, Database and Playlists
| | |-+  Toggle playback sample rate iriver H100 H300?
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.118 seconds with 21 queries.