mrw wrote:
> I won't pretend to be any wiser, but it may offer a clue as to where to
> start looking.
I've had a further look, and made some experimentation.
My draft conclusions are:
- The problem arises when there are under-runs between jive_alsa and
the ALSA sub-system.
- The Radio's ALSA Crossover plugin component sometimes, but not
always, gets into a strange state ("woofer-dropout") when this
happens.
Specifically it ceases to generate an audible stream for the
woofer channel.
- While jive_alsa appears to successfully recover the situation
(through a call to ALSA's snd_pcm_recover), the Crossover plugin
remains in woofer-dropout.
So the pcm stream isn't really recovered. A flaw in the
Crossover plugin ?
Closing and reopening the pcm device seems to be the only sure way of
resetting the Crossover. (Although I have twice seen it spontaneously
recover after another under-run).
Which is why choosing a stream with a different sample rate recovers
the situation.
- The under-runs are most likely to occur when jive_alsa has most work
to do. This is when it is playing a 48k sample rate stream with a
sound effect in progress.
Because:
a) 48k is 10% more than 44.1k, and
b) The sound effects have to be up-sampled on the fly from 44.1k to
48k (they are stored internally at 44.1k).
So that explains the strong association I have made with 48k streams and
pressing one of the buttons (it generates a sound effect).
Possible solutions:
- Switch temporarily to another 44.1k stream
Known to work as it closes and reopens the ALSA pcm
device.
- Turn off sound effects.
I have known "woofer-dropout" to occur without even looking at
a button, let alone hearing a sound effect. But its not the norm. So
perhaps this would be 95% effective.
- Increase the number of ALSA sound buffers
By default the Radio sets up a 20ms buffer divided into two
periods. I.E. 10ms each. So I guess while it's filling one half, the
other half is playing out and cannot be filled.
If, for some reason, there's a delay in filling the only available
buffer, we get under-run. (Perhaps due to some temporary cpu load
increase.)
I seem to have had some success by increasing the buffer to 30ms, and
dividing into three periods. Initial experimentation does suggest that
it is more resilient to added load, perhaps one buffer is all it
needs.
I'm hopeful that this might be a 95%+ effective solution, provided
there are no other adverse effects.
Drawback is that there is no 'App' to do this, although one could be
reasonably easily be made/cobbled together from existing
sources.
- Increase jive_alsa's processing priority
I haven't tried this.
The biggest problem with investigating this is that I do not know how to
reliably trigger woofer-dropout. But I can significantly increase the
chance of its happening from twice a year to about twice in five
minutes. So that helps. But it's tedious.
Second problem is that one needs ideally to run jive_alsa in
debug/tinker mode to clarify some of whats going on. But ralphy has
shown us the way forward, so I might look at that over the next few
months.
Third problem is that source code for Crossover is not available. It's
here, I think, that the problem lies. Specifically how it handles
under-runs, pcm errors, etc.
The curious might like to try the following when their Radio next goes
into woofer-dropout:
Log in to the Radio.
Code:
--------------------
amixer sset Crossover off
--------------------
This removes the Crossover plug-in from the ALSA chain. Sound now
emerges from both tweeter & woofer, although not of good quality. (One
will be receiving left channel, and the other the right channel.) So the
underlying audio & chip seems to be working fine.
Code:
--------------------
amixer sset Crossover on
--------------------
This re-engages the plug-in, and we get back to woofer-dropout. That's
disappointing, as I had hoped that by turning it off and then back on we
might have reset the thing back to normal. Oh well.
------------------------------------------------------------------------
mrw's Profile: http://forums.slimdevices.com/member.php?userid=38299
View this thread: http://forums.slimdevices.com/showthread.php?t=104141
_______________________________________________
Radio mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/radio