Stutter/skips in Android client

Need help? Post your questions here.

Moderator: moderators

Re: Stutter/skips in Android client

Postby jakebriggs » Mon Apr 02, 2012 11:53 pm

So, it turns out that I WASN'T using my its a 32 gig class 2 micro sd card as a subsonic cache after all. For some reason, the built in 16 gig for my phone is mounted at /mnt/sdcard and the external sd card is mounted at /mnt/emmc

So, I changed the cache location to the external sdcard mounted at /mnt/emmc, and the stutters still happen but not quite as bad as when the cache is on the internal card. I don't know if this means anything or not. Maybe ICS or I have something running that is sucking all the bandwidth periodically from the medium that the cache is on....
jakebriggs
 
Posts: 23
Joined: Sat Mar 31, 2012 11:54 pm

Re: Stutter/skips in Android client

Postby jakebriggs » Tue Apr 03, 2012 1:33 am

I tried it on my workmates samsung galaxy S, running a stock rom, against my home server and the stutters still exist (but not as bad as on mine). Running on my other workmates samsung galaxy S, running gingerbread 2.3.4 - some random rom from XDA - the stuttering didn't seem to crop up....
jakebriggs
 
Posts: 23
Joined: Sat Mar 31, 2012 11:54 pm

Re: Stutter/skips in Android client

Postby djzeratul » Tue Apr 03, 2012 1:55 am

My roommate has a HTC EVO and it does not stutter using my server. He is thinking about updating to a custom ROM with ICS soon, so perhaps I will ask him to test it again when he does. I am thinking it is device specific at this point, but testing it on the EVO with ICS on it should tell us specifically if its the device or ICS to blame.
djzeratul
 
Posts: 3
Joined: Sat Mar 31, 2012 11:49 am

Re: Stutter/skips in Android client

Postby djzeratul » Wed Apr 04, 2012 8:31 am

I tested it on my roommate's Galaxy Tab 10.1 (arguably similar hardware to the Galaxy Nexus, although it uses a Tegra APU instead of OMAP) with AOKP ROM (Android 4.0.3) and there was one very very slight less than a second stutter at the very beginning but it was perfect for the remainder of the file write.

This leads me to believe it is not ICS related at all and a hardware issue.
djzeratul
 
Posts: 3
Joined: Sat Mar 31, 2012 11:49 am

Re: Stutter/skips in Android client

Postby jakebriggs » Mon Apr 16, 2012 3:08 am

I changed my old 32 gig sdcard (it was actually class 4, not class 2) for a class 10 32 gig card - the stutters seem to be less frequent, but just as stuttery.

One night this week, I intend on running some trials and see if there is any consistency on when the stutters happen on both cards.
jakebriggs
 
Posts: 23
Joined: Sat Mar 31, 2012 11:54 pm

Re: Stutter/skips in Android client

Postby jakebriggs » Fri May 04, 2012 3:23 am

okay it took me a lot longer than I though, but, I ran some tests today and the stuttering doesn't seem to happen with any consistancy. I started playing something, waited for a skip, noted down the megs downlaoded, removed the file, and started all over again with the same track.

The first time, it skipped at about 6 meg, the next it was 5.5, then 11 meg, then 60 meg. So, that doesn't help :(
jakebriggs
 
Posts: 23
Joined: Sat Mar 31, 2012 11:54 pm

Re: Stutter/skips in Android client

Postby NTolerance » Fri May 11, 2012 5:34 am

I started experiencing this bug after moving from an HTC Evo running Gingerbread to a Galaxy Nexus running ICS. Hearing the digital "bzzzzzt" at the beginning/middle of a track really kills the experience. It only occurs when downloading files. Cached files don't exhibit the problem.
NTolerance
 
Posts: 33
Joined: Mon Aug 22, 2011 5:13 pm

Re: Stutter/skips in Android client

Postby jakebriggs » Mon May 14, 2012 11:30 pm

What I think might help is if a subsonic developer can provide a debug build and give us some tests, so we can track this issue down. I am a java software engineer, but I don't really have time to get the android source code and learn it well enough to add relevant and useful debuging code, and compile and run it to work out what the issue is :/

I do have time however to spend 30 minutes generating log files and describing how I got them. It would be nice to know wherer the issue is, and if its with the subsonic app can it be fixed - or if its with ICS can the subsonic app work around the issue somehow. Whether its a bug or feature in ICS, an argument could be made that the subsonic app doesn't properly work in the environment its intended to work in (IE it assumes gingerbread), so its a bug in subsonic. I suspect that its a bug in third party ICS builds, so perhaps these thrid party build are not being compiled correctly, so that would be a bug in the build. But still subsonic may be able to work around it.
jakebriggs
 
Posts: 23
Joined: Sat Mar 31, 2012 11:54 pm

Re: Stutter/skips in Android client

Postby NTolerance » Tue May 15, 2012 8:32 pm

I've done some fairly extensive testing, and here are my findings:

The "bzzzzt" stuttering occurs only when big disk writes are ongoing, such as when Subsonic is downloading music.

Test environment: Verizon Galaxy Nexus with ICS 4.0.4
Test method: writing files during playback with Subsonic.
Steps to reproduce:

    Create an empty file using a Unix system. 50MB will do:
    Code: Select all
    dd if=/dev/zero of=/tmp/50mbfile bs=50M count=1


    Transfer the file to your device at /mnt/sdcard.

    Get a shell on your device. Read the file over and over and note that no stuttering occurs:
    Code: Select all
    while true; do cat /mnt/sdcard/50mbfile; done


    Now write the file over and over and notice that stuttering occurs frequently:
    Code: Select all
    while true; do cat /mnt/sdcard/50mbfile > /mnt/sdcard/junk; done

