grin
Posts: 4
Joined: Mon Apr 11, 2016 3:19 pm

Re: Analogue audio testing

Tue Apr 12, 2016 2:06 pm

Great work. But the sound quality is still far behind of a chinese dac (based on pcm2704), value $ 5 :)

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

Re: Analogue audio testing

Tue Apr 12, 2016 2:53 pm

tpfkanep wrote: Just have an issue with playing audio via Kodi: audio (mp3) plays in start/stop fashion every few seconds. Other media's audio plays fine.

Is this a Kodi issue?
Do you still have the issue when audio_pwm_mode=2 is removed?
If you don't then it's a audio_pwm_mode issue which belongs here.
If you do then it needs to be reported in a kodi thread.

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

Re: Analogue audio testing

Tue Apr 12, 2016 2:54 pm

grin wrote:Great work. But the sound quality is still far behind of a chinese dac (based on pcm2704), value $ 5 :)
And the audio circuitry on a Pi3 costs much much less than $5. You are still free to use an external audio device if you choose.

grin
Posts: 4
Joined: Mon Apr 11, 2016 3:19 pm

Re: Analogue audio testing

Tue Apr 12, 2016 3:36 pm

dom wrote: And the audio circuitry on a Pi3 costs much much less than $5.
So it's a whole sound card. With coaxial, optical and analog outputs, usb port, capacitors, etc. And it's not a factory price.
The chip itself costs probably 1 dollar or less :)

tpfkanep
Posts: 16
Joined: Mon Feb 29, 2016 8:34 am

Re: Analogue audio testing

Tue Apr 12, 2016 3:56 pm

dom wrote:
tpfkanep wrote: Just have an issue with playing audio via Kodi: audio (mp3) plays in start/stop fashion every few seconds. Other media's audio plays fine.

Is this a Kodi issue?
Do you still have the issue when audio_pwm_mode=2 is removed?
If you don't then it's a audio_pwm_mode issue which belongs here.
If you do then it needs to be reported in a kodi thread.
Removing audio_pwm_mode=2 did the trick! Please accept my humble thanks for all the effort that was put into fixing this.

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

Re: Analogue audio testing

Tue Apr 12, 2016 4:21 pm

grin wrote:Great work. But the sound quality is still far behind of a chinese dac (based on pcm2704), value $ 5 :)
Got any measurements to back that claim up?
tpfkanep wrote:
dom wrote:
tpfkanep wrote: Just have an issue with playing audio via Kodi: audio (mp3) plays in start/stop fashion every few seconds. Other media's audio plays fine.

Is this a Kodi issue?
Do you still have the issue when audio_pwm_mode=2 is removed?
If you don't then it's a audio_pwm_mode issue which belongs here.
If you do then it needs to be reported in a kodi thread.
Removing audio_pwm_mode=2 did the trick! Please accept my humble thanks for all the effort that was put into fixing this.
That means that it's an audio_pwm_mode=2 problem. What audio/video are you playing with Kodi? Can you upload a sample file somewhere?
Rockets are loud.
https://astro-pi.org

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

Re: Analogue audio testing

Wed Apr 13, 2016 9:30 am

@jdb: since you mentioned it sounded like buffer underrun, we did some more prebuffering in the kernel code to accommodate the audio_pwm_mode=2 setting (which therefore apparently makes the GPU read data faster) and now the sound is all right.

Thanks for your time and explanations.

mkkyah
Posts: 31
Joined: Fri Jan 25, 2013 2:32 pm

Re: Analogue audio testing

Wed Apr 13, 2016 10:27 am

grin wrote:Great work. But the sound quality is still far behind of a chinese dac (based on pcm2704), value $ 5 :)
Grin, you can try to use a software equalizer for a better sound. Max2play has an integrated one, but I think you can install and use one to every image. It's definitely improving the sound, but to be honest I don't use it on my Philips Docks, they sound good enough to me.( I had to choose between equalizer and SD card write protection!) At the end, my 10 $ creative usb dacs are maybe a little bit better in sound quality, who cares.
I didn't even bother to use pwm=2 mode on my main audio system, but it's huge difference for small systems, where simplicity, small foot print, less components, to be cheap( every single dollar makes small projects meaningless sometimes) is important. I have to add that Pi A+ is perfect now for small player projects, because usb output is used for wifi and you don't need a hub to plug a usb dac.

Until now analog audio out was no option even for the less desirable audio device in my home. I can only be angry about this project, because it came sooo late!

For the feedback part: my 2 players are running without a problem and distortion for days.

