INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Rpi audio micro freeze on USB playback (resolved)  (Read 4169 times)

erviv

  • World Citizen
  • ***
  • Posts: 220
Rpi audio micro freeze on USB playback (resolved)
« on: January 19, 2018, 10:12:39 pm »

I have MC23 ver 93 installed on my RPi 3.  I play music two ways, both initiated by JRemote:

(1) initiate the play command from JRemote on my iPad to the rpi. The rpi sends the audio signal out via usb to a DAC (Bryston BDA2, and then through my pre-amp, amp to speakers) and

(2)  initiate the play command from JRemote on my iPod.  The audio signal travels from the rpi to the iPod via wifi and then out through a DAC (CypherLabs AlgoRhythm Solo -R, and then through a receiver and speakers). 

I would have thought that audio via wifi would experience issues, however the opposite is the case.  I have not noticed any audio micro dropouts/freezes via the iPod.  However I do get random micro freezes (stop/starts) via the usb output.  The playback stops and then in less than a second continues to playback from where it stopped.

I have set my thread priorities as per instructions in this forum, and also have checked the disable audio buffer to disk in the Tools/Options/Media Network/ Advanced.  This seems to have helped reduce the frequency and duration of the micro freezes. However the problem persists.

Has anyone overcome a similar problem?
Logged
MacBook Pro i5 2.3Ghz 8 GB (early 2011) 1Tb SSD; 3 Raspberry pi’s 4 and 2@ 3B (o/s: Buster).

Zhillsguy

  • Galactic Citizen
  • ****
  • Posts: 325
Re: Rpi audio micro freeze on USB playback
« Reply #1 on: January 19, 2018, 10:45:37 pm »

I can't speak to your exact problem.... but I have been tinkering with a Pi3 now for a few weeks. It is also set up with thread priorities, latest build, etc. In my experience:

1. If the Pi is "busy" such as importing, building thumbnails, etc. it can hiccup. Once it settles in it is fine.

2. Since the Pi's USB bus includes the network adapters, it can get bottlenecked fairly easily, causing buffering/hiccups. I haven't had good luck using its wireless for anything other than maybe MP3 playback. I recommend the ethernet port, not wifi.

3. Playing hi res audio works to an extent, but I recommend using a DAC that natively supports whatever bitrate you are playing. Make sure in MC your DAC is using a hw:, plughw:, or front: ALSA connection with no conversions. Converting bit rates on the fly can cause buffering/stuttering. Use only whatever DSP is necessary. I recently bought a hifiberry and it plays natively very well up to 192 KHz. I really like it.

4.  I haven't found much difference whether playing from the Main Library, a server library, or as a DLNA renderer (if no conversion is used).

Keep an eye on the CPU usage during various routines, maybe you can figure it out. Playing 192KHz files natively uses typically between 10-15%. When that little CPU spikes up it can cause audio problems. It could be you are not experiencing issues playing to the IPod because it is down-converting, and the USB is playing full native format. You didn't mention what files you are playing or what the source is (network, attached drive, etc.). Keep in mind all the data in/out of the pi is on the same USB bus. Keeping the data bandwidth within reason helps.

Hope this helps.

Logged
Ryzen 5 W11 x64 MC 29 HTPC/Server and HP G2 Mini Elitedesk W11 MC 29 (music only zone), various Android Phones and Tablets for control of both, powering two lanai surround systems, 5.1 and 4.1 respectively.

erviv

  • World Citizen
  • ***
  • Posts: 220
Re: Rpi audio micro freeze on USB playback
« Reply #2 on: January 20, 2018, 08:43:19 am »


Thanks for the feedback. 
I have micro freezes on CD quality playback as well as hi-res audio (192k).  The music source in both cases is the same.  It is a hard wired via network cable to a router which has a hard drive connected to the router.  Since the source is the same in both cases I was thinking that it is not the problem.
I believe  the rpi/MC is down converting when sending over wifi an audio signal to the iPod.  It is interesting though that down converting does not result in micro freezes while sending out natively does. I would think down converting uses more resources than sending out an unconverted signal.  This would lead me to look at the USB as being the issue.  The issue then is how to fix this.   An option, as you have shown, is the use of another audio digital output mechanism, eg hifi berry.  Still I am hoping for a solution within MC settings.  I will try logging the error and see if anything jumps out at me.  I looked previously and nothing was obvious to me.
My Bryston DAC does natively support the bitrates that is being played.  The Bryston is recognized by MC and I have selected the hw: version with no conversions.
I will investigate further and watch the CPU usage.
Logged
MacBook Pro i5 2.3Ghz 8 GB (early 2011) 1Tb SSD; 3 Raspberry pi’s 4 and 2@ 3B (o/s: Buster).

