Rockbox Technical Forums

Rockbox General => Rockbox General Discussion => Topic started by: vitess on June 30, 2007, 11:45:45 PM

Title: Sansa - prolonged electrical noise when loading tracks
Post by: vitess on June 30, 2007, 11:45:45 PM
The Sansa e200 has a known issue which results in electrical noise from the headphone-out when the unit reads from flash. On higher impedence headphones (e.g. the stock Sandisk earbuds, my 80 ohm Beyerdynamic DT250-80) it's difficult to hear, but with lower impedence headphones, such as my 16 ohm Sennheiser CX300s, it is clearly audible.

The behaviour of the stock Sandisk firmware trivialises this issue because it only reads from flash for about two seconds at the beginning of each track. Rockbox, however, seems to buffer the current track and each subsequent track up to available RAM. This makes sense for hard disk players, but on this flash player it's unfortunately exposing a nasty little hardware flaw. The result is almost 15 seconds of sustained electrical noise at the beginning of a track that hasn't been pre-buffered, which is difficult to ignore with tracks that start quietly.

Has anyone else experienced this issue with Rockbox and their e200? Unfortunately I can't provide a sample of the noise as I'm on the road at the moment, but I'll post a followup when I get the chance.

When I asked in the IRC channel I was told there's no way to change the buffering behaviour. I did however find a rather inelegant workaround of editing config.cfg to increase "max files in dir" to 250000 (I hope this flexibility is a feature and not a bug that gets fixed!). Each increase of 10,000 eats approximately 0.9 MB of buffer, and reducing the buffer from the initial 30 MB to around 7.5 MB results in buffering behaviour closer to the Sandisk firmware. I haven't used Rockbox for long enough to tell whether there are any negative side-effects (e.g. will games still have enough free RAM to run?).

P.S. Just a word of thanks to the Rockbox developers for creating firmware that is far superior to the manufacturers' concoctions. I'll definitely be donating a few dollars to the project as soon as the financial pain of my e280 purchase wears off :-)
Title: Re: Sansa - prolonged electrical noise when loading tracks
Post by: Llorean on June 30, 2007, 11:52:48 PM
The plugin buffer (used by games) is pre-allocated, you can't eat it up by increasing how much memory is used, because that memory is stolen only from the audio buffer.

Another option would be to compile a build with a significantly larger plugin buffer. This would not only reduce the noise duration (at increased frequency of the noise, much as yours does), but would allow much, much larger images to be loaded with the jpeg viewer without stopping music playback.

Though of course, still not a good option for the HD players.
Title: Re: Sansa - prolonged electrical noise when loading tracks
Post by: Vagabund on July 01, 2007, 04:54:49 AM
Hi vitess,

i have with my Sansa e270 the same problem. But i can hear also the noise while changing in the menu with the scroll wheel. But the noticeable noise is the "tic-tic-tic" electrical noise always if i play a song or in the pause. This is for me the absolut K.O. criterion for Rockbox, sadly. I like Rockbox, but the primary job for the player is to play music in good sound quality. I hope for a solution.

My inear from UltimateEars the superfi 5 pro has 21 Ohms.

Regards
Michael
Title: Re: Sansa - prolonged electrical noise when loading tracks
Post by: mschneider on July 01, 2007, 12:45:07 PM
Llorean,

About compiling for a larger buffer:
Would this also allow for larger images to be loaded in the wps? I know you said something about it in another thread and that doing so would eat away at audio buffer memory but if i were to compile for a larger image buffer where would it be in the source to modify?
Title: Re: Sansa - prolonged electrical noise when loading tracks
Post by: vitess on July 15, 2007, 03:58:36 AM
Michael, I get the electrical noise during menus etc. when the unit is reading from flash, but reducing the buffer in the roundabout way I described has greatly reduced its annoyance during songs. I'm not sure about the "tic-tic-tic" you mention. Are you saying your unit emits such a noise constantly while a track is paused?

I never got around to providing the promised sample of the electical noise - sorry about that. Probably won't bother with that unless someone requests it.
Title: Re: Sansa - prolonged electrical noise when loading tracks
Post by: Vagabund on July 15, 2007, 05:31:41 AM
Hi vitess,

i have removed RB completly. For me RB is not a alternative to the original FW. I have tested the version from today with the same background noise. My player should only play my mp3's in good sound quality, and i think i have no chance to reach this with RB  :-\ .

