Skip to content
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
Closed

Enable pulseaudio to remove popping on analog audio #175

CurlyMoo opened this issue Dec 20, 2012 · 30 comments

Comments

@CurlyMoo
Copy link
Contributor

@CurlyMoo 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
Copy link

@skipper79 skipper79 commented Dec 20, 2012

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

@CurlyMoo
Copy link
Contributor Author

@CurlyMoo CurlyMoo commented Dec 20, 2012

Both the latest

@skipper79
Copy link

@skipper79 skipper79 commented Dec 20, 2012

@CurlyMoo so Kernel 3.6.10 and Xbmc 1.4?

@CurlyMoo
Copy link
Contributor Author

@CurlyMoo CurlyMoo commented Dec 20, 2012

Yes

@Koenkk
Copy link
Contributor

@Koenkk 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
Copy link
Contributor Author

@CurlyMoo CurlyMoo commented Dec 20, 2012

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

@Noelsen
Copy link

@Noelsen 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
Copy link
Contributor Author

@CurlyMoo CurlyMoo commented Dec 21, 2012

What version of XBMC and the Kernel are you running?

@Noelsen
Copy link

@Noelsen Noelsen commented Dec 21, 2012

Kernel 3.6.9 and XBMC 1.4

@CurlyMoo
Copy link
Contributor Author

@CurlyMoo CurlyMoo commented Dec 21, 2012

Can you try using kernel 3.6.10 or 3.6.11?

@Noelsen
Copy link

@Noelsen Noelsen commented Dec 21, 2012

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

@CurlyMoo
Copy link
Contributor Author

@CurlyMoo CurlyMoo commented Dec 21, 2012

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

@Noelsen
Copy link

@Noelsen Noelsen commented Dec 21, 2012

yes

@CurlyMoo
Copy link
Contributor Author

@CurlyMoo CurlyMoo commented Dec 21, 2012

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

@Noelsen
Copy link

@Noelsen Noelsen commented Dec 21, 2012

just tried music, appears beginning of every song

@CurlyMoo
Copy link
Contributor Author

@CurlyMoo 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
Copy link

@Noelsen 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
Copy link
Contributor Author

@CurlyMoo 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
Copy link

@Goofinder Goofinder commented 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.

@CurlyMoo
Copy link
Contributor Author

@CurlyMoo CurlyMoo commented Dec 22, 2012

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

@betzi
Copy link

@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
Copy link
Contributor Author

@CurlyMoo CurlyMoo commented Jan 7, 2013

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

@betzi
Copy link

@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
Copy link
Contributor Author

@CurlyMoo 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
Copy link

@netforce87 netforce87 commented 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

@netforce87
Copy link

@netforce87 netforce87 commented 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.

@CurlyMoo
Copy link
Contributor Author

@CurlyMoo 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
Copy link

@betzi 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
Copy link
Contributor Author

@CurlyMoo 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
8 participants
You can’t perform that action at this time.