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

Re: Analogue audio redux

Thu May 31, 2018 7:37 am

Multiple audio streams should be supported. It was one of the reasons for rewriting the buffer handling code from the first version.

Do you get the same or different behaviour if you revert to the old driver (audio_pwm_mode=1)?
Rockets are loud.
https://astro-pi.org

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

Re: Analogue audio redux

Thu May 31, 2018 9:43 am

jdb wrote:
Thu May 31, 2018 7:37 am
Do you get the same or different behaviour if you revert to the old driver (audio_pwm_mode=1)?
Thanks!

I have set audio_pwm_mode=1 on my machine.
Following the same steps as in the other post, the system behaves as expected. Streams can start/stop independently and are remixed when restarted.

(This is on a test SD, I don't care much about the system there. Let me know if you need me to further test/install stuff.)
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

niwa3836
Posts: 53
Joined: Mon Nov 05, 2012 9:08 pm

Re: Analogue audio redux

Thu May 31, 2018 11:07 am

Hi jdb / epoch1970,

I've re-performed the test too for completeness as i have a unit that is completely fresh (3B+).
Test 1:
dtparam=audio=on
audio_pwm_mode=1
window 1: start audio (good)
window 2: start audio (good and mixing with first)
window 1, stop and restart same audio (good)
Test 2:
dtparam=audio=on
audio_pwm_mode=2
window 1: start audio (good)
window 2: start audio (good and mixing with first)
window 1, stop and restart same audio (BAD).

I love the audio quality of mode 2 (over mode 1) and would love to know if this could be fixed :) Any ideas what could cause it (I really do use the feature of mixing a lot!). Can I help in any way? If anyone spots the fix could you please let me know, really many thanks for everyone's help so far!

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

Re: Analogue audio redux

Thu May 31, 2018 6:16 pm

OK that confirms the bug, then. Multi-stream "hardware" mixed playback (actually done on the VPU) is one of the target use-cases for the driver.

The mixing is done at the same stage as the fractional rate conversion - we use an oddball internal samplerate (48828.125Hz) so that we can then use much cheaper integer-factor resampling to produce the 781250Hz samplerate that goes to the PWM controller. The fractional resample stage should seamlessly handle mixing from multiple sources as it's VC4 library code in use across both drivers.

My time is somewhat constrained at the moment but I'll take a look the next time I'm in the vicinity of VC4 firmware.
Rockets are loud.
https://astro-pi.org

niwa3836
Posts: 53
Joined: Mon Nov 05, 2012 9:08 pm

Re: Analogue audio redux

Fri Jun 01, 2018 8:08 am

Hi jdb,

Many thanks for responding and confirming that it is a bug. The calculations look very complex! This is really important for me for lots of reasons and therefore how much rocket fuel do you need me to supply to help fix this? My project is in your hands! (joking apart is there anything else I need to do to help / be formal etc as needed?). Many thanks for your help so far!

niwa3836
Posts: 53
Joined: Mon Nov 05, 2012 9:08 pm

Re: Analogue audio redux

Thu Jun 14, 2018 6:25 pm

Hi jdb et al,

Naturally really keen to follow this and see if / when a fix would become available. Serious question (and sorry if I'm asking a silly question), is there somewhere else I should be watching for any great announcements regarding this? Really keen to use the mode 2 options with all the great enhancements that it provides. Many thanks for your help and advise.

theonlychriss
Posts: 1
Joined: Sun Jun 17, 2018 10:38 am

Re: Analogue audio redux

Sun Jun 17, 2018 10:52 am

Hi jdb et al,

maybe my observations can contribute a bit more:
If the CPU is under fairly/heavy use, i.e. the higher the usage, the more the sound distortion occurs and the quicker the sound (and video application) stops working with a loud "plopp" until a reboot.
By high load, what I've noticed, I mean high computational usage (compiling stuff, image recognition e.g. via "motion" with a RPI-Cam) and/or high network load. It is easily reproducible.
I do not use multiplexed sound, at least not that I'm aware of it. There is only one application using the analog sound output at a time: Either it is Kodi, or a TV frontend, called "VDR".

I already bought a new RPi3 B+, because I thought my "old" RPi3 was slowly dying with this sound phenomenon as a symptom. Observing the very same behavior with the new one drove me crazy, until I finally found this post ...
If I can help anyhow, I'd be glad to support.

Cheers,
Chriss

Return to “Advanced users”

Who is online

Users browsing this forum: No registered users and 22 guests