Full File Buffering

Submit your proposals and ideas here.
Post Reply
NPNube
Posts: 4
Joined: Wed Aug 01, 2012 1:19 pm

Full File Buffering

Post by NPNube » Wed Aug 01, 2012 1:45 pm

Hello,
I have been tinkering with Neutron. I enjoy the customizability and options.
One thing I would be highly interested in as a feature is full file buffering like the Foobar player on Windows can do.
My setup is as follows:
All music is FLAC (16/44.1 as well as 24/96)
Music is stored on a Windows computer and shared on the network
Music is mounted to the phone via CIFS

Now that I figured out how to have Neutron Player read all the FLAC over the network as though it is stored on the SD-Card, I am trying to ensure smooth playback and also reduce the noise of the WiFi stack on the headphone output. I noticed that with large amounts of data transferring over WiFi, interference is introduced to the headphone output. It can be relatively minor, but annoying during quiet passages in music.
Playback is pretty smooth with the HW Latency feature modified, but it would be totally awesome to be able fully buffer the file!
Great job on implementing crazy HiFi features to Android. It is much appreciated.

adlelare
Posts: 15
Joined: Fri Jul 20, 2012 11:42 pm

Re: Full File Buffering

Post by adlelare » Thu Aug 02, 2012 12:58 am

Hi NPNube,

could you post how you got your phone with Neutron to read all your FLAC files on your network. I am trying to do the same thing, had it working once for a short time, downloaded a new version of Neutron lost what i had done and have tried a couple of times to get it back working without success. When i had it "working" it wasn't really "working" as like you i suspect it needs buffering or something to make it workable.

I currently have to use JRiver and their Gizmo app to play my networked collection and while it works well the Gizmo app has no controls available to adjust the sound. I bought JRiver to get Gizmo.

Dman i would pay extra for a setup that worked well in this regard (a good robust process that can link to high quality music outside my phone's storage). This could be say via music stored on a cloud service (say accessible via the LTE cell network i'm on) or on a wireless portable hard drive or...
i had a Squeezebox for years and it worked well (eventually it died) then i had an Archos 5 (500gb HD Wireless N) and it worked well until it died but to date i've found Neutron the most capable non-PC (JRiver or Foobar) set up i've seen and i would like to extend its use to the maximum possible.

Thanks in Advance

dmitrykos
Site Admin
Posts: 1914
Joined: Mon Apr 25, 2011 6:15 pm

Re: Full File Buffering

Post by dmitrykos » Thu Aug 02, 2012 10:36 am

Hi ! :)

> noticed that with large amounts of data transferring over WiFi, interference is introduced to the headphone output

It is caused by hardware and I am afraid it can't be fixed/improved. The same thing happens when USB is connected or data is passed through USB during the playback.

> fully buffer the file

Do you mean download file, save it to temp place and play? What if I increase HW buffering to 2 seconds instead? Also could you please tell me why full buffering is needed, to avoid audio drops/pauses due to limited traffic or high latency?

Moved topic to Development.

NPNube
Posts: 4
Joined: Wed Aug 01, 2012 1:19 pm

Re: Full File Buffering

Post by NPNube » Sat Aug 04, 2012 4:41 am

@adlelare
Hi, sorry for the late response. These following links may be helpful. Generally, CIFS support is possible on most phones, although I believe it requires a capable kernel. It may be possible without a capable kernel with just the extra CIFS .ko kernel modules.
Once CIFS is mounted, then Neutron Player should be able to play files from the CIFS mount as long as the CIFS mount points to the same folder as some existing media. Neutron Player would not pick up my mounted share when there was not some media in its parent folder. What I did was mount the CIFS share to /sdcard/Music/CIFS. I had some music in /sdcard/Music, and CIFS picked up the stuff in /sdcard/Music/CIFS.
You mileage may vary depending on the device, here is some info on getting it working.
http://www.head-fi.org/t/620238/streami ... st_8572616
http://rootzwiki.com/topic/11175-rom3-2 ... ntry300953


