Thank you for your donation!


Intermittent loud ticks and no-audio using Spotify
#51
Quote:But.... still nasty spikes! Unfortunately.


ogg vorbis (the audio format used by Spotify) is not very streamable friendly. Meaning there is no real good mechanism for a player to play it other than to download it, cache it to memory (or disk) and then play it from that cache. The spike you're seeing is librespot downloading the audio file as fast as it can. That's normal. It shouldn't be a huge problem. If a Pi Zero can handle it the other Pi's should have no problem.

Quote:It looks like the PCM stream being output from the Spotify renderer is being upsampled after the fact by ALSA.


No. The effective sampling rate presented to the sound card is still 44100. I can't find out with a quick Google what the fraction after 44100 actually means but if I had to guess I'd say it's related to bytes per sec in relation to the buffer or something like that maybe?
Reply
#52
It could have something to due with the fact that the sample rate is not evenly divisible by the period (5513) and buffer sizes (22052) maybe? The periods and buffer size are in "Frames" a frame is one sample. The actual buffer size in bytes dependent on how many channels. So for example everything else being equal, a stereo frame is twice the size in bytes as a mono frame and so on.

When I set the buffer size to 44100 and the period size to 11025 rate says:

Code:
rate: 44100 (44100/1)


I have no idea if this affects sound quality?
Reply
#53
If the stock 0.5 sec buffer still presents a problem you could always use the custom pcm definition I posted?
Reply
#54
@basmeyer

You're in luck. As I was packing boxes today in preparation for a move I found my old HiFiBerry DAC+ Pro (single-ended RCA jacks; not XLR). The board is stenciled "HW 2.2" so it's from pretty early in the production run. I think the picture on their website shows "HW 2.6". 

I slapped this into an RPi4B running moOde 6.7.1


Code:
S Y S T E M   P A R A M E T E R S

moOde release        = 6.7.1 2020-07-22
RaspiOS            = 10.4
Linux kernel        = 5.4.51-v7l+ #1325
Platform        = Pi-4B 4GB v1.1
Architecture        = armv7l (32-bit)
...
A U D I O   P A R A M E T E R S

Audio device        = HiFiBerry DAC+ Pro
Interface        = I2S
Mixer name        = Digital
Hardware volume        = Controller detected
Max ALSA volume        = 100
Max MPD volume        = 100
...
 
which is comparable to the output for your older moOde 6.4.0 / kernel 4.19.83

Code:
S Y S T E M   P A R A M E T E R S

moOde release = 6.4.0 2019-11-24
Raspbian OS = 10.2
Linux kernel = 4.19.83-v7l+ #1277
Platform = Pi-4B 4GB
Architecture = armv7l (32-bit)
...A U D I O   P A R A M E T E R S

Audio device = HiFiBerry DAC+ Pro
Interface = I2S
Mixer name = Digital
Hardware volume = Controller detected
Max ALSA volume = 100
...

With the Spotify renderer enabled, I played tracks from the Spotify client on my iPod. Switching randomly and rapidly from track to track in the playlist, I can detect only a faint "tick", sometimes, as the one track stops playing and the next starts playing. Nothing like the speaker-killing, nasty spikes you describe.

Then I swapped in the new librespot binary I built for you and rebooted moOde. Subjectively, I think the ticks are rarer and fainter but this may be expectation bias.

So, what does ALSA report while a track is playing?

Code:
pi@moodeHFB:~ $ cat /proc/asound/card0/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 44100 (352800/8)
period_size: 5513
buffer_size: 22052

Same as you report, including the odd rate (good guess, @DRONE7).

I have to keep packing boxes so this experiment is at an end for me.

Good luck.

Regards,
Kent
Reply
#55
Isn't the OP running a really old version of moOde, 640 I think?
Reply
#56
(10-14-2020, 02:51 AM)Tim Curtis Wrote: In a stock moOde config hw_params for Spotify renderer would show rate: 44100 (44100/1)

Do you know why your hw_params shows 44100 (352800/8) ?

It looks like the PCM stream being output from the Spotify renderer is being upsampled after the fact by ALSA.

It's very odd.

In the meantime I reflashed the SD again with the current moOde release (6.7.1 and I was already trying this before) and only set the 3 necessary bits: soundcard - spotify renderer on - ssh on.

Still the same, LOUD spikes between the skipping and FYI this output:

Code:
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 44100 (352800/8)
period_size: 225
buffer_size: 22050


(10-15-2020, 09:40 PM)TheOldPresbyope Wrote: With the Spotify renderer enabled, I played tracks from the Spotify client on my iPod. Switching randomly and rapidly from track to track in the playlist, I can detect only a faint "tick", sometimes, as the one track stops playing and the next starts playing. Nothing like the speaker-killing, nasty spikes you describe.

Thanks for making all the effort to check! Much appreciated!!
Could the ticks be louder because of the setup? I have active studiomonitors attached who's inputs are full on at 0 dB all times and change volume using the hardware mixer in the DAC board.
I also noticed a tick/spike now and then when clicking Disconnect in the big black Spotify Connect screen. Question on the side is: why the choice for this screen... not the case with other systems below Does Spotify Connect really have to block moOde completely?

Mmm, they still concern me, and can vary in loudness between acceptable and really extremely loud, so I am back and forth between various other distros, but I do not really like Volumio that much but learn to like it now, it is kind of OK if I compare it to Moode but the Spotify Connect plugin is giving other buggy glitches, like when you stop of skip you always hear the last half second of last played audio again. The Radio functionality is way better though.
And HiFiBerryOS, well, they have a particular minimalistic approach that is repelling. They do have done their technical under the hood bits allright with volumes and smoothness. You can even change the volumes of audio from your library with the iPhone, which is very pleasant. No illogical stuff like fighting volumes or strange maxed out situation (like, sorry, in moOde) and no spikes or (other buffer?) hickups. But finding music is laggy and especially navigating in an audio track is not possible (they are absolutely convinced that no one is using this in an audio player....).

Well...
It is still always better than the possibilities like some decades ago. So perhaps I have to learn to deal with the imperfectness. And keep away from HiFiBerry next time I buy a DAC board, which I might consider anyway at some point because I would love to have DSP.

Will give Moode a next try at v7 and actually hope for an improvement about the glitch discussed in this thread when something is changed “under the hood”.
It kinda surprises me that no one else did report this issue, besides one person in another thread who had a similar problem, not in relation with Spotify Direct but with the same DAC board.
Referring to http://moodeaudio.org/forum/showthread.php?tid=2301
Reply


Forum Jump: