dsdreamer wrote: 
> Triode,
> 
> If I try to play my 32kHz sampled WAV file via LMS to squeezelite with
> the following settings..
> 
> > 
Code:
--------------------
  >   > # Updated by Community Squeeze web-gui at 2013/12/14 20:18:35 GMT
  > NAME="-n SqueezeliteQUAD"
  > MAX_RATE="-r 192000"
  > AUDIO_DEV="-o hw:CARD=UD501"
  > LOG_FILE="-f /var/log/squeezelite/squeezelite.log"
  > LOG_LEVEL="-d output=debug"
  > ALSA_PARAMS="-a 40:::"
  > UPSAMPLE="-u hLs"
--------------------
> > 
> 
> ...it plays on my DAC at 384,000 Hz and sounds okay. However, this
> should not be happening since I have specified -r 192000.
> 
> In such a case, the debug log looks as follows:
> 
> > 
Code:
--------------------
  >   > 
  > [20:29:09.290465] output_init_alsa:611 init output
  > [20:29:09.291077] output_init_common:316 outputbuf size: 14112000
  > [20:29:09.291316] output_init_alsa:634 requested alsa_buffer: 40 
alsa_period: 4 format: any mmap: 1
  > [20:29:09.291399] output_init_alsa:648 output: hw:CARD=UD501 maxrate: 192000
  > [20:29:09.439071] output_init_alsa:656 memory locked
  > [20:29:09.440326] output_init_alsa:679 set output sched fifo rt: 45
  > [20:29:09.446060] output_thread:464 open output device: hw:CARD=UD501
  > [20:29:09.446750] alsa_open:233 opened device hw:CARD=UD501 using format: 
S32_LE sample rate: 44100 mmap: 1
  > [20:29:09.446948] alsa_open:312 buffer: 40 period: 4 -> buffer size: 1764 
period size: 441
  > [20:29:09.449949] ALSA snd_pcm_hw_start:588 SNDRV_PCM_IOCTL_START failed 
(-32)
  > [20:29:09.466237] output_flush:356 flush output buffer
  > [20:29:09.469313] output_flush:356 flush output buffer
  > [20:29:17.839823] output_flush:356 flush output buffer
  > [20:29:18.288333] _output_frames:59 start buffer frames: 37632
  > [20:29:18.288662] _output_frames:122 track start sample rate: 128000 
replay_gain: 0
  > [20:29:18.288756] output_thread:464 open output device: hw:CARD=UD501
  > [20:29:18.297939] alsa_open:212 reopening device hw:CARD=UD501 in plug mode 
as plughw:CARD=UD501 for resampling
  > [20:29:18.300059] alsa_open:233 opened device plughw:CARD=UD501 using 
format: S32_LE sample rate: 128000 mmap: 1
  > [20:29:18.300695] alsa_open:312 buffer: 40 period: 4 -> buffer size: 5120 
period size: 1280
  > 
--------------------
> > 
> 
> I notice that squeezelite is reopening the device in plug mode for
> resampling even though there is a synchronous sample rate that is
> within the range of the DAC (192,000). Why is this?
> 
> I also notice the 128kHz sampling rate, which admittedly isn't
> supported by the DAC, seems to have been tried, then discarded, but
> instead of going back to the native 32kHz sampling rate when reopening
> in plug mode, it preserves that new sampling rate when asking the ALSA
> pluhgw to take over. Is this intentional or a bug?  Anyway, the net
> result is that the ALSA plug mode upsamples by 3 after squeezelite has
> upsampled by 4. This gives a total up sampling factor of 12, whereas I
> might have expected squeezelite to choose 6 directly.
> 
> Is it possible this is related to my other problem?

This is with the -u option set?  This does sound right:

Squeezelite will try to resample synchronously - i.e. in multiples of
the original sample rate - unless the X flag is also given.  This will
result in picking the largest multiple of the samplerate which is equal
to or below the max rate.  So this is 128000. 128000 is not supported by
the device so squeezelite reopens the output device in plug mode to get
alsa resampling which then results in you getting 384k on the dac.

The real problem is that the current code assumes any sample rate is
available below the max rate.  32000 is a specific problem case as
powers of 2 of the rate don't fall on other sample rates and hence
synchronous upsampling won't work.  If you have -u X then I suspect you
get rid of this specfic problem?


------------------------------------------------------------------------
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