New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable pulseaudio to remove popping on analog audio #175

Closed
CurlyMoo opened this Issue Dec 20, 2012 · 30 comments

Comments

Projects
None yet
9 participants
@CurlyMoo
Contributor

CurlyMoo commented Dec 20, 2012

Copied from this issue:
raspberrypi/linux#128 (comment)

What i did was:

sudo apt-get install pulseaudio mpd
#Use my config files from here (located in /etc/pulse)
#http://pastebin.com/pMxXrdcC
#http://pastebin.com/zuAFN0Qa
sudo sed -i 's/alsa/pulse/g' /etc/mpd.conf
sudo sed -i 's/My ALSA Device/My Pulse Device/g' /etc/mpd.conf
sudo sed -i '/My Pulse Device/{n;N;N;N;N;d}' /etc/mpd.conf
sudo reboot

And gone was the popping of the analog audio. However this only works with playing music files.
@Koenkk, can you check how we can make the audio output of omxplayer go through pulseaudio (or what the default XBMC player is)?

Only issue is that when i stop a e.g. music file with my remote it isn't immediately stopped. When a music file ends and the next one start, no problem exists.

@ghost ghost assigned Koenkk and CurlyMoo Dec 20, 2012

@skipper79

This comment has been minimized.

Show comment
Hide comment
@skipper79

skipper79 Dec 20, 2012

@CurlyMoo; for which Kernel version and xmbc version did you do this?

@CurlyMoo; for which Kernel version and xmbc version did you do this?

@CurlyMoo

This comment has been minimized.

Show comment
Hide comment
@CurlyMoo

CurlyMoo Dec 20, 2012

Contributor

Both the latest

Contributor

CurlyMoo commented Dec 20, 2012

Both the latest

@skipper79

This comment has been minimized.

Show comment
Hide comment
@skipper79

skipper79 Dec 20, 2012

@CurlyMoo so Kernel 3.6.10 and Xbmc 1.4?

@CurlyMoo so Kernel 3.6.10 and Xbmc 1.4?

@CurlyMoo

This comment has been minimized.

Show comment
Hide comment
@CurlyMoo

CurlyMoo Dec 20, 2012

Contributor

Yes

Contributor

CurlyMoo commented Dec 20, 2012

Yes

@Koenkk

This comment has been minimized.

Show comment
Hide comment
@Koenkk

Koenkk Dec 20, 2012

Contributor

The /etc/mpd.conf doesn't exsist by default? The player for audio and video are both OMXPlayer.

Contributor

Koenkk commented Dec 20, 2012

The /etc/mpd.conf doesn't exsist by default? The player for audio and video are both OMXPlayer.

@Koenkk Koenkk closed this Dec 20, 2012

@Koenkk Koenkk reopened this Dec 20, 2012

@CurlyMoo

This comment has been minimized.

Show comment
Hide comment
@CurlyMoo

CurlyMoo Dec 20, 2012

Contributor

Then you didn't install MPD, check my first post again.

Contributor

CurlyMoo commented Dec 20, 2012

Then you didn't install MPD, check my first post again.

@Noelsen

This comment has been minimized.

Show comment
Hide comment
@Noelsen

Noelsen Dec 21, 2012

after trying to get Pulseaudio to work, I have no soundoutput on analog anymore. Any idea what I made wrong?

Noelsen commented Dec 21, 2012

after trying to get Pulseaudio to work, I have no soundoutput on analog anymore. Any idea what I made wrong?

@CurlyMoo

This comment has been minimized.

Show comment
Hide comment
@CurlyMoo

CurlyMoo Dec 21, 2012

Contributor

What version of XBMC and the Kernel are you running?

Contributor

CurlyMoo commented Dec 21, 2012

What version of XBMC and the Kernel are you running?

@Noelsen

This comment has been minimized.

Show comment
Hide comment
@Noelsen

Noelsen Dec 21, 2012

Kernel 3.6.9 and XBMC 1.4

Noelsen commented Dec 21, 2012

Kernel 3.6.9 and XBMC 1.4

@CurlyMoo

This comment has been minimized.

Show comment
Hide comment
@CurlyMoo

CurlyMoo Dec 21, 2012

Contributor

Can you try using kernel 3.6.10 or 3.6.11?

Contributor

CurlyMoo commented Dec 21, 2012

Can you try using kernel 3.6.10 or 3.6.11?

@Noelsen

This comment has been minimized.

Show comment
Hide comment
@Noelsen