Michael
Title: Re: Sansa - prolonged electrical noise when loading tracks
Post by: vitess on July 15, 2007, 11:10:53 AM
The electrical noise is also present with the Sandisk firmware. I just created a ten minute 320kps MP3 of silence and listened to 5 mins of it with Sandisk's firmware and Rockbox with the config modification mentioned in my original post, and after 5 mins I left the file playing while I browsed the music list and viewed some photos. Result was that both exhibited:

- 2-3 seconds electrical noise on selecting track for playback
- 2-3 seconds electrical noise partway through playback (Sandisk at around 3:00, Rockbox at around 2:40)
- short bursts of electrical noise if browsing images while track playing or paused

Here are the differences I observed:

- Rockbox exhibited short clicks of electrical noise if browsing music folders or the database. The Sandisk firmware apparently sticks its lists in RAM. A possible workaround in Rockbox might be the "Load to RAM" setting for the database, but this option isn't present in the Sandisk firmware, presumably because it's assumed it's not needed for a flash-based player.
- Rockbox exhibited around 6 seconds of noise when started. The Sandisk's firmware didn't. The difference here seems to be that Sandisk's doesn't switch on the headphone-out until you first play a file, so you won't hear the noise as it's starting nor if you browse music folders or view images before you first play a file.

Provided you use my config workaround, there's not much difference when it comes to the effect of the electrical noise issue on the quality of playback. And ultimately you have Sandisk to thank for this hardware flaw...

Incidentally, the Sandisk firmware had a little surprise for me: a low level of continuous background static during playback when volume was low or muted (the noise pauses when the track is paused). This was the case with both Normal and High volume set in the Sandisk firmware's settings. Rockbox was perfectly silent with the volume at similarly low levels.
Title: Re: Sansa - prolonged electrical noise when loading tracks
Post by: arwa on August 02, 2007, 09:59:41 AM
I do own a Sansa e280 (not FM). I can clearly hear the noise, too, when using my Koss ThePlug in ear phones. (It is ok in a train with real background noise and when turning the volume a bit higher.)

Incidentally, the Sandisk firmware had a little surprise for me: a low level of continuous background static during playback when volume was low or muted (the noise pauses when the track is paused). This was the case with both Normal and High volume set in the Sandisk firmware's settings. Rockbox was perfectly silent with the volume at similarly low levels.

This low level summing/grumbling(?) (German: Brummen) can be heard in rockbox as well in my case. You have to turn down the volume to very low to hear it. It's interesting that the noise is not affected by the volume setting. So I guess there is no way around this, is it? It seems that the Sansa player simply sucks :(

What I can also hear is the scrolling of a menu entry on the display. Each character move makes a "tic". Interesting: This keeps going on even after Rockbox tuns off the display. So an enhancement suggestion for rockbox could be to stop all display rendering when display is turned off, if this could save battery. (menu scrolling, volume peak meter, clock redraw, etc.)

Greetings,
arwa
Title: Re: Sansa - prolonged electrical noise when loading tracks
Post by: mgl888 on August 03, 2007, 09:04:28 PM
I got a Sansa after my Gigabeat screen broke, and yes, I'm quite annoyed by the noises which were completely non-existent on the gigabeat.

Also, I noticed that scrolling long lists tend to be choppy and slow during music playback. Is it possible to add the load list to RAM option?
Title: Re: Sansa - prolonged electrical noise when loading tracks
Post by: Llorean on August 03, 2007, 09:10:30 PM
Which SVN revision are you experiencing choppy lists with?
Title: Re: Sansa - prolonged electrical noise when loading tracks
Post by: mgl888 on August 05, 2007, 12:48:35 PM
I'm using r14196-070805, which I just updated, but the slow/choppy list problem seems to be still there. Scrolling quickly (or trying to at least) through long song lists during playback results in regular short pauses. Could it just be that the Sansa processor is slow?
Title: Re: Sansa - prolonged electrical noise when loading tracks
Post by: Vortex on August 05, 2007, 03:29:56 PM
I'm experiencing that too. It's probably because the Original Firmware can use both cores of the Sansa's processor while Rockbox cannot.
Title: Re: Sansa - prolonged electrical noise when loading tracks
Post by: dedalus on October 05, 2007, 03:24:26 PM
Hi vitess,

