Jonas Wielicki | 6 May 2012 18:21
Gravatar

How to debug gapless issues?

Hi folks,

I am still struggling with a gapless (or not) playback issue I'm having
since I got the SSD in my player.

As this is nonstandard hardware, I guess its best when I track the bug
by myself, but I need some advice where to look for potential issues.

My first thought was that it might be due to the SSD being slow when
writing changes to the playlist control file. So I tried to disable all
writing by putting a return 0 right at the start of flush_cached_control
in playlist.c, but that did not fix the issue.

It should be no problem in buffering, as the buffers are pretty full in
the buffering thread debug screen. The songs are all ogg/vorbis, so it
should not be an codec issue; also, everything was fine before the SSD
upgrade.

When turning on Crossfade, after an reboot, crossfading works, but it
feels as if there is a lag between the start of crossfade and the press
of the next button on manual skip. Crossfading works then though. On
end-of-track skipping, there is still a lag and no crossfading (although
I set it to be on Always).

I based my work on the v3.11 branch, however, I could not find any
relevant bugs in the bugtracker for this version which would explain
that behaviour.

So basically I'm looking for pointers on where to look for potential
gap-causers or in general means to debug this problem. Any suggestions?
(Continue reading)

Magnus Holmgren | 6 May 2012 18:51
Picon

Re: How to debug gapless issues?

On 2012-05-06 18:21, Jonas Wielicki wrote:

> I am still struggling with a gapless (or not) playback issue I'm having since
> I got the SSD in my player.

<...>

> The songs are all ogg/vorbis, so it should not be an codec issue; also,
> everything was fine before the SSD upgrade.

And you just copied the files over, not adding (big) album art or something like 
that?

> So basically I'm looking for pointers on where to look for potential
> gap-causers or in general means to debug this problem. Any suggestions?

One way could be to enable logf in buffering and perhaps playback. If you add
the current tick to the log line, you should be able to zero in on any delays.

Have you tried increasing the anti-skip buffer? That should tell if it is
related to "spin up".

And you have tried clearing all settings too, I hope. That has a tendency to fix
strange problems... :)

--

-- 
   Magnus

Jonas Wielicki | 6 May 2012 19:23
Gravatar

Re: How to debug gapless issues?

On 06/05/12 18:51, Magnus Holmgren wrote:
> And you just copied the files over, not adding (big) album art or
> something like that?
I never was a friend of album art, so, yes, its only the files.

>> So basically I'm looking for pointers on where to look for potential
>> gap-causers or in general means to debug this problem. Any suggestions?
> One way could be to enable logf in buffering and perhaps playback. If
> you add
> the current tick to the log line, you should be able to zero in on any
> delays.
Where exactly does the logf output go to and how do I enable it? I
grepped for logf definitions, but I was rather confused by the hits.

> Have you tried increasing the anti-skip buffer? That should tell if it is
> related to "spin up".
I tried that some time ago and its still up at 10min.

> And you have tried clearing all settings too, I hope. That has a
> tendency to fix
> strange problems... :)
I cleared the settings when I reinstalled rockbox after putting in the SSD.

Well, I was watching the buffering thread debugscreen once more and
found that the pcm buffer starves on track change. Is that the intended
behaviour, but without the wait for refill or should it never starve on
(expected) track change at all? If so, that would be a hint I guess.

cheers

(Continue reading)

Magnus Holmgren | 6 May 2012 20:30
Picon

Re: How to debug gapless issues?

On 2012-05-06 19:23, Jonas Wielicki wrote:

> Where exactly does the logf output go to and how do I enable it? I
> grepped for logf definitions, but I was rather confused by the hits.

It goes to a buffer you can view in the debug menu (and write it to disk). 
Define LOGF_ENABLE in the files where you want logging to happen, and any LOGF 
calls will go to that buffer.

> Well, I was watching the buffering thread debugscreen once more and
> found that the pcm buffer starves on track change. Is that the intended
> behaviour, but without the wait for refill or should it never starve on
> (expected) track change at all? If so, that would be a hint I guess.

Don't know if crossfade makes things different, but without crossfade the pcm 
buffer doesn't starve on track change on my FuzeV2.

--

-- 
   Magnus

Mike Giacomelli | 6 May 2012 21:08
Picon
Favicon

RE: How to debug gapless issues?

Does crossfade even need to do a disk access?  If both files are buffered and are the same format, I think it shouldn't unless the codec buffer happened to empty right at the track change, which seems unlikely.  


Do these specific files work normally in the uisim on your PC with crossfade enabled?
Jonas Wielicki | 7 May 2012 09:28
Gravatar

Re: How to debug gapless issues?

On 06/05/12 20:30, Magnus Holmgren wrote:
> It goes to a buffer you can view in the debug menu (and write it to
> disk). Define LOGF_ENABLE in the files where you want logging to happen,
> and any LOGF calls will go to that buffer.

Okay, this is probably me being stupid, but the only log related thing I
can find in the Debug menu is called “Metadata log”. However the only
effect selecting and hitting NAVI has is that a popup shows up with
“Metadata log enabled” (or “disabled”, it toggles).

> Don't know if crossfade makes things different, but without crossfade
> the pcm buffer doesn't starve on track change on my FuzeV2.

Well, I just turned it on as it has been a suggestion in the bugtracker
when I looked for gapless-related bugs to trace it down. The pcm buffer
starves always for me, at least with the SSD.

Magnus Holmgren | 7 May 2012 12:17
Picon

Re: How to debug gapless issues?

On Mon, May 7, 2012 at 9:28 AM, Jonas Wielicki <j.wielicki <at> sotecware.net> wrote:

> Okay, this is probably me being stupid, but the only log related thing I
> can find in the Debug menu is called “Metadata log”. However the only
> effect selecting and hitting NAVI has is that a popup shows up with
> “Metadata log enabled” (or “disabled”, it toggles).

You need to select logf in configure (under the advanced options) too.
But when I tested enabling logf in playback.c, there were some bitrot,
and even typos, that needs to be fixed.

--

-- 
  Magnus

Jonas Wielicki | 7 May 2012 20:08
Gravatar

Re: How to debug gapless issues?

On 07/05/12 12:17, Magnus Holmgren wrote:
> You need to select logf in configure (under the advanced options) too.
> But when I tested enabling logf in playback.c, there were some bitrot,
> and even typos, that needs to be fixed.
> 
When I tried to run that on my device, it blackscreen'd a part of a
second after the initial rockbox splash comes up (rockbox logo + build
id). It still runs, but does not react to key input, only way to bring
it back to live is to short the Reset pins.

Is there any possible explanation for this behaviour?


Gmane