You are not logged in.

#1 2016-06-25 17:46:52

Xi0N
Member
From: Bilbao - Spain
Registered: 2007-11-29
Posts: 832
Website

Kodi standalone and pulseaudio

I use my pc mainly with kodi. So, when  i boot up, arch starts kodi standalone, with kodi user, that launches the kodi interface without having to log in another specific user.

The problem I've been facing these last month is that the audio does not work most of the times and I seem to solve it rebooting. This has been happening 1 out of ten times I boot, I. E.  But lately, it's very common to have to reboot 4 or 5 times in order to get the audio working.

Now, the problem might be that I also have kde installed, just in case i need to use the computer for anything other than playing media, so, if i need to use kde, I would go to any free console with ctr+alt+FX combination, login as a normal user and run: systemctl stop kodi & &  startx

This would log me in to kde and let me do whatever I want.

I discovered I can run pavucontrol and there, I can find different HD I outputs. It seem like the correct output is hdmi 2 but by default, hdmi 1 gets selected, which appears as "unplugged ".  Once I run pavucontrol, everything works fine again. I can log out from kde and run kodi again and boom! Let there be sound!

How can I set this to choose the correct pulseaudio configuration by default? Maybe there is some other audio subsystem in conflict? I'm a bit lost here and the pulseaudio wiki seems overwhelming.

Any help would be nice!

Offline

#2 2016-06-25 19:03:27

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Kodi standalone and pulseaudio

I've seen a bug with this series of kodi where kodi itself is to blame for forgetting which audio output source it should be using.  The solution was to map a key on the remote to toggle between audio sources.  See my github: https://github.com/graysky2/streamzap


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2016-06-27 05:09:50

Xi0N
Member
From: Bilbao - Spain
Registered: 2007-11-29
Posts: 832
Website

Re: Kodi standalone and pulseaudio

graysky wrote:

I've seen a bug with this series of kodi where kodi itself is to blame for forgetting which audio output source it should be using.  The solution was to map a key on the remote to toggle between audio sources.  See my github: https://github.com/graysky2/streamzap


Thanks for your help, Unfortunately, I'm kind of lost with what you posted hmm
Do you think it would be easier if I notify the kodi devs and wait out for them to fix it? Or are they already aware? If you remember the bug, can you pass me the link so I can contribute to report?

Thanks!

Offline

#4 2016-06-27 05:24:47

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Kodi standalone and pulseaudio

I didn't report a bug; that is probably your best bet.  Note that you will need to include a kodi.log so be sure you read their wiki for enabling debugging prior to posting it.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2016-06-27 05:32:33

Xi0N
Member
From: Bilbao - Spain
Registered: 2007-11-29
Posts: 832
Website

Re: Kodi standalone and pulseaudio

Thank you very much four your suggestion, I'll see what I can do.
however, I already posted on their forums about this and got no answer whatsoever... sigh.....
I'll go with the bug report.
Thanks!

Offline

#6 2016-06-27 05:54:53

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Kodi standalone and pulseaudio

Be sure to post the link to the bug you report back in this thread.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#7 2016-06-28 06:17:38

positronik
Member
Registered: 2016-02-08
Posts: 94

Re: Kodi standalone and pulseaudio

I was thinking that as a temporary workaround you may use alsa instead of pulseaudio, or not?

Offline

#8 2016-06-28 06:27:08

Xi0N
Member
From: Bilbao - Spain
Registered: 2007-11-29
Posts: 832
Website

Re: Kodi standalone and pulseaudio

positronik wrote:

I was thinking that as a temporary workaround you may use alsa instead of pulseaudio, or not?

COuld be a solution. I'll report back if I finally have to go down this road, but on the KODI forums, they say pulseaudio 9 fixes this... though we still have on testing. I never tried testing packages, but I think this will be a first time, since I don't know when it will be moved to stable...

Offline

#9 2016-06-28 18:58:04

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Kodi standalone and pulseaudio

positronik wrote:

...though we still have on testing. I never tried testing packages, but I think this will be a first time, since I don't know when it will be moved to stable...

It has transitioned out of [testing] this afternoon.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#10 2016-06-29 05:13:10

Xi0N
Member
From: Bilbao - Spain
Registered: 2007-11-29
Posts: 832
Website

Re: Kodi standalone and pulseaudio

No luck: They tried to help me with the issue on kodi forums. A kodi developer, itself, and decided it's not a bug, but a problem, probably with my pulseaudio configuration.
The thread, here: http://forum.kodi.tv/showthread.php?tid … pid2366027

