Steam Link

Steam Link

5.1 Support
This may come down to the Raspberry Pi itself, but having a hard time getting 5.1 audio streaming to work. I can get stereo to work no problem, but no audio when I set it to 5.1. I do not get any channels to work, just dead silence.

Is 5.1 suppose to work yet in the BETA Build? Do i need a specific driver on the Raspberry Pi? I did a fresh install of Raspbian Stretch for Desktop November 2018 build.
< >
Showing 1-15 of 51 comments
Hello,

It should be working since i was able to get 5.1 with moonlight and while playing movie in kodi.

Some interesting information : https://forum.kodi.tv/showthread.php?tid=182350

You can also probably play with asound.conf if you have it or /etc/pulse/client.conf

Good luck !
I am in the same shoes, stereo works, 5.1 -> no sound at all.
Have you tried installing pulseaudio and configuring 5.1 sound? See this guide: https://wiki.debian.org/PulseAudio#Surround_sound_system

You should probably also force audio over HDMI in raspi-config
I've done it :D


1- you need to be able to patch your kernel because the sound module is not capable of having more than 2 channels...
the file to patch is linux/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
under the part : static const struct snd_pcm_hardware snd_bcm2835_playback_hw, you need to change :

- SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID),
+ SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID |
+ SNDRV_PCM_INFO_DRAIN_TRIGGER | SNDRV_PCM_INFO_SYNC_APPLPTR),

- .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
+ .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_192000,

- .rate_max = 48000,
+ .rate_max = 192000,

and under : static const struct snd_pcm_hardware snd_bcm2835_playback_spdif_hw = {

- SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID),
+ SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID |
+ SNDRV_PCM_INFO_DRAIN_TRIGGER | SNDRV_PCM_INFO_SYNC_APPLPTR),

- .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_44100 |
- SNDRV_PCM_RATE_48000,
+ .rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
+ SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 |
+ SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000,

- .rate_max = 48000,
+ .rate_max = 192000,

- .channels_max = 2,
- .buffer_bytes_max = 128 * 1024,
+ .channels_max = 8,
+ .buffer_bytes_max = 512 * 1024,

- .period_bytes_max = 128 * 1024,
+ .period_bytes_max = 512 * 1024,

