WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: USB Audio Problem (piCore 5.2 final. 24 bit)  (Read 10992 times)

Offline CodenameMAT

  • Newbie
  • *
  • Posts: 16
Re: USB Audio Problem (piCore 5.2 final. 24 bit)
« Reply #15 on: March 04, 2014, 01:30:10 PM »
Thank you! Much appreciated.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: USB Audio Problem (piCore 5.2 final. 24 bit)
« Reply #16 on: March 05, 2014, 02:51:17 AM »
mpd.tcz posted as well as clients ncmpc.tcz and ncmpcpp.tcz
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline CodenameMAT

  • Newbie
  • *
  • Posts: 16
Re: USB Audio Problem (piCore 5.2 final. 24 bit)
« Reply #17 on: March 05, 2014, 07:14:35 AM »
Brilliant! Thanks so much. Will test it when I get home later.

Offline CodenameMAT

  • Newbie
  • *
  • Posts: 16
Re: USB Audio Problem (piCore 5.2 final. 24 bit)
« Reply #18 on: March 05, 2014, 01:58:16 PM »
unfortunately, there's no change. I'm still experiencing the same problem with playback at 24bit. It's quite frustrating actually!
I even used a fresh install of piCore. did tce-load -wi mpd ncmpcpp alsa and ran mpd and I'm still hearing constant noise over the top of any audio at 24bit.

Something very strange I did notice though. Immediately upon starting mpd, it begins to build the database of music (from the specified music directory) while this was happening, the cpu was busy reading files etc. etc. I started to play a song while the DB was being built and there was NO NOISE, it sounded perfect. as SOON as the database was built the noise started. What could cause this really? I'm no hardware guy but drivers? IRQ problems?...I would put all my problems down to the USB DAC if it wasn't for the fact that it works perfectly at 24bit with the PiBang distro. I'm going to try shortly with Arch Linux + mpd and see what the results are.

so far, I've tried a lot. different nice settings, 'noswap' in the cmdline.txt it's just all very strange.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: USB Audio Problem (piCore 5.2 final. 24 bit)
« Reply #19 on: March 05, 2014, 02:06:48 PM »
Is it related to the daemon or client? What is about listening with a client on a different machine or listening with a client on RPi a server running on another machine?

Did you try to increase ALSA buffer size?
« Last Edit: March 05, 2014, 02:08:41 PM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11041
Re: USB Audio Problem (piCore 5.2 final. 24 bit)
« Reply #20 on: March 05, 2014, 02:11:51 PM »
Noise depending on cpu load sounds like voltage issues. Try powered usb hub, etc.
The only barriers that can stop you are the ones you create yourself.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: USB Audio Problem (piCore 5.2 final. 24 bit)
« Reply #21 on: March 05, 2014, 03:08:50 PM »
Such crackling noise is usually caused by resampling or buffering problems. When system is busy, it slows down and can't fill buffer too fast, which results lack of crackling. Increasing buffer size can eliminate it adding some delay to processing.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline CodenameMAT

  • Newbie
  • *
  • Posts: 16
