[TESTING] Improved LPCM output for Vero 4K


Update: the improvements should now cover 5 channel, 3 channel and 4.0 playback. The instructions can be followed again.

Recently, we resolved an issue where multi-channel output that was not bitstreamed would be played with a mismatched channel layout.

While this now seems to be resolved, 5.1 LPCM audio is still being output in a 7.1 container. This isn’t ideal – and we’d like to output the source as is if possible.

There’s now been some work on this, with excellent feedback, advice and testing from @grahamh and @JimKnopf. This may be applicable for other audio layouts; but we need further testing of 5.1 alone first.

I’d appreciate it if you could test this and provide feedback before we potentially release this as an update to other users. To test this update:

  1. Login via the command line
  2. Edit the file /etc/apt/sources.list
  3. Add the following line: deb http://apt.osmc.tv stretch-devel main
  4. Run the following commands to update: sudo apt-get update && sudo apt-get dist-upgrade && reboot
  5. Your system should have have received the update.

Please see if the issue is resolved.

I also recommend you edit /etc/apt/sources.list again and remove the line that you added after updating. This will return you to the normal update channel.

Please report back:

  • AV receiver make and model
  • Speaker configuration
  • Kodi debug log


So, a quick test with one file on a friend’s setup:

  • Yamaha RX-V477
  • 5.1 speaker configuration
  • log: http://paste.osmc.tv/xeherozina
  • visible and audible result: AVR shows 5.1 channel layout, all channels play back without distortion (EDIT: also tested a 7.1 PCM channel test audio file afterwards, channel downmixing properly done by the AVR, all channels passed to the AVR without distortion!)

From the log (I like!):

23:23:35.449 T:4038062848 DEBUG: CAESinkALSA::GetChannelLayout - Input Channel Count: 6 Output Channel Count: 8
23:23:35.449 T:4038062848 DEBUG: CAESinkALSA::GetChannelLayout - Requested Layout: FL,FR,FC,LFE,SL,SR
23:23:35.449 T:4038062848 DEBUG: CAESinkALSA::GetChannelLayout - Got Layout: FL,FR,LFE,FC,SL,SR,UNKNOWN1,UNKNOWN1 (ALSA: FL FR LFE FC RL RR NA NA)
23:23:35.450 T:4038062848 INFO: CAESinkALSA::GetChannelLayout - masking for 5.1 audio output

1 Like

Thanks for letting me know.
If others confirm positive reports, we can work on other outputs too.

Really impressed, @sam_nazarko! :scream: Thanks for your work.

Works perfectly with my Marantz NR1603. Tried several titles with 5.1 PCM audio (Crimson Tide, The Rock, Pirates of the Caribbean), in all cases the AVR now reports a 3/2/.1 channel layout and nothing seems to be broken on the audio side. Thanks for looking at this so quickly.

However, this update has broken chapter skipping on 4K titles. On skipping a chapter, the playback switches to something like a very fast stuttering, almost flashing images, totally unwatchable. I saw in another thread that something has changed there?

I’ll test this too - assume flac 5.1 is OK to test as this will be decoded & sent as PCM. Can rip some PCM disks if necessary.

flac is fine


sudo su
echo 10 > /sys/module/amvdec_h265/parameters/dynamic_buf_num_margin

There’s another experiment going on in the staging repo and that should fix it.

thanks, this fixed the chapter skip stuttering.

1 Like

I’ll see if @sam_nazarko can reset it to 10 in stretch-devel today.

Hi, i tested this as well on
Denon X2000
5.1 speaker systems
log https://paste.osmc.tv/yazarimoka
i had tried both 5.1 and 7.1 in the audio menu and it works. it maps the 5.1 files (aac) to 5.1 and 7.1 to 7.1 (avr simulates the 7.1 to my 5.1 setup which i would like it to do) however it seems like when selecting 7.1 output i get distortions/cracking noice in the rear speakers. it seems random because sometimes it is very loud and i stop the film and start it again it is either gone or very low noice.

Thanks for the report. I think what’s happening is when you go from one audio setup to another, lots of things have to change in the audio registers in the chip and maybe some bits or unflushed buffers get left behind. It usually clears by playing some plain stereo tracks then going back to multi-channel.

If you can manage to reproduce this repeatedly with a particular sequence of playing files that should help to find the bug.

ok thanks for the feedback. correct if i play some stereo it seems like it cleans it up. i will test it for a while as i just open some files checking for a few minutes. i have currently set it to 7.1 in kodi as my av receiver is a 7.1 so that should be the correct settings i guess.

Thanks again for amazing support!

Yes, this is correct…

Hi, all works ok for me now too, besides experiencing the skipping bug, which was fixed by grahamh.

5.1 pcm outputs as 5.1.
As mentioned I get a random crackle/distortion noise also.

Pioneer vsx-930

Thank all involved for the fix.


Seem to be OK for me also.

AVR info screen showed 5.1 input and 5.1 output.

When do you get this crackle? At the start of the 5.1 playback, or when you play something else?


Hi Sam,

When I play a pcm file first off, everything is fine. When I stop and then play another pcm file then the noise may or may not happen.

Also I was binge watching a 20 minute tv show with a pcm soundtrack, so letting the episodes of a series run through one after another without stopping, and when a new episode would start sometimes there would be the crackle, or a really loud distortion…made the kids jump :wink:. But it is always random. Sometimes they would follow through just fine.

Can you confirm the file formats for these? (audio type and channels)

Hi Graham, AAC 5.1 audio. The odd AAC 7.1 also.