astropuppy

  • Junior Woodchuck
  • **
  • Posts: 56
Re: Rpi audio micro freeze on USB playback
« Reply #3 on: January 24, 2018, 08:34:20 am »

Thanks for the feedback. 
I have micro freezes on CD quality playback as well as hi-res audio (192k).  The music source in both cases is the same.  It is a hard wired via network cable to a router which has a hard drive connected to the router.  Since the source is the same in both cases I was thinking that it is not the problem.
I believe  the rpi/MC is down converting when sending over wifi an audio signal to the iPod.  It is interesting though that down converting does not result in micro freezes while sending out natively does. I would think down converting uses more resources than sending out an unconverted signal.  This would lead me to look at the USB as being the issue.  The issue then is how to fix this.   An option, as you have shown, is the use of another audio digital output mechanism, eg hifi berry.  Still I am hoping for a solution within MC settings.  I will try logging the error and see if anything jumps out at me.  I looked previously and nothing was obvious to me.
My Bryston DAC does natively support the bitrates that is being played.  The Bryston is recognized by MC and I have selected the hw: version with no conversions.
I will investigate further and watch the CPU usage.

I would plug the hard drive plugged into the router directly into the PI as a test. Generally speaking, routers have small cpu's.

Just an idea.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72549
  • Where did I put my teeth?
Re: Rpi audio micro freeze on USB playback
« Reply #4 on: January 24, 2018, 10:05:44 am »

And a hard drive plugged into a Pi may not have enough power.
Logged

erviv

  • World Citizen
  • ***
  • Posts: 220
Re: Rpi audio micro freeze on USB playback
« Reply #5 on: January 25, 2018, 06:48:09 pm »

I wasn't thinking that my router attached hard drive was the source of my micro freezes, as I don't get any audio dropouts when playing from it to my iPod, but do through the usb output. 
 However I will give it a go.  It has its own power supply, so that won't be an issue.  I won't be able to test this out for several weeks as I just dismantled my system to make way for some renovations.  I am replacing my popcorn ceiling with a flat drywall ceiling.  The old ceiling is now removed, and I am off to get drywall tomorrow.  As I am slow at muddling and taping, it will be a few weeks before I can re-install my audio system. 
I am also wondering if Debian stretch instead of Jessie might help.
Logged
MacBook Pro i5 2.3Ghz 8 GB (early 2011) 1Tb SSD; 3 Raspberry pi’s 4 and 2@ 3B (o/s: Buster).

erviv

  • World Citizen
  • ***
  • Posts: 220
Re: Rpi audio micro freeze on USB playback
« Reply #6 on: March 20, 2018, 06:01:10 pm »

Ok, Reno’s done. I tried plugging my hard drive directly into the rpi.  No noticeable difference.  I am still getting the occasional mini-freeze.
Has anyone solved this issue with a pi-hat.  I noticed the same issue when I used the rpi as a server to my MacBook. Note I don’t have this issue when I use my MacBook as a stand-alone JRiver player.
So I am believing this is a pi issue.
Logged
MacBook Pro i5 2.3Ghz 8 GB (early 2011) 1Tb SSD; 3 Raspberry pi’s 4 and 2@ 3B (o/s: Buster).

erviv

  • World Citizen
  • ***
  • Posts: 220
Re: Rpi audio micro freeze on USB playback
« Reply #7 on: March 28, 2018, 02:50:11 pm »

OK the problem seems to be eliminated.  I did a completely new install on a second Rpi3 model B I have.  I used the latest NOOBS, which uses Raspbian Stretch. I only installed Raspbian from NOOBS on my other 32GB SD card.  I followed the instructions from this site to load MC23, although I have not adjusted the thread priorities.   I registered the fresh install of MC23 with my Master licence registration code for MC24. (Although for some reason JRiver consider this a license restore, as opposed to a new install. Not a big deal unless I do this 9 more times).
I have been listening for the past hour and have not had any audio issues. 
Audio out is still via USB to my DAC and the media files are still stored in my router attached powered external drive.  The Rpi is connected to the router via Ethernet with a 8 port managed switch in between.
Sometime over the next week I will upgrade the operating system from Jessie to stretch on the original SD card and RPi to see if that clears up the audio freezes there also.
Logged
MacBook Pro i5 2.3Ghz 8 GB (early 2011) 1Tb SSD; 3 Raspberry pi’s 4 and 2@ 3B (o/s: Buster).
Pages: [1]   Go Up