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

Re: Analogue audio redux

Mon Jan 01, 2018 6:55 pm

Hi, is this patch in the latest raspbian release?
https://github.com/tinspin/rupy - A tiny Java async HTTP application server.

User avatar
algorithm
Posts: 168
Joined: Mon Nov 25, 2013 9:09 pm
Location: Flatland

Re: Analogue audio redux

Thu Jan 11, 2018 10:21 am

bullen wrote:
Mon Jan 01, 2018 6:55 pm
Hi, is this patch in the latest raspbian release?
I don't know about the latest Raspbian release but here's how to try it, from the first post: "add audio_pwm_mode=2 to /boot/config.txt and reboot." I imagine this works if your firmware is at least as new as that first post which was from Wed 11 Oct 2017. Check with "uname -v". If it's older, first do "sudo apt-get update && sudo apt-get -y dist-upgrade" and try again. If it's still too old, you might or might not try "sudo rpi-update" which goes well 99% of the time. If you do and it does go well, then it will definitely work.

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

Re: Analogue audio redux

Thu Jan 11, 2018 5:19 pm

Works!

Thx jdb and algorithm!

Now my 3D Space Shooter works 99%!

The only tiny bug is that "text to voice" doesn't seem to work.

java.lang.IllegalArgumentException: No line matching interface SourceDataLine supporting format PCM_SIGNED 48000.0 Hz, 16 bit, mono, 2 bytes/frame, little-endian is supported.

viewtopic.php?f=78&t=151544
https://github.com/tinspin/rupy - A tiny Java async HTTP application server.

Ionic
Posts: 8
Joined: Sun Jun 04, 2017 4:56 pm

Re: Analogue audio redux

Fri Jan 19, 2018 6:52 am

jdb wrote:
Wed Oct 11, 2017 11:07 pm
Available in latest rpi-update firmware is a PWM audio driver that significantly increases the audio quality available from the 3.5mm TRRS jack.

To enable the advanced audio driver, add audio_pwm_mode=2 to /boot/config.txt and reboot.
Hi all, many thanks to jdb for this driver. Is there a way to use ONLY this driver without using rpi-update? I don't want to break my system in the case that something has a regression.

Thanks

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

Re: Analogue audio redux

Fri Jan 19, 2018 11:14 am

I tried to, but the update only gets you to this summer I'm afraid... so either install a fresh sd card or (I didn't get a reply if the new driver was in there actually) go bananas with firmware update. I think...

@jdb can you try aeonalpha an see why the text to speech doesn't work with the new driver? I think it might reproduce the ALSA problem, atleast I know it's reproducible! viewtopic.php?f=78&t=151544
https://github.com/tinspin/rupy - A tiny Java async HTTP application server.

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

Re: Analogue audio redux

Fri Jan 19, 2018 1:00 pm

Odd. The ALSA driver should happily accept mono streams.

Code: Select all

[email protected]:~$ speaker-test -c 1 -t sine

speaker-test 1.1.3

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Sine wave rate is 440.0000Hz
Does the behaviour definitely change from working -> not working on the same firmware version, just by adding audio_pwm_mode=2?
Rockets are loud.
https://astro-pi.org

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

Re: Analogue audio redux

Fri Jan 19, 2018 1:22 pm

Yes, just tried.

No, now it worked... so it's probably the unreproducible thing?!

Now I tried it on a RPi 2 just to see the framerate and there was a segmentationfault and raspian became unresponsive when I closed the game... can be completely unrelated... Now I lost the connection to xserver when exiting fullscreen... stable it seems...

Oh well it might work good in a couple of years maybe. ;)

Off topic: any1 else intrested in this: https://www.youtube.com/watch?v=Mp6znwaZ5xo
https://github.com/tinspin/rupy - A tiny Java async HTTP application server.

Ionic
Posts: 8
Joined: Sun Jun 04, 2017 4:56 pm

Re: Analogue audio redux

Fri Jan 19, 2018 2:11 pm

Thanks jdb for bypass my question.

Regards

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

Re: Analogue audio redux

Fri Jan 19, 2018 2:42 pm

Ionic wrote:
Fri Jan 19, 2018 6:52 am
jdb wrote:
Wed Oct 11, 2017 11:07 pm
Available in latest rpi-update firmware is a PWM audio driver that significantly increases the audio quality available from the 3.5mm TRRS jack.

To enable the advanced audio driver, add audio_pwm_mode=2 to /boot/config.txt and reboot.
Hi all, many thanks to jdb for this driver. Is there a way to use ONLY this driver without using rpi-update? I don't want to break my system in the case that something has a regression.

Thanks
You can upgrade only the firmware by doing sudo SKIP_KERNEL=1 rpi-update, but this will leave you in an even more unsupported configuration. The current branch of rpi-update firmware is quite stable and in fact is nearly ready to be pushed to Raspbian.
Rockets are loud.
https://astro-pi.org

Ionic
Posts: 8
Joined: Sun Jun 04, 2017 4:56 pm

Re: Analogue audio redux

Fri Jan 19, 2018 3:09 pm

jdb wrote:
Fri Jan 19, 2018 2:42 pm
You can upgrade only the firmware by doing sudo SKIP_KERNEL=1 rpi-update, but this will leave you in an even more unsupported configuration. The current branch of rpi-update firmware is quite stable and in fact is nearly ready to be pushed to Raspbian.
Thanks, is there an official way to know when a dev branch is merged to Raspbian?

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

Re: Analogue audio redux

Fri Jan 19, 2018 5:41 pm

