bullen
Posts: 241
Joined: Sun Apr 28, 2013 2:52 pm

Re: Analogue audio testing

Fri Jun 02, 2017 9:12 pm

:) ok, looking forward to that... I bought a USB sound/mic dongle to see if that can help, but it takes to much space to be usable in practice...

Edit: and also it has a lot of whining too... will try a HDMI audio extractor next, but I guess it will also be whiny...
https://github.com/tinspin/rupy - A tiny Java async HTTP application server.

epoch1970
Posts: 2014
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Analogue audio testing

Tue Jul 04, 2017 8:59 pm

jdb wrote:...You can run two instances of speaker-test without the advanced audio but with it enabled one of the instances will always block...
Thanks for the info, I was struggling with concurrent audio access on a platform that had -quite understandably- "audio_pwm_mode=2" set.
Disabling it did the trick, along with lowering volume quite a lot to try to squelch the noise ;)
I hope you will achieve the goals you've set for general release. This new audio mode is really something to hear compared to the old one.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Mameinabox
Posts: 1
Joined: Fri Jul 28, 2017 3:20 pm

Re: Analogue audio testing

Fri Jul 28, 2017 3:25 pm

I just found a solution for this. The static noise was driving me nuts.

It seems that it is the usb port on the pi that interfered with my usb powered speaker.

I connected the usb powered speakers on a separate power source ( i used a cell phone charger ) and the static disappeared.

Steph

www.mameinabox.com
( The art of virtual gaming )

sylgar
Posts: 26
Joined: Wed Mar 23, 2016 10:39 pm

Re: Analogue audio testing

Thu Aug 24, 2017 9:47 am

Hello, is audio_pwm_mode=2 the default these days? Or should it still be set in config.txt?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5147
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Analogue audio testing

Thu Aug 24, 2017 3:37 pm

sylgar wrote:
Thu Aug 24, 2017 9:47 am
Hello, is audio_pwm_mode=2 the default these days? Or should it still be set in config.txt?
No there are still some issues so it needs to be enabled manually.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1784
Joined: Thu Jul 11, 2013 2:37 pm

Re: Analogue audio testing

Thu Aug 24, 2017 3:54 pm

I'm now in a position where I have some time available to look at this, so I can start fixing bugs Soon(tm) with a view to enabling this by default.

I've spotted one potential reason why Chromium/multiple writers aren't working - assuming my hunch is correct about how the firmware is handling separate buffer mixing.
Rockets are loud.
https://astro-pi.org

bullen
Posts: 241
Joined: Sun Apr 28, 2013 2:52 pm

Re: Analogue audio testing

Thu Aug 24, 2017 4:07 pm

:D
https://github.com/tinspin/rupy - A tiny Java async HTTP application server.

yjl
Posts: 21
Joined: Sun Aug 06, 2017 7:53 pm

Re: Analogue audio testing

Mon Sep 04, 2017 10:25 am

Thank you, it got absolutely better than before.

For someone who try to do this,
If you have recent Rpi,(more or less, mine is Rpi 3B), you don't need to do sudo Rpi-upgrade, this command seems for old versions or old time when the Rpi kernel package weren't structured.

Just do changed config file makes everything. I appreciate it so much!

guranbanan
Posts: 4
Joined: Mon Feb 13, 2017 8:35 am

Re: Analogue audio testing

Sun Sep 10, 2017 12:03 pm

Now I've also tested this new driver and the improvements are remarkable! Thanks a lot for making this!

The only problem I experience is the "pops" or "ticks" that have been mentioned earlier: short clicks resembling the pops you hear on a vinyl record, recurring randomly 2-3 times a minute.

Someone wrote that disabling "ram auto speed" by commenting out the "sdram_freq"-lines in "/boot/config.txt" solved the problem. That didn't work for me though. I'm using the Raspberry Pi 3b and those lines weren't present in my "config.txt". So instead I tried "force_turbo=1" and when that didn't help I tried adding the lines "sdram_freq_min=400" and "sdram_freq=400", thinking that if they have the same value there won't be any change in ram speed. That unfortunately didn't help either.

Does anyone happen to have any other tips on how to eliminate the 'ticks' and 'pops'? This isn't a big problem, but if it's possible to fix it would be great!

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1784
Joined: Thu Jul 11, 2013 2:37 pm

Re: Analogue audio testing

Mon Sep 11, 2017 12:53 pm

The SDRAM recalibration was on a 500ms interval, so that isn't causing your problem.

What other things are running on the Pi?

Typically you may run into FIFO underflow (that causes the ticks) if you are running GPU-intensive applications or are using high-quality HD deinterlace. Both of these put lots of bandwidth pressure on the memory controller which increases system latency.
Rockets are loud.
https://astro-pi.org