Horendus
Posts: 31
Joined: Fri Feb 05, 2016 9:07 am

Re: Analogue audio testing

Thu Apr 14, 2016 12:23 am

Has anyone else found issues with the audio driver falling over with continues play on MPLAYER?

As I mentioned in a previous post, running an MPLAYER playlist for a number of hours on LOOP playback results in playback stopping. If you try to restart playback MPLAYER returns this error for not being able to restart playback

AO: [pulse] Init failed: Connection refused.

Reboot required to get it running again

Raspberry Pi2
Jessie Lite (latest ap-get update / upgrade)
Latest (latest rpi-update)

fievel
Posts: 2
Joined: Tue Apr 21, 2015 8:42 am

Re: Analogue audio testing

Thu Apr 14, 2016 7:20 am

OMG, great quality enhancement.

Pi noise was horrible when using headphones, to the point I could not use it to listen to internet radio stations that way.

With the new audio implementation, noise is gone.

Thanks

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

Re: Analogue audio testing

Thu Apr 14, 2016 10:33 am

Horendus wrote:Has anyone else found issues with the audio driver falling over with continues play on MPLAYER?

As I mentioned in a previous post, running an MPLAYER playlist for a number of hours on LOOP playback results in playback stopping. If you try to restart playback MPLAYER returns this error for not being able to restart playback

AO: [pulse] Init failed: Connection refused.

Reboot required to get it running again

Raspberry Pi2
Jessie Lite (latest ap-get update / upgrade)
Latest (latest rpi-update)
Can you post the mplayer command you are using?
Rockets are loud.
https://astro-pi.org

tpfkanep
Posts: 16
Joined: Mon Feb 29, 2016 8:34 am

Re: Analogue audio testing

Fri Apr 15, 2016 11:47 am

jdb wrote:That means that it's an audio_pwm_mode=2 problem. What audio/video are you playing with Kodi? Can you upload a sample file somewhere?
I think I made a balls-up... It looks like I rebooted in another terminal whilst not saving my config.txt when I commented out the audio_pwm_mode=2. There is a config.txt.save file in my boot partition with #audio_pwm_mode=2 :oops:

So:
1] Standard config: distortions in kodi and deadbeef
2] With the changes incl. audio_pwm_mode=2: deadbeef plays great, kodi does not.
disable_pvt=1
force_turbo=1
audio_pwm_mode=2
audio_sdm_mod_order=2
3] With the changes but with audio_pwm_mode=2 removed: distortions in kodi and deadbeef.
disable_pvt=1
force_turbo=1
#audio_pwm_mode=2
audio_sdm_mod_order=2
MP3 sample: https://file.io/HnsTAi

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

Re: Analogue audio testing

Fri Apr 15, 2016 12:45 pm

tpfkanep wrote: MP3 sample: https://file.io/HnsTAi
The link is a 404?
Rockets are loud.
https://astro-pi.org


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

Re: Analogue audio testing

Fri Apr 15, 2016 5:45 pm

So you're just using Kodi to play an audio file with no other GPU/video interaction?
Rockets are loud.
https://astro-pi.org

tpfkanep
Posts: 16
Joined: Mon Feb 29, 2016 8:34 am

Re: Analogue audio testing

Fri Apr 15, 2016 6:35 pm

Yes.

But playing video files also result in weird audio behaviour with the audio_pwm_mode=2 setting.

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

Re: Analogue audio testing

Sun Apr 17, 2016 12:54 pm

Latest rpi-update firmware contains these fixes from jdb

Code: Select all

    - Use saturating arithmetic for modulators, preventing signed wraps
    - Report zero latency if less than a pcm_block_size of samples are available in the pcm buffer

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

Re: Analogue audio testing

Sun Apr 17, 2016 5:43 pm

With the new firmware (commit 9628ed8) and option audio_pwm_mode=2 in config.txt, sound is horrible, noise is back, back to how it was before you introduced the new driver.

What happened? Previous firmware version was so neat with regards to analogue sound quality... Reverting to it.

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

Re: Analogue audio testing

Sun Apr 17, 2016 7:39 pm

You're right - it is screwed up. Wierdly the right channel is broken but the left is fine - smells like finger trouble. Recommend using the previous version for now.
Rockets are loud.
https://astro-pi.org

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

Re: Analogue audio testing

Sun Apr 17, 2016 7:42 pm

No problem, keep up the good work. Analogue audio is important to me, and your new driver is incredible.

__Plasma__
Posts: 27
Joined: Sat Mar 05, 2016 9:31 pm