Re: USB Audio Problem (piCore 5.2 final. 24 bit)
« Reply #22 on: March 05, 2014, 04:43:43 PM »
After quite a bit of testing between piCore and Arch Linux (both fresh installs) it has to be something on piCore's end
Arch has no problems with 16 or 24 bit. piCore has the noise when playing 24bit.
I was starting to suspect madlib (mpd's mp3 decoder) so I tried with a 44.1k 24bit FLAC and got the same results. I also swapped between direct USB port and powered hub (btw, my DAC is externally powered)

It MUST be something to do with piCore and how it deals with mpd. Or, piCore is doing something that mpd really doesn't like.
aplay worked correctly with a 96k 24bit wave file but anything via mpd and it has a problem.

Thanks for all your help guys. mpd has no problem at all on piCore with 16bit music but I had hoped to build an "Audiophile" system with my new DAC and play around a bit. For now, it looks like I'll have to reluctantly stick with Arch. btw here's a verbose portion of the mpd log from each respective distro playing exactly the same FLAC file.

piCore mpd log
Code: [Select]
Mar 05 21:15 : decoder_thread: probing plugin flac
Mar 05 21:15 : decoder: audio_format=44100:24:2, seekable=true
...
Mar 05 21:15 : alsa_output: opened hw:0,0 type=HW
Mar 05 21:15 : alsa_output: format=S24_3LE (Signed 24 bit Little Endian in 3bytes)
Mar 05 21:15 : alsa_output: buffer: size=90..174762 time=2040..3962858
Mar 05 21:15 : alsa_output: period: size=45..87381 time=1020..1981429
Mar 05 21:15 : alsa_output: default period_time = buffer_time/4 = 500000/4 = 125000
Mar 05 21:15 : alsa_output: buffer_size=22050 period_size=5513
Mar 05 21:15 : output: opened plugin=alsa name="My ALSA Device" audio_format=44100:24:2

Arch linux
Code: [Select]
Mar 05 14:24 : decoder_thread: probing plugin flac
Mar 05 14:24 : decoder: audio_format=44100:24:2, seekable=true
Mar 05 14:24 : alsa_output: opened hw:1,0 type=HW
Mar 05 14:24 : alsa_output: format=S24_3LE (Signed 24 bit Little Endian in 3bytes)
Mar 05 14:24 : alsa_output: buffer: size=90..174762 time=2040..3962858
Mar 05 14:24 : alsa_output: period: size=45..87381 time=1020..1981429
Mar 05 14:24 : alsa_output: default period_time = buffer_time/4 = 500000/4 = 125000
Mar 05 14:24 : alsa_output: buffer_size=22050 period_size=5513
Mar 05 14:24 : output: opened plugin=alsa name="My ALSA Device" audio_format=44100:24:2

as you can see, buffer sizes etc. are identical. I'm really stumped. Hopefully we'll see a fix for this in the future. I'm suspecting the problem will affect any 24bit DAC.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: USB Audio Problem (piCore 5.2 final. 24 bit)
« Reply #23 on: March 05, 2014, 04:55:07 PM »
Can you provide the file you are playing and noisy?
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline CodenameMAT

  • Newbie
  • *
  • Posts: 16
Re: USB Audio Problem (piCore 5.2 final. 24 bit)
« Reply #24 on: March 05, 2014, 05:02:27 PM »
It's just a regular FLAC. The main thing would be the 24bit capable DAC. My Behringer UCA202 is fine (but limited to 16bit)

Could it be possible that there's a kernel module conflict? I tried modprobe -r for the onboard sound bcm2835

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: USB Audio Problem (piCore 5.2 final. 24 bit)
« Reply #25 on: March 06, 2014, 01:10:53 AM »
If you play 24-bit files with ffplay (ffmpeg2.tcz) do you get the same crackling noise?

Quote
Something very strange I did notice though. Immediately upon starting mpd, it begins to build the database of music (from the specified music directory) while this was happening, the cpu was busy reading files etc. etc. I started to play a song while the DB was being built and there was NO NOISE

Can you load the CPU during playback for example compressing a longer file during MPD playback for 5-10 seconds to see whether nois goes away during?
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline CodenameMAT

  • Newbie
  • *
  • Posts: 16
Re: USB Audio Problem (piCore 5.2 final. 24 bit)
« Reply #26 on: March 06, 2014, 01:26:45 AM »
I'll try ffmpeg. I also noticed that even something like scrolling through the log in nan stopped the noise.

Play song
Open nano
Hold page down = no noise. As soon as I stop holding page down the noise returns.

 I realise all this sounds incredibly weird. I'm finding it hard to believe myself! Btw, I'm running the ssh version of picore.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: USB Audio Problem (piCore 5.2 final. 24 bit)
« Reply #27 on: March 06, 2014, 02:02:17 AM »
Still I would increase ALSA buffer size.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: USB Audio Problem (piCore 5.2 final. 24 bit)
« Reply #28 on: March 06, 2014, 02:43:29 AM »
This article may help: http://www.raspyfi.com/raspberry-pi-usb-audio-fix/

Omit Rpi firmware update part as we have the current firmware already, but other parts may be useful.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: USB Audio Problem (piCore 5.2 final. 24 bit)
« Reply #29 on: March 06, 2014, 07:28:54 AM »
Sorry for seeing your post ealier.

In the piCorePlayer I always use:
smsc95xx.turbo_mode=N   
in the cmdline.txt file. It helps on some of these crackling noises. So I will suggest that you try this (if you haven't already).

Steen