As said on such thread, I tried with pulseaudio 9 with the same results. There's a kodi log that i pasted here: http://pastebin.com/y2d8TbQ4

I really find myself kind of lost now. I don't know how to troubleshoot these kind of issues with pulseaudio. Any help setting me in the right directiuon would be nide smile

Offline

#11 2016-06-29 08:19:20

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: Kodi standalone and pulseaudio

Have you ever explicitly set your default device in pavucontrol/pulseaudio/pacmd? Can you from, the kodi user execute

pacmd set-default-sink $HDMISINK

where HDMISINK is the name you get from a

pacmd list-sinks

If the problem is that it doesn't use the correct port you can force a specific one by appending to the end of your /etc/pulse/default.pa

set-sink-port $HDMISINK $PORTNAME #Again pacmd list-sinks should give you the proper names here

Offline

#12 2016-06-29 08:27:57

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Kodi standalone and pulseaudio

Remove pulseaudio and try alsa.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#13 2016-06-29 08:49:55

Xi0N
Member
From: Bilbao - Spain
Registered: 2007-11-29
Posts: 832
Website

Re: Kodi standalone and pulseaudio

V1del wrote:

Have you ever explicitly set your default device in pavucontrol/pulseaudio/pacmd? Can you from, the kodi user execute

pacmd set-default-sink $HDMISINK

where HDMISINK is the name you get from a

pacmd list-sinks

If the problem is that it doesn't use the correct port you can force a specific one by appending to the end of your /etc/pulse/default.pa

set-sink-port $HDMISINK $PORTNAME #Again pacmd list-sinks should give you the proper names here

Running pacmd list sinks gives me the message: "No PulseAudio daemon running, or not running as session daemon" Could this happen because user "kodi", which launches the kodi interface, has /usr/bin/nologin as shell and thus, pulseaudio doesn't launch?

Pulseaudio is installed because i also use kde from time to time and i think it's a dependency.
EDIT: It's an optional dependency, so, if I don't figure out why this is happening, removing PA would be an option... what would be the pros and cons?

Last edited by Xi0N (2016-06-29 08:58:24)

Offline

#14 2016-06-29 09:29:49

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: Kodi standalone and pulseaudio

If Kodi enumerates a pulse device pulse should be started, and it usually is on invocation (there's no pulse daemon running at all if you check in ps/top ?) using the pacmd information from your kde user to do the set-sink-port thing should work as well, since the identifiers should be the same.

Going ALSA only would work as well, mostly shifting configuration to the ALSA way instead. The biggest con ALSA has over pulse that you can't dynamically move running streams from HDMI to Analog and vice versa. If that's not a functionality you require you can use ALSA as well. Depending on your needs you might have to do some more sophisticated configuration i.e. if you need dmix (to allow multiple programs outputting sound at the same time) on more than just your default device. Pulseaudio usually takes care of these things automatically.

Offline

#15 2016-06-29 22:10:15

Xi0N
Member
From: Bilbao - Spain
Registered: 2007-11-29
Posts: 832
Website

Re: Kodi standalone and pulseaudio

I finally gave up and ditched pulseaudio altogether so alsa could take control. The problem is gone for good and I saw no downside so far.

Thanks to everyone that helped

Offline

#16 2016-06-29 22:50:47

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Kodi standalone and pulseaudio

Xi0N wrote:

I finally gave up and ditched pulseaudio altogether so alsa could take control. The problem is gone for good and I saw no downside so far.

Unless you need the more advanced features that PA offers, there isn't really an advantage to using it.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#17 2016-06-30 04:50:14

Xi0N
Member
From: Bilbao - Spain
Registered: 2007-11-29
Posts: 832
Website

Re: Kodi standalone and pulseaudio

graysky wrote:
Xi0N wrote:

I finally gave up and ditched pulseaudio altogether so alsa could take control. The problem is gone for good and I saw no downside so far.

Unless you need the more advanced features that PA offers, there isn't really an advantage to using it.


Now that you mention it... some days ago I was considering to buy a 5.1 sound system... would I need pulseaudio for this or does alsa suffice?

Offline

#18 2016-06-30 09:18:53

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: Kodi standalone and pulseaudio

ALSA should work, pulseaudio simplifies configuration imo. For a properly working 5.1 sound system you might have to do relatively complex ALSA configuration, since the default is to use a stereo channel dmix, so you would have to set that up. I'm not all to proficient in that I'm afraid but we have some people here that know their ALSA, so you might want to take a look at their configurations (off the top of my head, Brebs (has a link to his config in his signature) and emeres come to mind, although I haven't seen the latter around lately)

Offline

Board footer

Powered by FluxBB