Observations:
This can also be reproduced using the stock Play Music app and Poweramp. With Poweramp, the stuttering occurs less if you set a big +750ms buffer size using Settings->Audio Engine->Advanced Tweaks->Audio Buffer Size.

Can someone with a non-Nexus device running ICS perform this test? I'd like to know if this issue affects just the Galaxy Nexus or all ICS devices. Please don't run the commands in my test procedure if you don't know what they mean. I take no responsibility if the test method breaks your device.

I'd love the opportunity to do more testing using an even bigger buffer size than what Poweramp can offer.
NTolerance
 
Posts: 33
Joined: Mon Aug 22, 2011 5:13 pm

Re: Stutter/skips in Android client

Postby jakebriggs » Wed May 16, 2012 10:35 pm

I partially did this test this morning, I am running cyanogenmod 9 nightly for the samsung vibrant (pretty much a galaxy s). The subsonic music cache is stored on a class 10 32 gig sdcard, mounted at /mnt/emmc/. The internal sdcard mounted at /mnt/sdcard/. I played a cached track.

I tried writing to the internal sdcard with:
while true; do cat /mnt/sdcard/50mbfile > /mnt/sdcard/junk; done
I get no bzzzts at all.

I tried writing to the external sdcard with:
while true; do cat /mnt/sdcard/50mbfile > /mnt/emmc/junk; done
I get the bzzzts!

If I play a non-cached track, I get the bzzzts as per normal, no matter what I do.

A workaround for this issue could be being able to specify a partial dirtectory and a permanent directory. When fiels are being downloaded, they can go into one directory and when they are done they get moved to the permanent one. This might be a little tricky, or maybe not.

Obviously not everyone has an external sdcard, so this may not work for everyone. Obviously writing the temp and permanent files to the same device can work somehow - other people do it on other devices - and perhaps the real fix (rather than the workaround I suggested) is easier.
jakebriggs
 
Posts: 23
Joined: Sat Mar 31, 2012 11:54 pm

Re: Stutter/skips in Android client

Postby jakebriggs » Wed May 16, 2012 10:55 pm

and I just realised that my workaround makes little sense. SInce you have to read the file you are writing, it doesn't matter where it gets written to.

I was suggesting that you could write a file to /mnt/sdcard/tempsubsoniccache and read THAT SAME FILE from /mnt/emmc/subsonic/music even though its in a different place. Man. Not enough coffee I think.
jakebriggs
 
Posts: 23
Joined: Sat Mar 31, 2012 11:54 pm

Re: Stutter/skips in Android client

Postby jakebriggs » Wed May 16, 2012 11:58 pm

In a fit of what I'd like to call brute force bug fixing (IE change random values until it works), I changed private static final int MUSIC_DIR_CACHE_SIZE = 20; to private static final int MUSIC_DIR_CACHE_SIZE = 200; in CachedMusicService.java, compiled it and chucked it on my phone. Made no difference.
jakebriggs
 
Posts: 23
Joined: Sat Mar 31, 2012 11:54 pm

Re: Stutter/skips in Android client

Postby NTolerance » Sun Jun 03, 2012 4:43 pm

I've found a fix for this issue, at least on the Galaxy Nexus. There is I/O contention going on while Subsonic is downloading files. After installing the Franco kernel (which has documented I/O scheduling tweaks), the problem does not occur.

Unfortunately I still cannot use Subsonic due to the /mnt/sdcard/subsonic permissions issue described here:

viewtopic.php?f=2&t=8781&hilit=permissions+android
NTolerance
 
Posts: 33
Joined: Mon Aug 22, 2011 5:13 pm

Re: Stutter/skips in Android client

Postby jakebriggs » Tue Jun 05, 2012 4:46 am

NTolerance wrote:I've found a fix for this issue, at least on the Galaxy Nexus. There is I/O contention going on while Subsonic is downloading files. After installing the Franco kernel (which has documented I/O scheduling tweaks), the problem does not occur.

Unfortunately I still cannot use Subsonic due to the /mnt/sdcard/subsonic permissions issue described here:

viewtopic.php?f=2&t=8781&hilit=permissions+android


So the solution is to either understand what these contention issues are and work around them in subsonic, or to make the same I/O tweaks in the kernel I am using. I think I'll reseach the franco kernel I/O tweaks, starting with google. Any links NTolerance?
jakebriggs
 
Posts: 23
Joined: Sat Mar 31, 2012 11:54 pm

Re: Stutter/skips in Android client

Postby NTolerance » Tue Jun 05, 2012 4:53 am

jakebriggs wrote:
NTolerance wrote:I've found a fix for this issue, at least on the Galaxy Nexus. There is I/O contention going on while Subsonic is downloading files. After installing the Franco kernel (which has documented I/O scheduling tweaks), the problem does not occur.

Unfortunately I still cannot use Subsonic due to the /mnt/sdcard/subsonic permissions issue described here:

viewtopic.php?f=2&t=8781&hilit=permissions+android


So the solution is to either understand what these contention issues are and work around them in subsonic, or to make the same I/O tweaks in the kernel I am using. I think I'll reseach the franco kernel I/O tweaks, starting with google. Any links NTolerance?


http://forum.xda-developers.com/wiki/Sa ... ancoKernel
NTolerance
 
Posts: 33
Joined: Mon Aug 22, 2011 5:13 pm

PreviousNext

Return to Help

Who is online

Users browsing this forum: No registered users and 21 guests