dsdreamer wrote:
> >
Code:
--------------------
> >
> [15:40:09.361033] output_init_alsa:611 init output
> [15:40:09.361697] output_init_common:316 outputbuf size: 3528000
> [15:40:09.361924] output_init_alsa:634 requested alsa_buffer: 40
alsa_period: 4 format: any mmap: 1
> [15:40:09.367838] output_init_alsa:648 output: hw:CARD=UD501 maxrate: 384000
> [15:40:09.477538] output_init_alsa:656 memory locked
> [15:40:09.478506] output_thread:464 open output device: hw:CARD=UD501
> [15:40:09.478535] output_init_alsa:679 set output sched fifo rt: 45
> [15:40:09.479803] alsa_open:233 opened device hw:CARD=UD501 using format:
S32_LE sample rate: 44100 mmap: 1
> [15:40:09.479975] alsa_open:312 buffer: 40 period: 4 -> buffer size: 1764
period size: 441
> [15:40:09.481943] ALSA snd_pcm_hw_start:588 SNDRV_PCM_IOCTL_START failed
(-32)
> [15:40:09.505368] output_flush:356 flush output buffer
> [15:40:09.507126] output_flush:356 flush output buffer
> [15:41:30.209729] output_flush:356 flush output buffer
> [15:41:31.869386] _output_frames:59 start buffer frames: 10240
> [15:41:31.869562] _output_frames:122 track start sample rate: 32000
replay_gain: 0
> [15:41:31.869644] output_thread:464 open output device: hw:CARD=UD501
> [15:41:31.887877] alsa_open:212 reopening device hw:CARD=UD501 in plug mode
as plughw:CARD=UD501 for resampling
> [15:41:31.889642] alsa_open:233 opened device plughw:CARD=UD501 using
format: S32_LE sample rate: 32000 mmap: 1
> [15:41:31.890227] alsa_open:312 buffer: 40 period: 4 -> buffer size: 1280
period size: 320
>
--------------------
> >
>
> I see that it does attempt to reopen the device in plug mode, but the
> sound is still garbled.
>
>
Squeezelite is operating as intended here - it tries to open the output
at the native rate of 32000 and this is refused, it then enables alsa
resampling and tries again with in plug mode - this succeeds.
Squeezelite then merrily plays assuming alsa is resampling for it...
>
> >
Code:
--------------------
> >
> Playback:
> Status: Running
> Interface = 1
> Altset = 1
> URBs = 8 [ 8 8 8 8 8 8 8 8 ]
> Packet Size = 1024
> Momentary freq = 191809 Hz (0x17.f9e0)
> Feedback Format = 17.15
>
--------------------
> >
>
This is definitely a problem between the dac and usb audio support in
linux. Here's a couple of comments from sound/usb/urb.c in the linux
kernel:
Code:
--------------------
* Full speed devices report feedback values in 10.14 format as samples per
* frame, high speed devices in 16.16 format as samples per microframe.
* Because the Audio Class 1 spec was written before USB 2.0, many high speed
* devices use a wrong interpretation, some others use an entirely different
* format. Therefore, we cannot predict what format any particular device uses
* and must detect it automatically.
--------------------
So the feedback format should always be 10.14 or 16.16.
Code:
--------------------
* The first time we see a feedback value, determine its format
* by shifting it left or right until it matches the nominal
* frequency value. This assumes that the feedback does not
* differ from the nominal value more than +50% or -25%.
--------------------
This is guessing the format and getting it wrong because its assumption
about the feedback value is wrong..... As soon as it has got the wrong
feedback format it can't work unless the dac really is sending bad
feedback packets, but I suspect this is not the case. It may be
possible to fix the linux kernel, but I don't think this is a good
direction to head in (The various EDO test kernels for SBT fiddled with
this area of code due to some device chipsets returning strange things,
but I had thought the device firmware had been fixed. Are there any
firmware updates for your dac?)
So I think squeezelite is working as currently intended, but for some
reason alsa resampling from 32000 in conjunction with the linux kernel
driver and your dac does not work.
The workaround appears to be do resampling within alsa. I will think
some more about whether we should allow this to be used on a by
exception basis for specific sample rates.
------------------------------------------------------------------------
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