Noelsen Dec 21, 2012

on 3.6.10 sound is back, but popping too...

Noelsen commented Dec 21, 2012

on 3.6.10 sound is back, but popping too...

@CurlyMoo

This comment has been minimized.

Show comment
Hide comment
@CurlyMoo

CurlyMoo Dec 21, 2012

Contributor

Did you use my config files? Also remember that this currently only works for music files...

Contributor

CurlyMoo commented Dec 21, 2012

Did you use my config files? Also remember that this currently only works for music files...

@Noelsen

This comment has been minimized.

Show comment
Hide comment

Noelsen commented Dec 21, 2012

yes

@CurlyMoo

This comment has been minimized.

Show comment
Hide comment
@CurlyMoo

CurlyMoo Dec 21, 2012

Contributor

When does this popping occur, with music, video or always?

Contributor

CurlyMoo commented Dec 21, 2012

When does this popping occur, with music, video or always?

@Noelsen

This comment has been minimized.

Show comment
Hide comment
@Noelsen

Noelsen Dec 21, 2012

just tried music, appears beginning of every song

Noelsen commented Dec 21, 2012

just tried music, appears beginning of every song

@CurlyMoo

This comment has been minimized.

Show comment
Hide comment
@CurlyMoo

CurlyMoo Dec 21, 2012

Contributor

We'll await Alpha 4 before we going to figure this out any further. Then i at least know we all have the same system configuration...

Contributor

CurlyMoo commented Dec 21, 2012

We'll await Alpha 4 before we going to figure this out any further. Then i at least know we all have the same system configuration...

@Noelsen

This comment has been minimized.

Show comment
Hide comment
@Noelsen

Noelsen Dec 21, 2012

ok, any idea how long we have to wait for next release?
And have nice holidays and a merry x-mas.

Noelsen commented Dec 21, 2012

ok, any idea how long we have to wait for next release?
And have nice holidays and a merry x-mas.

@CurlyMoo

This comment has been minimized.

Show comment
Hide comment
@CurlyMoo

CurlyMoo Dec 21, 2012

Contributor

Hopefully we can release it before the end of the year, especially we now know the earth is still spinning.

Contributor

CurlyMoo commented Dec 21, 2012

Hopefully we can release it before the end of the year, especially we now know the earth is still spinning.

@Goofinder

This comment has been minimized.

Show comment
Hide comment
@Goofinder

Goofinder Dec 22, 2012

I have done a similar workaround on my RPi (running raspbian, not xbian but should be similar), but if I pause the mpd output it fails to restart until I reboot. An error is reported saying something about the device being suspended even though I have commented out module-suspend-on-idle in the pulseaudio config.

Can you please confirm if you can pause and restart mpd playback without any issues.

I have done a similar workaround on my RPi (running raspbian, not xbian but should be similar), but if I pause the mpd output it fails to restart until I reboot. An error is reported saying something about the device being suspended even though I have commented out module-suspend-on-idle in the pulseaudio config.

Can you please confirm if you can pause and restart mpd playback without any issues.

@CurlyMoo

This comment has been minimized.

Show comment
Hide comment
@CurlyMoo

CurlyMoo Dec 22, 2012

Contributor

@Goofinder, no because when i pause/stop, it does not stop immediatly.

Contributor

CurlyMoo commented Dec 22, 2012

@Goofinder, no because when i pause/stop, it does not stop immediatly.

@betzi

This comment has been minimized.

Show comment
Hide comment
@betzi

betzi Jan 7, 2013

Hello CurlyMoo,
I did exactly what you have described in the first post, but after the reboot XBIAN has a black screen and does not start anymore correctly. It is still accessible via SSH but that's it.
Did this work around really worked for your PI with XBIAN installed? This would be exactly what I was looking for.

Betzi

betzi commented Jan 7, 2013

Hello CurlyMoo,
I did exactly what you have described in the first post, but after the reboot XBIAN has a black screen and does not start anymore correctly. It is still accessible via SSH but that's it.
Did this work around really worked for your PI with XBIAN installed? This would be exactly what I was looking for.

Betzi

@CurlyMoo

This comment has been minimized.

Show comment
Hide comment
@CurlyMoo

CurlyMoo Jan 7, 2013

Contributor

Yes it did, but also needs a lot of work though.

Contributor

CurlyMoo commented Jan 7, 2013

Yes it did, but also needs a lot of work though.

@betzi

This comment has been minimized.