Re: Analogue audio testing

Mon Apr 18, 2016 12:31 pm

This sounds like just the medicine for my rPi 3. How can I tell which version I am on? I did an "rpi-update" yesterday and have:

Code: Select all

pi@raspberrypi:~ $ ls -l /boot
total 20074
-rwxr-xr-x 1 root root   12814 Apr 17 17:54 bcm2708-rpi-b.dtb
-rwxr-xr-x 1 root root   13153 Apr 17 17:54 bcm2708-rpi-b-plus.dtb
-rwxr-xr-x 1 root root   12802 Apr 17 17:54 bcm2708-rpi-cm.dtb
-rwxr-xr-x 1 root root   14420 Apr 17 17:54 bcm2709-rpi-2-b.dtb
-rwxr-xr-x 1 root root   15102 Apr 17 17:54 bcm2710-rpi-3-b.dtb
-rwxr-xr-x 1 root root   17924 Apr 17 17:54 bootcode.bin
-rwxr-xr-x 1 root root     136 Mar 24 17:24 cmdline.txt
-rwxr-xr-x 1 root root    1818 Apr  8 16:08 config.txt
-rwxr-xr-x 1 root root   18693 Mar 24 17:24 COPYING.linux
-rwxr-xr-x 1 root root    2512 Apr 17 17:54 fixup_cd.dat
-rwxr-xr-x 1 root root    6482 Apr 17 17:54 fixup.dat
-rwxr-xr-x 1 root root    9727 Apr 17 17:54 fixup_db.dat
-rwxr-xr-x 1 root root    9727 Apr 17 17:54 fixup_x.dat
-rwxr-xr-x 1 root root     103 Feb 26 02:20 issue.txt
-rwxr-xr-x 1 root root 4182304 Apr 17 17:54 kernel7.img
-rwxr-xr-x 1 root root 4080280 Apr 17 17:54 kernel.img
-rwxr-xr-x 1 root root    1494 Mar 24 17:24 LICENCE.broadcom
-rwxr-xr-x 1 root root   18974 Feb 26 02:20 LICENSE.oracle
-rwxr-xr-x 1 root root     294 Jan  1  1980 os_config.json
drwxr-xr-x 2 root root   12288 Apr 17 17:54 overlays
-rwxr-xr-x 1 root root  616344 Apr 17 17:53 start_cd.elf
-rwxr-xr-x 1 root root 4892104 Apr 17 17:53 start_db.elf
-rwxr-xr-x 1 root root 2743448 Apr 17 17:53 start.elf
-rwxr-xr-x 1 root root 3844360 Apr 17 17:54 start_x.elf

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.4.7-v7+ #877 SMP Sun Apr 17 12:48:36 BST 2016 armv7l GNU/Linux
pi@raspberrypi:~ $ 
Also can I confirm the only change now required to my config.txt is:

Code: Select all

audio_pwm_mode=2
Great work, and thanks for your commitment to the project!

Plasma

User avatar
piglet
Posts: 797
Joined: Sat Aug 27, 2011 1:16 pm

Re: Analogue audio testing

Mon Apr 18, 2016 1:34 pm

Ahh - tried this for the first time yesterday with one channel through an amp to a speaker - and got lots of very very loud noise as I moved the mouse. I guess it was the bad channel I was boosting!

I didn't get any further than that as from a new Rasbian install from the download section + raspi update, Sonic Pi wouldn't start...some kind of server error...

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

Re: Analogue audio testing

Tue Apr 19, 2016 3:29 pm

I can reproduce the issue with Kodi, which appears to be a new and interesting problem.

The current firmware does indeed have a bug with the raw output - the optimising compiler helpfully optimised around one of my inline asm calls.
Rockets are loud.
https://astro-pi.org

__Plasma__
Posts: 27
Joined: Sat Mar 05, 2016 9:31 pm

Re: Analogue audio testing

Tue Apr 19, 2016 3:37 pm

I've been doing some testing this afternoon with my rPi 3 but I think I have the version with the bug as I get garbage out of one channel, and a whistle on top of sound coming from the other. So I will await a fix for the noise and then re-run my tests.

Kind Regards
Plasma

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

Re: Analogue audio testing

Tue Apr 19, 2016 3:44 pm

Use the version from sudo rpi-update 1e84c2891c1853a3628aed59c06de0315d13c4f1 until a fix is pushed.
Rockets are loud.
https://astro-pi.org

Return to “Advanced users”

Who is online

Users browsing this forum: Baidu [Spider], dom and 13 guests