guranbanan
Posts: 4
Joined: Mon Feb 13, 2017 8:35 am

Re: Analogue audio testing

Wed Sep 13, 2017 9:39 am

Thanks, then I can rule out the SDRAM as the cause.

I haven't been playing any videos yet, only streaming audio. I think I'll describe it more thoroughly, and perhaps we will be able to rule out even more causes. :)

I'm streaming AAC 320 kbit/s, using omxplayer. Listening to local files does make the pops and clicks less common, but they're not absent. I'd like to correct my previous statement regarding the frequency of the artifacts and say that they occur between 3 and 6 times per minute while streaming, while playing local files that number is between 1 and 3. The pops vary in loudness and channel, sometimes they're in the left channel only, other times in the right and sometimes in both. The loudness varies from loud (I'd say about -9 dB) to quiet (can't really give a number, but quiet enough that you're able to miss it if not paying attention). This only happens when using the new implementation. Switching to the old way makes the pops disappear.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1784
Joined: Thu Jul 11, 2013 2:37 pm

Re: Analogue audio testing

Wed Sep 13, 2017 4:28 pm

I'm currently in the middle of rewriting the buffer handling code to allow for firmware-side mixing, so it's possible that the next release will incidentally fix the issue.

Can you attempt capture of a glitch? If you have a USB sound card (or pc) with line-in port, can you connect the Pi audio output to the line-in port and record an example with e.g. Audacity then post the .wav somewhere?
Rockets are loud.
https://astro-pi.org

guranbanan
Posts: 4
Joined: Mon Feb 13, 2017 8:35 am

Re: Analogue audio testing

Wed Sep 13, 2017 10:00 pm

That's great news! Here's a small snippet in which you can hear the "pop" three times: at 0.8 s, 1.5 s and 4.6 s.

http://shared.martingauffin.com/rpiblue.wav
click.png
A detailed view of one "pop", which lasts around 13 samples (of a 44100 Hz recording)
click.png (9.05 KiB) Viewed 2471 times

Now, I hope you're not letting this little issue take up too much of your time. After all, it's not very disturbing. It's a bit like listening to a vinyl record. :) Thanks!

ScottMayo
Posts: 2
Joined: Mon Sep 25, 2017 1:34 pm

Re: Analogue audio testing

Mon Sep 25, 2017 1:50 pm

I'm having horrible audio problems with by Pi 3.

Out of the box, using the headphone jack into a decent little amplifier, aplay badly distorts quiet passages, as if drowned in static. omxplayer distorts less, but it also seems to be boosting the volume so there's less quiet passages to distort. Either one lets me run multiple instances in parallel, and sounds mix as I'd expect.

I tried
audio_pwm_mode=2
and quiet passages got much clearer. But when playing multiple instances of anything, the sound stutters badly, playing bits of the clips in a random sequence, apparently no mixing at all. And there are clicks and pops.

I realize this is an inexpensive piece of hardware, but I didn't expect problems like this. Am I missing something? Will using a USB soundcard solve these issues?

guranbanan
Posts: 4
Joined: Mon Feb 13, 2017 8:35 am

Re: Analogue audio testing

Tue Sep 26, 2017 8:20 pm

Unfortunately, what you're describing is, as I understand, normal behavior. I can't comment on the multiple instance issue, since I've only tried playing audio only. And I haven't got any experience with USB sound cards for the Pi either, but my understanding is this (and I hope someone will correct me if I'm wrong):

the RPi doesn't have an onboard D/A-converter chip, so the method for sending analog audio is a more hackish one (using PWM i think?). Anyway, any USB sound card should come with it's own D/A-converter, and I think most modern converters of this sort is capable of at least CD quality sound.

So I think you can buy a USB sound card and feel safe. Or perhaps one of those DAC hats that connects to the GPIO? But again, I don't have any experience with those things so it's probably a good idea to do some research before buying.

But, another thing: the static noise from the Pi can get worse if it's connected to something that causes interference. For example, if I power the Pi from the USB port of my set-top-box, and this set-top-box is connected to the same amp as the Pi, there will be a lot of noise. So it might be a good idea to experiment with different power sources or different connections.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1784
Joined: Thu Jul 11, 2013 2:37 pm

Re: Analogue audio testing

Wed Oct 11, 2017 11:08 pm

Please continue discussion/testing in the new thread -> viewtopic.php?f=29&t=195178
Rockets are loud.
https://astro-pi.org

Return to “Advanced users”

Who is online

Users browsing this forum: cjan, DarkElvenAngel and 15 guests