Show comment
Hide comment
@betzi

betzi Jan 7, 2013

Thanks for your speedy reply.
I think the biggest work for you was to create the config files. Actually I am using the 1.0.4 Alpha Version.
But what went wrong by just following what you have described above?

Can I just copy/paste the content from #http://pastebin.com/pMxXrdcC and #http://pastebin.com/zuAFN0Qa with vi into the files on the RPi (with root login)? Does that work with Windows doing it with SSH?

What are you doing with that command?
sudo sed -i '/My Pulse Device/{n;N;N;N;N;d}' /etc/mpd.conf

Thanks for letting me know.

Betzi

betzi commented Jan 7, 2013

Thanks for your speedy reply.
I think the biggest work for you was to create the config files. Actually I am using the 1.0.4 Alpha Version.
But what went wrong by just following what you have described above?

Can I just copy/paste the content from #http://pastebin.com/pMxXrdcC and #http://pastebin.com/zuAFN0Qa with vi into the files on the RPi (with root login)? Does that work with Windows doing it with SSH?

What are you doing with that command?
sudo sed -i '/My Pulse Device/{n;N;N;N;N;d}' /etc/mpd.conf

Thanks for letting me know.

Betzi

@CurlyMoo

This comment has been minimized.

Show comment
Hide comment
@CurlyMoo

CurlyMoo Jan 7, 2013

Contributor

sudo sed -i '/My Pulse Device/{n;N;N;N;N;d}' /etc/mpd.conf

Removing 4 lines after the matching line.

Contributor

CurlyMoo commented Jan 7, 2013

sudo sed -i '/My Pulse Device/{n;N;N;N;N;d}' /etc/mpd.conf

Removing 4 lines after the matching line.

@netforce87

This comment has been minimized.

Show comment
Hide comment
@netforce87

netforce87 Jan 10, 2013

Hello,
Thank you for taking the time to share this fix!
I do however have an issue with the audio no longer playing as well. I did your fix step-by-step, pasted the files and restarted. I get absolutely no audio on music or any add ons or video anymore. Running Xbian 1.0a4 and kernel 3.6.11

Hello,
Thank you for taking the time to share this fix!
I do however have an issue with the audio no longer playing as well. I did your fix step-by-step, pasted the files and restarted. I get absolutely no audio on music or any add ons or video anymore. Running Xbian 1.0a4 and kernel 3.6.11

@netforce87

This comment has been minimized.

Show comment
Hide comment
@netforce87

netforce87 Jan 10, 2013

Oh, and I don't know if it's a big ah-ha thing, but the playback moves at about double speed.

Oh, and I don't know if it's a big ah-ha thing, but the playback moves at about double speed.

@CurlyMoo

This comment has been minimized.

Show comment
Hide comment
@CurlyMoo

CurlyMoo Jan 11, 2013

Contributor

That is not any different than my implementation, however i also tested the configuration files of both programs so it also doesn't slow down the boot process.

I also came up with a different idea that i don't actually read in this post. What if we make a small dummy .wav with silence file and play that continously with pulseaudio. Then the analog output is kept active, and XBMC can keep using his own method. I'm not sure though i've we can have to audio sources enabled at once.

Are there any users that can test this?

Contributor

CurlyMoo commented Jan 11, 2013

That is not any different than my implementation, however i also tested the configuration files of both programs so it also doesn't slow down the boot process.

I also came up with a different idea that i don't actually read in this post. What if we make a small dummy .wav with silence file and play that continously with pulseaudio. Then the analog output is kept active, and XBMC can keep using his own method. I'm not sure though i've we can have to audio sources enabled at once.

Are there any users that can test this?

@betzi

This comment has been minimized.

Show comment
Hide comment
@betzi

betzi Jan 11, 2013

@inspector71
wow, it works. thanks for the link. The only "drawback" I have now is that at a title change the two files are fading into each other for 1-2 seconds.

betzi commented Jan 11, 2013

@inspector71
wow, it works. thanks for the link. The only "drawback" I have now is that at a title change the two files are fading into each other for 1-2 seconds.

@CurlyMoo

This comment has been minimized.

Show comment
Hide comment
@CurlyMoo

CurlyMoo Jan 11, 2013

Contributor

Does it suddenly also work for movies, and immidiatly stopping the sound output by pressing 'stop'

Contributor

CurlyMoo commented Jan 11, 2013

Does it suddenly also work for movies, and immidiatly stopping the sound output by pressing 'stop'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment