Pulseaudio support in Kodi-rbp

Problems with packages? Post here, using [tags] of the package name.

Pulseaudio support in Kodi-rbp

Postby splitfire » Tue Oct 20, 2015 6:46 am

Hello everyone,

I tried to configure kodi-rbp to use Pulseaudio, but it just wont work together. Then I look through Kodi's PKGBUILD here and figured out that pulseaudio support is disabled (" --disable-pulse" parameter).
So the question is: why pulseaudio support is disabled by default?

P.S. I saw posts about Pulseaudio eating CPU on Raspberry Pi, but that was first generation with 1 CPU, maybe RPI2 will be more lucky. :)
P.P.S Also in Pulseaudio 7 new discretization technique was introduced: SOXR. It is said, SOXR-mq is less demanding to CPU.
splitfire
 
Posts: 2
Joined: Tue Oct 20, 2015 6:30 am

Re: Pulseaudio support in Kodi-rbp

Postby WarheadsSE » Tue Oct 20, 2015 3:00 pm

Test it, and get back to us.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Pulseaudio support in Kodi-rbp

Postby splitfire » Sun Nov 22, 2015 10:42 am

So, I managed to build kodi with --enable-pulse, but I can't start kodi AND pulseaudio. It seems that when kodi starts, no pulseaudio instance is initiated. Any suggestions how to start pulseaudio before kodi? Maybe edit kodis systemd service file and add pulseaudio?
splitfire
 
Posts: 2
Joined: Tue Oct 20, 2015 6:30 am

Re: Pulseaudio support in Kodi-rbp

Postby ermo » Sun Jan 03, 2016 5:34 pm

Just chiming in to say that I'm using my RPi2 as both a kodi HTPC and a squeezelite client, and not having pulseaudio available by default is a bit of a PITA tbh.

I guess I should get started on setting up that RPi2 cross-compiler environment... 8-)
Last edited by ermo on Sat Jan 09, 2016 8:37 pm, edited 1 time in total.
ermo
 
Posts: 2
Joined: Sun Jan 03, 2016 5:24 pm

Re: Pulseaudio support in Kodi-rbp

Postby Kabbone » Mon Jan 04, 2016 9:37 am

I used it just with pulseaudio-alsa and even with Rpi 1 everything worked fine until I used the digital soundcard on the GPIO. Since then pulseaudio used much more cpu but I haven't investigated yet.
Kabbone
 
Posts: 155
Joined: Thu Jul 25, 2013 9:20 am

Re: Pulseaudio support in Kodi-rbp

Postby ermo » Sat Jan 09, 2016 8:32 pm

Success! :D

I've hacked together a solution that relies on the PulseAudio session daemon in that systemd is configured to automatically log in a preconfigured user on tty1, whereupon said user then runs squeezelite (as a daemon) followed by kodi (recompiled with '--enable-pulseaudio') via an appropriate if-statement in the user's .bashrc file.

First, I used this guide (Automatic_login_to_virtual_console) to set up the automatic logon to tty1.

Then, I set up my user to be a member of the 'power' group and configured the user's .bashrc to look like this:

$this->bbcode_second_pass_code('', '
#
# ~/.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

# We want the session PulseAudio daemon to start before first squeezelite
# (running daemonized with a pidfile) and then kodi both start up.
# Instead of using service files, we're logging into the local tty1
# automatically on boot and every time we exit the shell we automatically log in again.
# We rely on the fact that $XDG_VTNR is set when we log on to a VT on the RPi2.
if [ -n "$XDG_VTNR" -a "$XDG_VTNR" = "1" ]; then
/usr/bin/squeezelite -m '13:37:de:ad:be:ef' -a 80 -n 'myhostname' -f /tmp/squeezelite.log -P /tmp/squeezelite.pid -z
kodi-standalone
kill $(cat /tmp/squeezelite.pid)
exit
# this will automatically restart squeezelite and kodi on the next (automatic) login
fi

alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '
export EDITOR=/usr/bin/nano
export VISUAL="$EDITOR"
')

... and now I'm one happy camper. 8-)

I installed the pulseaudio-alsa package and used the 'pacmd' utility (included in the pulseaudio package) to set the default PulseAudio profile to the optical out port on my USB sound card. AFAICT, PA saves this setting across reboots.

I used ponymix and pulsemixer-git (AUR) to verify and control the volume settings and configured Kodi to use the default ALSA output (which was now PulseAudio courtesy pulseaudio-alsa). I have yet to ascertain whether all this works with the standard, non-pulseaudio kodi-rbp package.

As an aside, I habitually use the pacaur AUR helper (which depends on cower) to painlessly install/build packages. Can't recommend pacaur enough really.

P.S. The distcc cross compile functionality is wicked!
ermo
 
Posts: 2
Joined: Sun Jan 03, 2016 5:24 pm

Re: Pulseaudio support in Kodi-rbp

Postby Kabbone » Sun Jan 10, 2016 8:25 pm

Can you also use passthrough with pulseaudio and your optical out in Kodi now?
Kabbone
 
Posts: 155
Joined: Thu Jul 25, 2013 9:20 am


Return to Packages

Who is online

Users browsing this forum: No registered users and 4 guests