Not officially, no. It's normally the case that an updated apt-get firmware is made available at the same time as a Raspbian distribution release.
Rockets are loud.
https://astro-pi.org

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

Re: Analogue audio redux

Sat Jan 20, 2018 7:48 pm

AL lib: (EE) oss_open_playback: Could not open /dev/dsp: No such file or directory
AL lib: (WW) alc_initconfig: Failed to initialize backend "pulse"

Sad panda... seems related to low power: does the GPU disable audio if it detects low power?

The 3D works fine?!

Edit: ok now the pi is toast... I get alot of output I can't copy and paste here when I try to boot it...

Great firmware!

Is this audio fix in the latest raspbian release or not?
https://github.com/tinspin/rupy - A tiny Java async HTTP application server.

Ionic
Posts: 8
Joined: Sun Jun 04, 2017 4:56 pm

Re: Analogue audio redux

Sat Jan 20, 2018 9:31 pm

jdb wrote:
Fri Jan 19, 2018 5:41 pm
Not officially, no. It's normally the case that an updated apt-get firmware is made available at the same time as a Raspbian distribution release.
Ok, so I can't know if the latest 4.9.35-v7+ kernel has this new driver or not. If I use audio_pwm_mode=2 option I still hear "HISS" from speaker, so, maybe not ;-)

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

Re: Analogue audio redux

Wed Feb 07, 2018 4:52 pm

We are planning to move to 4.14 in Raspbian in the next few days, which will include this driver (enabled by default) -> viewtopic.php?f=29&t=197689&start=25#p1269469
Rockets are loud.
https://astro-pi.org

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

Re: Analogue audio redux

Wed Feb 07, 2018 5:15 pm

Thx, when is the next official raspbian release for download planned?
https://github.com/tinspin/rupy - A tiny Java async HTTP application server.

trulio
Posts: 5
Joined: Mon Jul 21, 2014 9:40 pm

Re: Analogue audio redux

Fri Mar 09, 2018 8:50 pm

Hi jdb,

thanks for your work.
I tested your driver and i must admit it had really decent audio quality.
Congratulations

I must report that i noticed volume level changes when stopping and relaunching a radio stream.

My configuration is the following one :
burnt stretch lite on sd card
made apt update & dist-upgrade
then rpi-update
apt install mopidy
configured mopidy
launched following url of playlist file with a mpd client ( repeat play stop pause to observe changes of volume levels)
#EXTM3U
#EXTINF:-1,RTL2
http://streaming.radio.rtl2.fr/rtl2-1-48-192

Trulio

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

Re: Analogue audio redux

Thu Mar 15, 2018 6:18 pm

This driver is now enabled by default in latest Raspbian.

@trulio I've not had much chance to investigate your bug, but now that 3B+ is out I may have some more time available.
Rockets are loud.
https://astro-pi.org

Musketeer
Posts: 37
Joined: Fri Feb 12, 2016 1:23 pm

Re: Analogue audio redux

Fri Mar 16, 2018 10:34 am

jdb wrote:
Thu Mar 15, 2018 6:18 pm
This driver is now enabled by default in latest Raspbian.

@trulio I've not had much chance to investigate your bug, but now that 3B+ is out I may have some more time available.
Does 3B+ have same hiss on analog like RPI2 for example?

All it needs is newest kernel?

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

Re: Analogue audio redux

Tue Mar 20, 2018 11:12 am

The buffer driving the audio is the same on all models of Pi since B+. The original Model B/A used a noisier arrangement and Zero doesn't have analogue audio output circuitry.
Rockets are loud.
https://astro-pi.org

Musketeer
Posts: 37
Joined: Fri Feb 12, 2016 1:23 pm

All it needs is newest kernel?Re: Analogue audio redux

Tue Mar 20, 2018 12:40 pm

jdb wrote:
Tue Mar 20, 2018 11:12 am
The buffer driving the audio is the same on all models of Pi since B+. The original Model B/A used a noisier arrangement and Zero doesn't have analogue audio output circuitry.

All it needs is newest Raspbian OS / kernel and A/V out will be MUCH BETTER?

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

Re: Analogue audio redux

Tue Mar 20, 2018 12:42 pm

Yes. Latest Raspbian enables this driver by default.
Rockets are loud.
https://astro-pi.org

Musketeer
Posts: 37
Joined: Fri Feb 12, 2016 1:23 pm

Re: Analogue audio redux

Tue Mar 20, 2018 12:49 pm

jdb wrote:
Tue Mar 20, 2018 12:42 pm
Yes. Latest Raspbian enables this driver by default.
Excelent news!

Musketeer
Posts: 37
Joined: Fri Feb 12, 2016 1:23 pm

Re: Analogue audio redux

Wed Mar 21, 2018 10:01 am

jdb wrote:
Tue Mar 20, 2018 12:42 pm
Yes. Latest Raspbian enables this driver by default.
Btw. could you ***PLEASE*** look into this in Rpi4 PROTOTYPE? We have fun for years with fixing A/V out on older models... :lol:

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

Ping jdb...

Wed May 30, 2018 6:00 pm

Jdb if you're still reading this thread, I think we might have something here:
viewtopic.php?f=28&t=214644

Thanks!
"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: 56
Joined: Mon Nov 05, 2012 9:08 pm

Re: Analogue audio redux

Wed May 30, 2018 6:56 pm

Hi, This confirmed problem is really difficult to work around (not found any so far). Can anyone help, its really easy to reproduce and break the sound: -
viewtopic.php?f=28&t=214644&p=1321932#p1321932

Thanks for any help that you can give!

Return to “Advanced users”