@dmitrykos
Yeah, some phones seem to have pretty bad interference caused by the WiFi and 3G/4G radios. In any case, I'm not sure what the HW latency is doing in Neutron Player. Does it cache some audio data into the phone's RAM? I am using .wav and .flac files @ 16/44.1/stereo as well as 24/96/stereo. The required stream data can be up to about 4.6mbps for uncompressed stereo 24/96. I do end up with some audible interference from at least one of my devices even if the stream is just 1mbps.
With Foobar, you can set an astronomical value for file buffering in the advanced settings. It will store the configured amount of data of a song into memory. This can take a lot of RAM if one is using a .flac or .wav file (especially if the track is the entire album with no breaks.) I noticed that the amount of memory used goes up the same amount of the file size.
In any case, I just think it would be totally awesome to be able to cache the song into RAM. Buffering to Internal Memory or the SDcard could be totally awesome too, considering that the SDcard should be able to write the files faster than the file will transfer over WiFi. Even crummy cards should be able to write fast enough, although it would likely lag the phone until the file was done transferring (Android is pretty laggy even with internal memory operations).
I suppose the main down-side would be longer load times for songs, but it could be a worthy trade-off to reduce radio noise.
Thanks for the reply, I don't expect features implemented for the benefit one just one person, but thanks for the response.

dmitrykos
Site Admin
Posts: 1914
Joined: Mon Apr 25, 2011 6:15 pm

Re: Full File Buffering

Post by dmitrykos » Sun Aug 05, 2012 7:52 am

> NPNube

> not sure what the HW latency is doing

This is what you mentioned as: buffering into RAM. E.g. it allows to render audio and buffer it for N number of milliseconds before actual output to Android OS. During our discussion I already made modification to Neutron and since next version HW Latency can be increased up to 2 seconds.

> I suppose the main down-side would be longer load times for songs, but it could be a worthy trade-off to reduce radio noise.

But if doing it during playback then the noise will still be present during the time when next song is being downloaded. So, to my view there is no clean escape from the problem of interference noise of WiFi device.

NPNube
Posts: 4
Joined: Wed Aug 01, 2012 1:19 pm

Re: Full File Buffering

Post by NPNube » Sun Aug 05, 2012 5:51 pm

Hello again. Thanks for providing details regarding the HW Latency.
If it were possible to configure the HW Latency to a large value (600 seconds would be 10 minutes, etc.), it should allow an entire song to be buffered into memory. Theoretically, if the ability to delay the start of the audio playback until the full audio track is loaded into memory via the HW Latency function, then that would accomplish what I am looking for.
When I play audio tracks in Foobar with the "full file buffering" enabled, I monitor the memory usage and network throughput. The song doesn't start until the full file is loaded into memory and there is no network usage during playback. The main problem is the time it takes to load the track into memory. The problem with Android is that memory resources may be low, which I suspect may cause the phone to crash or the player app to force close.
Thanks again for your response, I would like to know your thoughts on the matter.

dmitrykos
Site Admin
Posts: 1914
Joined: Mon Apr 25, 2011 6:15 pm

Re: Full File Buffering

Post by dmitrykos » Sun Aug 05, 2012 6:03 pm

> HW Latency to a large value (600 seconds would be 10 minutes, etc.),

Unfortunately HW Latency can't be used like that. It is only suitable for real-time rendering when some small occasional delays can be consumed by HW Latency time gap. Fully buffering file requires additional logic for player core which is as simple as: copy file to temp file, use temp file for playback. I will think about it more.

NPNube
Posts: 4
Joined: Wed Aug 01, 2012 1:19 pm

Re: Full File Buffering

Post by NPNube » Sun Aug 05, 2012 11:19 pm

Thank you very much for your clarification. My knowledge regarding how the software actually performs certain functions is limited, as you can likely tell. In any case, thank you for your support and, of course, great music player. I believe I'm one of the few people interested in such a feature. I don't encounter too many people using CIFS to mount their FLAC/WAV (some of which is 24/96/stereo (bummer how Android down-samples that)) music library. I'll probably drop that when we get 1TB storage on the phone. Until then...
Everything works for me, it is just that there is a bit of radio interference with that much data streaming. First-world problems, right?
Thanks again.

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests