Kodi Community Forum
v17 How to configure audio for librelecs moonlight addon - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+---- Thread: v17 How to configure audio for librelecs moonlight addon (/showthread.php?tid=324707)



How to configure audio for librelecs moonlight addon - NeroBoron - 2017-11-27

Does anyone of you know how to configure the audio device within libreelecs moonlight addon?

The game streaming works fine for me except the audio. I have no infomration how it has to be entered, soi tried this for example:
hdmi:CARD=HDMI,DEV=0
and
hw:0,0

but with no result... these are my deviced and it is 0,0 for sure since it kodi uses it. would be great if it would just use kodis audio output config.
however this are my listed audio devices:

** List of PLAYBACK Hardware Devices **
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC283 Analog [ALC283 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0


RE: How to configure audio for librelecs moonlight addon - Wintermute0110 - 2017-11-28

Have a look here to understand how to convert aplay -l into the hw:X,Y format. In your case, hw:0,0 does not exists so I'm wondering how Kodi gets the sound out the HDMI port ...

Can you please post a debug log of Kodi just after booting up (so I can see whether you are using ALSA or Pulseaudio)?


RE: How to configure audio for librelecs moonlight addon - NeroBoron - 2017-11-28

Okay? Well in Kodi I selected the first element of the list which is also named like HDMI 0 or so. Will get a log on Thursday don't have time before :S but thanks for your reply already Smile

Quote: The hw:X,Y comes from this mapping of your hardware -- in this case, X is the card number, while Y is the device number.
Oh fail I didn't took the device number but the HDMI number. That's how I came to the conclusion that I have to enter hw:0,0.

I will try with hw:0,3


RE: How to configure audio for librelecs moonlight addon - Wintermute0110 - 2017-11-28

(2017-11-28, 14:07)NeroBoron Wrote: Oh fail I didn't took the device number but the HDMI number. That's how I came to the conclusion that I have to enter hw:0,0.

I will try with hw:0,3

OK, mystery solved. Also, note that ALSA does not allow two or more programs to use the same digital ouput card, and HDMI are digital outputs (analog sound cards support dmix by default). You need to change your /etc/asound.conf or /home/your_username/.asoundrc and enable dmix on the HDMI card and make this dmix device the default. If you use /etc/asound.conf (global configuration) make sure /home/your_username/.asoundrc (user configuration) does not exist and vice-versa. Have a look here for an easy example and here for a more complicated example.

Sound card configuration with ALSA can be a little bit painful the first time Smile Good luck!


RE: How to configure audio for librelecs moonlight addon - NeroBoron - 2017-11-28

Not sure if this a problem the moonlight addon will exit kodi and launch moonlight, if the streaming is quitted kodi is relaunched. So only one programm would use it, another reason why the addon should apply the kodi audio config to moonlight as well Big Grin
Well i will see in a few days wether everything works out Smile


RE: How to configure audio for librelecs moonlight addon - NeroBoron - 2017-11-30

Okay well if i enter hw:0,3 the addon even fails to start, same was with hw:0,0

i checked out the log of it which only contains 2 lines

Code:
You can't select a audio device for SDL
Connect to 192.168.1.91...

Seems like SDL_OpenAudioDevice fails, at least that was what i found related to that. If it is correct that it is used by moonlight. so i guess i have to put in a string in the addon config formated the way it is expected by that function. SDL_GetAudioDeviceName would deliver it but no idea how this function formats such a string :S btw the defaut value for the audio device is sysdefault so maybe i could just map the audio port to that, but no idea how that works :'D

I also checked the kodi log seems like it using alsa
https://drive.google.com/file/d/13s9MSLlXENx6cRWO82h6X6mo8JztaZUO/view?usp=sharing

Any idea? Else i will open an issue on the github repo of the addon