Rebuild your kernel and reboot. ( how to rebuild : https://www.raspberrypi.org/documentation/linux/kernel/building.md )

The good news for osmc users is... you just have to add this repo to your apt source list :
deb http://apt.osmc.tv stretch-devel main

and upgrade to the latest kernel !
# apt-get update
# apt-get dist-upgrade


2 - After the reboot as root ( don't forget that you'll need to apply that after each reboot ):
# vcgencmd hdmi_channel_map 0x0BFAC4C8

You can add it to your /boot/config.txt like that :
hdmi_channel_map=200983752



3 - Create the file .asoundrc in your homedir with as your user who'll launch steamlink :
pcm.!surround51 {
type route
slave.pcm "hw:0,1"
slave.channels 6
ttable {
0.0= 1
1.1= 1
2.4= 1
3.5= 1
4.2= 1
5.3= 1
}
}

4 - Test each of your channels with (X corresponding to the channel you want to test from 1 to 6):
# speaker-test -c6 -Dsurround51 -sX

If some of them are not correctly mapped, you need to play with the ttable in .asoundrc ( where your channels are from 0 to 5 -_-' )

5- Last tricky part...
Launch a game with steamlink, and while it's running, go to your sound config pannel, select "steam streaming speakers" and configure and then test your "surround 5.1" (in my case, some speaker were unavailable, I had to select stereo and go back to "surround 5.1" to be able to use all of them.)


6- And Hopping I haven't forget something... Enjoy !!
Hello,

Building a kernel for raspbian is not the hard part, ( you can just follow the instruction on https://www.raspberrypi.org/documentation/linux/kernel/building.md ), You'll just need a lot of cofee while waiting the build to finish ^^'

It can seem to be overwhelming, but it's a good way to learn new thing on linux. :p

The worst part is that indeed upgrading can "undo" what you've done.
But, once a new kernel is built, if you don't delete the source dir, you just have to install it again.(it take less than 1 min)
You can also install the kernel with a specific file name (like kernel-steamlink.img) and add it to your /boot/config.txt.
Like that you know that no upgrade are going to overwrite that one.

About the other apps who can do 5.1/7.1, i'm not sure that it's correctly working (like we can see, even for kody, OSMC team add to patch the sound driver in the kernel :/)

Thing that valve can probably do is to provide their own version of raspbian or just a specific kernel

@ Grim Lokason : I think this will be a bit overwhelming for the majority of the users. I think an more detailed step by step is needed, I tried both, oscm, and raspbian lite patching the kernel, and my receiver still dont output more than Left and Right :D

I did find an another solution for the missing 5.1 audio (converting to DD5.1) but it still has dropouts, https://www.raspberrypi.org/forums/viewtopic.php?t=172536

I'm very pleased with your effort, and I'm sure other are to :)
For OSMC, i can do an easier step by step . (but users will probably still have to play with the channel mapping in .asoundrc :/ )

If you want to test : https://gitlab.com/grimlokason/osmc-steamlink/edit/master/readme.md


Thank, but I tested with OSMC, but that would not give me 6ch sound.
So I checked out what Kernel I had installed on my pi, it was 4.14, so I did an rpi-update https://github.com/Hexxeh/rpi-update to 4.19 and did config my .asoundrc, and now I have sound in 6 of my speakers in the correct output (have 7.1 setup)

So the easy way to get 5.1 sound, is to update through rpi-update, no need to compile an kernel on your own. Has not testet the settings in Steamlink yet, but I think as long it works with speaker-test, it will work in steamlink too.

Thanks again Grim, for your tip about the kernel :D

My asoundrc config

pcm.!default {
type plug
slave.pcm "hw:0,1"
slave.channels 6
ttable {
0.0= 1
1.1= 1
2.4= 1
3.5= 1
4.2= 1
5.3= 1
}
}





Update.

No 5.1 audio in steamlink getting this error :

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
INFO: Couldn't open audio device: format=2, channels=6, frequency=48000. Audio is disabled: ALSA: Couldn't open audio device: No such file or directory


Setting Steamlink to 7.1 audio works thou :D
Hello !

surround51 doesn't work because you set pcm.!default instead of pcm.!surround51 in your .asoundrc.
And the test with speaker-test will become : speaker-test -c6 -Dsurround51


you used rpi-update on your osmc and it still working or it was on a raspbian ?
BTW, it's good to know that the patches seems to be available in the latest version of rasp kernel :D

For the 7.1, i don't know if you are really getting all the channel since "vcgencmd hdmi_channel_map 0x0BFac4c8" is to define 5.1 on your HDMI output ^^'

Glad to know other have achieved it !
pcm.!surround51 didnt work for me at all, only left and right front channel, first when I tried pcm.!default the rest of the channels worked. Will give it another try, and see if I can get it working, I might have overlooked something :)

I used rpi-update on rasbian stretch lite. so it's available if using rpi-update instead of apt get update, and apt get upgrade.

The output is still 5.1 if I set 7.1 in steamlink, my receiver reports pcm 3:2:1

I'm gonna research some more, right now I have some wierd slow encoding errors, and alot of ALSA buffer underruns that makes it unusable, might be related to the kernel update, I dont now, Steamlink was working fine on the earlier image I had, except for audio drop outs, (ALSA buffer underrun too) on that image I had the pcm-audio realtime convertet to dd5.1, and it worked fine, I hoped that not have any conversion would help. (the audio conversion is done by the gpu)

Hope more people will try it out now that the kernel is easier to update, and report back in this thread :)
Originally posted by Grim Lokason:
Hello !

surround51 doesn't work because you set pcm.!default instead of pcm.!surround51 in your .asoundrc.
And the test with speaker-test will become : speaker-test -c6 -Dsurround51

Now it works, I didnt test with Dsurround51 first time, my bad :)

So for others who wants to try, update the kernel with rpi-update, and follow Grim's guide from step 2.
it's my fault, i forget to add it to the speaker-test in the step by step ^^'
@Grim. :D At least that mistake, gave me a few hours of reading about ALSA configs, and settings, and less housework :D



@Xenophobe. Nice to see that you too managed to get it working :)
I'm also have some crackling sound, but I also noticed that I had to crank up the volume quite a bit on the receiver to match the volume I usually have when for example watching movies (26 on movies, and I need 38 on the raspberry) I also noticed that it is when its a lot of bass in the game, the crackling is most noticeable.

I might be related to different settings in the sound properties, on the host computer, and the soundconfig on the raspberry. My receiver tells me that its getting a 48khz frequency from the raspberry, so playing with those configs might help :) I'ts a long shot, but worth a try :)

@ Xenophobe. Me too has just narrowed it down to be an ALSA setting, or an setting deep in the Steamlink app itself.
After some googlefu, I suspect the audio buffer , either the timing when the audio is flushed, or the size of it, or something related to it.
This should be controlled by the app, so it might be an way to alter the settings in a file in the app itself.
I know that ALSA has an setting that we could set in some of its configfiles, like bitrate, periode_time, and buffersize, but right now I dont have a clue if this is the problem at all, or how to do it.

I dont know about any lfe crossover settings i ALSA, and I would be surprised if it was, a crossover should be controlled by the end of the soundchain , and that will be in most cases by todays standard the receiver itself, or in some cases the subwoofer, or the speaker.

@Grim. Do you have any crackling in your games, especially in parts with bass parts?
You seem to have some knowledge about ALSA, and is there a way to change the some of the earlier mention settings? Like Bitrate, buffersize, and periode_time?
< >
Showing 1-15 of 51 comments
Per page: 1530 50