i have with my Sansa e270 the same problem. But i can hear also the noise while changing in the menu with the scroll wheel. But the noticeable noise is the "tic-tic-tic" electrical noise always if i play a song or in the pause. This is for me the absolut K.O. criterion for Rockbox, sadly. I like Rockbox, but the primary job for the player is to play music in good sound quality. I hope for a solution.

My inear from UltimateEars the superfi 5 pro has 21 Ohms.

Regards
Michael

You are going to experience this with a lot of portables on various firmwares. There just doesnt' seem to be a lot of manufacturer testing going on for low-Z headphones and they like to sell ridiculously hot analog sections as a "feature." Not sure if there is anyway for the rockbox devs to lower the gain from firmware, it is probably a fixed path. I'm working on a simple L-pad inline attenuator to bring my SE310s up to an impedence that the sansa is more comfortable with. Maybe even just a single resistor inline like those ER-4 adapters.

Query: Is the attenuation for the Euro versions implemented in hardware or via DSP in the manufacturer's firmware? If the analog gain is actually lower in hardware, the Euro versions might be the way to go for low-Z headphones.

EDIT: Wanted to clarify that I meant testing by the manufacturers and not RB devs as I have no idea what phones are used in RB testing.
Title: Re: Sansa - prolonged electrical noise when loading tracks
Post by: saratoga on October 05, 2007, 05:51:42 PM
They all use the same amp hardware (its built into the PP5024 processor so its not like you can change it out).

The noise probably has nothing to do with the amp anyway.  It sounds like poor analog design work leading to cross talk.
Title: Re: Sansa - prolonged electrical noise when loading tracks
Post by: dedalus on October 05, 2007, 07:31:09 PM
The noise probably has nothing to do with the amp anyway.  It sounds like poor analog design work leading to cross talk.

The noise all but disappears under load though when the volume is turned up in RB. Which is why I thought lowering the gain on the amp would help as the signal from the dac could be ratcheted up.

Had no idea the dac and amp were integrated on the processor though. The noise bust be coming in somewhere later between the processor and the headphone jack then. Leaves us pretty much no choice but to run it hot and attenuate it afterwards.

Title: Re: Sansa - prolonged electrical noise when loading tracks
Post by: dedalus on October 05, 2007, 08:03:01 PM
150 ohm in serial is doing the trick for me on my SE310s. Noise is all but gone and the zero-point in the RB volume control is much more sensible. Haven't measured the effect on the frequency response but it seems to be neglible, any detriment could be corrected in EQ anyway. I'm just using a hand-matched pair of 5% tolerance carbon film from Radio Shack atm.
Title: Re: Sansa - prolonged electrical noise when loading tracks
Post by: arwa on October 06, 2007, 04:50:53 AM
150 ohm in serial is doing the trick for me on my SE310s.
This is interesting, I had this idea as well but did not try it yet. How did you install the resistor? Is it in a separate plug adapter or did you build it into the sansa somehow?

It would be nice if you could give some instructions for doing this mod, too.

Thanks,
arwa
Title: Re: Sansa - prolonged electrical noise when loading tracks
Post by: dedalus on October 06, 2007, 06:26:19 AM
I made an inline adapter. It would be easier for me just to post pics of a mock-up with the leftover parts. You are probably going to want to use metal film resistors and gold-plated jacks but here is the basic idea:

(http://img390.imageshack.us/img390/1876/img3296ej1.th.jpg) (http://img390.imageshack.us/my.php?image=img3296ej1.jpg)

The ground posts are just soldered directly together (pinch the clamp on one and tin both clamps, squeeze it into the other clamp and heat). Bend the terminals out a bit and thread the resistor legs through (these are the screw-type terminals) then solder each. Make sure to hand match the resistors with your ohmmeter (I took the best pair out of 10).

Here it is the one I used, set with epoxy and wrapped in heatshrink:

(http://img505.imageshack.us/img505/2163/img3300sb8.th.jpg) (http://img505.imageshack.us/my.php?image=img3300sb8.jpg)

My SE310s already have a breakaway cable so I slip this inline there.
Title: Re: Sansa - prolonged electrical noise when loading tracks
Post by: arwa on October 07, 2007, 03:39:10 PM
Oh, btw: Does anybody know, if the Sansa c200 series does have this electrical noise problem, too?
Title: Re: Sansa - prolonged electrical noise when loading tracks
Post by: just_me on October 30, 2007, 04:59:39 AM
would it be possible to try to fix this within the player itself?

Like soldering a condensator to a strategic place?

Greetings,
Frieder