dsdreamer wrote: 
> The following small patch fixes the above issue for me.
> > 
Code:
--------------------
  >   > 
  > [fedora@wandquad squeezelite]$ git diff output_alsa.c
  > diff --git a/output_alsa.c b/output_alsa.c
  > index f033928..7d810a1 100644
  > --- a/output_alsa.c
  > +++ b/output_alsa.c
  > @@ -510,7 +510,7 @@ static void *output_thread(void *arg) {
  > continue;
  > }
  > 
  > -               if (avail < alsa.period_size) {
  > +               //if (avail < alsa.period_size) {
  > if (start) {
  > if (alsa.mmap && ((err = snd_pcm_start(pcmp)) < 0)) {
  > if ((err = snd_pcm_recover(pcmp, err, 1)) < 0) {
  > @@ -536,7 +536,7 @@ static void *output_thread(void *arg) {
  > }
  > avail = snd_pcm_avail_update(pcmp);
  > }
  > -               }
  > +       //      }
  > 
  > // restrict avail in writei mode as write_buf is restricted to period_size
  > if (!alsa.mmap) {
  > 
--------------------
> > 
> 
> The first time this thread executes after a change in sampling rate,
> avail is 4x greater than alsa.period_size, and hence none of the code
> inside that big if statement gets called. The above patch comments out
> the if statement entirely. This one simple change allows me to play
> music at all sample rates supported by the DAC, whereas without it I
> get garbled sound at all rates except that which squeezelite starts at
> (44.1kHz normally).

Could you try the latest output branch version.  This tries to make that
part of the code align completely to
http://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2pcm_8c-example.html#a43
- direct_loop which I believe is the best match. The original code was
definitely the cause of the error message as it called start when there
was nothing in the alsa output buffer.  If this does not work, then we
need to see why calling start too early and hence causing a call to
recovery is necessary...


------------------------------------------------------------------------
Triode's Profile: http://forums.slimdevices.com/member.php?userid=17
View this thread: http://forums.slimdevices.com/showthread.php?t=99395

_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to