[Cubox i4] sound issue
Home › Forums › GeeXboX on ARM SoCs › [Cubox i4] sound issue
Tagged: Cubox, hdmi, sound, steroupmix
This topic contains 16 replies, has 2 voices, and was last updated by
togath 2 months, 2 weeks ago.
-
AuthorPosts
-
Hello,
my sound config is as follows 7.1, optimised and passthrough via HDMI.
That works as expected.But now I wanted to try stereo-upmix. But nothing happens.
I expected to get 3 left, 3 right LPCM channels and 0.5l+0.5r LPCM for center.But I only receive a stereo signal, regardless which configuration (2.0 to 7.1) I choose.
Same happens if I deactivate passthrough. A DD/DTS audio stream with 5.1 is downmixed to 2.0 LPCM.This there a trick for CuBox to get this working?
Cheers togath
I tested this with an Audiolab as well as an Kenwood amplifier.
Works here. At least in 5.1 mode using an Yamaha RX-A810. Here is the debug log when playing an audio file with 2 -> 6 upmixing (even though I normally let the AVR do this…):
19:22:59 T:1953494032 INFO: CActiveAESink::OpenSink - initialize sink 19:22:59 T:1953494032 DEBUG: CActiveAESink::OpenSink - trying to open device ALSA:hdmi:CARD=imxhdmisoc,DEV=0 19:22:59 T:1953494032 DEBUG: CAESinkALSA::GetChannelLayout - Input Channel Count: 6 Output Channel Count: 6 19:22:59 T:1953494032 DEBUG: CAESinkALSA::GetChannelLayout - Requested Layout: FL,FR,FC,BL,BR,LFE 19:22:59 T:1953494032 DEBUG: CAESinkALSA::GetChannelLayout - Got Layout: FL,FR,BL,BR,FC,LFE 19:22:59 T:1953494032 INFO: CAESinkALSA::Initialize - Attempting to open device "hdmi:CARD=imxhdmisoc,DEV=0" 19:22:59 T:2029184016 DEBUG: OnPlayBackStarted : play state was 1, starting 0 19:22:59 T:1965047808 DEBUG: ADDON: Dll Initializing - OpenGL Spectrum 19:22:59 T:1953494032 INFO: CAESinkALSA::Initialize - Opened device "hdmi:CARD=imxhdmisoc,DEV=0,AES0=0x04,AES1=0x82,AES2=0x00,AES3=0x00" 19:22:59 T:1953494032 INFO: CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats 19:22:59 T:1953494032 INFO: CAESinkALSA::InitializeHW - Using data format AE_FMT_S24NE4L 19:22:59 T:1953494032 DEBUG: CAESinkALSA::InitializeHW - Request: periodSize 128, bufferSize 8820 19:22:59 T:1953494032 DEBUG: CAESinkALSA::InitializeHW - Got: periodSize 128, bufferSize 8832 19:22:59 T:1953494032 DEBUG: CAESinkALSA::InitializeHW - Setting timeout to 201 ms 19:22:59 T:1953494032 DEBUG: CAESinkALSA::GetChannelLayout - Input Channel Count: 6 Output Channel Count: 6 19:22:59 T:1953494032 DEBUG: CAESinkALSA::GetChannelLayout - Requested Layout: FL,FR,FC,BL,BR,LFE 19:22:59 T:1953494032 DEBUG: CAESinkALSA::GetChannelLayout - Got Layout: FL,FR,BL,BR,FC,LFE 19:22:59 T:1953494032 DEBUG: CActiveAESink::OpenSink - ALSA Initialized: 19:22:59 T:1953494032 DEBUG: Output Device : imx-hdmi-soc 19:22:59 T:1953494032 DEBUG: Sample Rate : 44100 19:22:59 T:1953494032 DEBUG: Sample Format : AE_FMT_S24NE4L 19:22:59 T:1953494032 DEBUG: Channel Count : 6 19:22:59 T:1953494032 DEBUG: Channel Layout: FL,FR,BL,BR,FC,LFE 19:22:59 T:1953494032 DEBUG: Frames : 128 19:22:59 T:1953494032 DEBUG: Frame Samples : 768 19:22:59 T:1953494032 DEBUG: Frame Size : 24Of course this requires that your sink is properly reporting that it’s capable of doing multichannel LPCM via EDID. You don’t happen to use one of those HDMI splitters?
Thanks for confirmation.
No, I do not use a splitter. It’s a 1:1 HDMI connection.
My Sony BDP-S390 Blu-ray Player is capable of outputting 8 channel LPCM over HDMI this works with both amplifiers.There seems to be a missunderstanding between CuBox and my amplifiers. Cannot provide the log right now – I’m doing a fresh install ?
Is there a way to force Geexbox to use certain parameters even if it is not recognised correctly?
This is from the armada-cubox. It’s the same as on the freescale-cubox:
22:39:55 T:3025138704 INFO: CActiveAESink::OpenSink - initialize sink 22:39:55 T:3025138704 DEBUG: CActiveAESink::OpenSink - trying to open device ALSA:hdmi:CARD=SPDIF,DEV=0 22:39:55 T:3025138704 DEBUG: CAESinkALSA::GetChannelLayout - Input Channel Count: 6 Output Channel Count: 6 22:39:55 T:3025138704 DEBUG: CAESinkALSA::GetChannelLayout - Requested Layout: FL,FR,FC,BL,BR,LFE 22:39:55 T:3025138704 DEBUG: CAESinkALSA::GetChannelLayout - Got Layout: FL,FR,BL,BR,FC,LFE 22:39:55 T:3025138704 INFO: CAESinkALSA::Initialize - Attempting to open device "hdmi:CARD=SPDIF,DEV=0" 22:39:55 T:3025138704 INFO: CAESinkALSA::Initialize - Opened device "hdmi:CARD=SPDIF,DEV=0,AES0=0x04,AES1=0x82,AES2=0x00,AES3=0x00" 22:39:55 T:3025138704 INFO: CAESinkALSA::InitializeHW - Unable to open the required number of channels 22:39:55 T:3025138704 INFO: CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats 22:39:55 T:3025138704 INFO: CAESinkALSA::InitializeHW - Using data format AE_FMT_S24NE4L 22:39:55 T:3025138704 DEBUG: CAESinkALSA::InitializeHW - Request: periodSize 2205, bufferSize 8820 22:39:55 T:3025138704 DEBUG: CAESinkALSA::InitializeHW - Got: periodSize 1088, bufferSize 8816 22:39:55 T:3025138704 DEBUG: CAESinkALSA::InitializeHW - Setting timeout to 200 ms 22:39:55 T:3025138704 DEBUG: CAESinkALSA::GetChannelLayout - Input Channel Count: 6 Output Channel Count: 2 22:39:55 T:3025138704 DEBUG: CAESinkALSA::GetChannelLayout - Requested Layout: FL,FR,FC,BL,BR,LFE 22:39:55 T:3025138704 DEBUG: CAESinkALSA::GetChannelLayout - Got Layout: FL,FR 22:39:55 T:3025138704 DEBUG: CActiveAESink::OpenSink - ALSA Initialized: 22:39:55 T:3025138704 DEBUG: Output Device : Kirkwood SPDIF 22:39:55 T:3025138704 DEBUG: Sample Rate : 44100 22:39:55 T:3025138704 DEBUG: Sample Format : AE_FMT_S24NE4L 22:39:55 T:3025138704 DEBUG: Channel Count : 2 22:39:55 T:3025138704 DEBUG: Channel Layout: FL,FR 22:39:55 T:3025138704 DEBUG: Frames : 1088 22:39:55 T:3025138704 DEBUG: Frame Samples : 2176 22:39:55 T:3025138704 DEBUG: Frame Size : 8It seems to find the 6 channels (currently testing with 5.1 channels) but for some reason cannot open them …
This is from the armada-cubox.
Please leave out the old CuBox! The Armada/Kirkwood hardware is not capable of multichannel LPCM and HD audio.
Is there a way to force Geexbox to use certain parameters even if it is not recognised correctly?
No. The kernel parses the information delivered by the sink. The only addition we have introduced is a non-standard parameter in our kernels that allows to ignore the EDID completely and use the same internal fallback that gets used when no EDID is received. But that will restrict the output to 2 channels (i.e. basic audio support).
Can you boot up with one of your amps connected and post the non-zero part of:
cat /sys/devices/soc0/soc.1/20e0000.hdmi_video/edidAnd I imply that you are using a fairly recent snapshot. Even though I think the last audio-related changes were done a year ago or so…
Hi Rudi,
here are the non-zero rows of the freescale CuBox
0x00 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0x00 0x24 0x27 0x34 0x93 0x01 0x00 0x00 0x00 0x00 0x14 0x01 0x03 0x80 0x80 0x48 0x78 0x0A 0xDA 0xFF 0xA3 0x58 0x4A 0xA2 0x29 0x17 0x49 0x4B 0x21 0x08 0x00 0x31 0x40 0x45 0x40 0x61 0x40 0x81 0x80 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x02 0x3A 0x80 0x18 0x71 0x38 0x2D 0x40 0x58 0x2C 0x45 0x00 0xB8 0x88 0x21 0x00 0x00 0x1E 0x66 0x21 0x56 0xAA 0x51 0x00 0x1E 0x30 0x46 0x8F 0x33 0x00 0xBA 0x88 0x21 0x00 0x00 0x1E 0x00 0x00 0x00 0xFC 0x00 0x53 0x49 0x49 0x20 0x52 0x45 0x50 0x45 0x41 0x54 0x45 0x52 0x0A 0x00 0x00 0x00 0xFD 0x00 0x17 0x3D 0x0F 0x44 0x0F 0x00 0x0A 0x20 0x20 0x20 0x20 0x20 0x20 0x01 0xF2 0x02 0x03 0x30 0xF1 0x4E 0x9F 0x90 0x14 0x05 0x13 0x20 0x21 0x22 0x04 0x12 0x03 0x16 0x07 0x01 0x23 0x0F 0x1F 0x07 0x23 0x17 0x1F 0xC0 0x23 0x3F 0x1F 0xC0 0x23 0x09 0x7F 0x07 0x83 0x4F 0x00 0x00 0x68 0x03 0x0C 0x00 0x11 0x00 0xB8 0x2D 0x00 0x01 0x1D 0x80 0x18 0x71 0x1C 0x16 0x20 0x58 0x2C 0x25 0x00 0xB8 0x88 0x21 0x00 0x00 0x9E 0x01 0x1D 0x00 0xBC 0x52 0xD0 0x1E 0x20 0xB8 0x28 0x55 0x40 0xB8 0x88 0x21 0x00 0x00 0x1E 0x01 0x1D 0x80 0x18 0x71 0x38 0x2D 0x40 0x58 0x2C 0x45 0x00 0xB8 0x88 0x21 0x00 0x00 0x1E 0x01 0x1D 0x00 0x72 0x51 0xD0 0x1E 0x20 0x6E 0x28 0x55 0x00 0xB8 0x88 0x21 0x00 0x00 0x1E 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x38The remaining 16 rows are zeros.
I just run an ‘upgrade’ before the reboot. So the binaries should be ‘latest’.
Wow, that’s interesting!!! This EDID contains two LPCM audio blocks. One with a maximum sample rate of 96kHz and 8 channels and one with 192kHz and 2 channels. Obviously our kernel is picking the latter. I have to look if we can change this behaviour (i.e. prefer channels over sample rate or use only the first block in the assumption that it’s the default)
Edit: Just looked at the relevant code. It seems not to prefer the last block, but creates a union of all capabilities. In this case that would be 8 channels @192kHz. Not correct, IMHO, but that would not explain what you see.
I just run an ‘upgrade’ before the reboot. So the binaries should be ‘latest’.
That upgrade stuff doesn’t always work. Can you try a forced reinstall of the ‘linux’ package?
O.K., I think I’ve found something ? Please try this kernel…
Hi Rudi,
WOW! Impressive! You fixed it! It’s working even with 7.1 config and up to 96KHz.
My manual for the Audiolab says the same:
- 2 channel LPCM can be decoded to 192KHz/24Bit stereo signal
- 3-8 channel LPCM will be decoded to 96KHz/24Bit signals with an option to stereo-downmix
Now I’m interessted in this EDID thing. Do you have some hint for good documentation of it?
Thank you very much for the ultra-fast fix. Hope you didn’t work on it all night and day …
By the way: Now I know how to exchange a kernel ? (never done this before :P)
Found a bug … sorry.
Geexbox setting No of LPCM channels 2.0 2 (stereo) 2.1 6 3.0 6 3.1 6 4.0 4 4.1 6 5.0 6 5.1 6 7.0 8 7.1 8I would expect to have exactly the number of channels as configured in Cubox to be output as LPCM.
E.g. a 4.1 configuration would make 5 LPCM signals.But it doesn’t bother me. It’s correct for 5.1 and 7.1.
Ok, the excessive channels are not carrying any audio signal. But they are provided by CuBox as ‘silenced’.
The channel mapping is correct.Maybe it’s not a bug …. I could ask now, why Cubox opens more channels than requested… But nevermind!
Now I’m interessted in this EDID thing. Do you have some hint for good documentation of it?
You can throw your hexdump on the Web EDID reader to get an idea what’s in there. Otherwise the CEA-861 as well as the HDMI standard documents are the ultimative source. However, these are not freely available. You have to buy them if don’t find them somewhere in the big bad web…
BTW, the problem with your device was, that it’s EDID contains multiple audio blocks (actually 4) each carrying only a single “short audio descriptor”. This doesn’t make much sense as there is space for up to 10 descriptors in one block. But it is allowed according to the standard. Unfortunately, the EDID parser in the imx6 kernel did not handle multiple audio blocks correctly in so far, that it was resetting already gathered information at the beginning of each new block. This effectively made it use only the content of the last block, which happened to be the 2 channel/192kHz one.
I could ask now, why Cubox opens more channels than requested…
Because the imx6 cannot enable arbitrary HDMI audio streams. If the speaker allocation says that the LFE channel is on stream 5 and we want to use it in a 2.1 configuration, we have to open 0,1,2,3,4,5 and fill 2,3 and 4 with silence. Also the number of streams has to be even. It might be possible to flag the unused stream data as “invalid”, but since I don’t know the consequences I’m not eager to try this.
Actually I’m not 100% happy with the solution I sent yesterday because it will – in your case – restrict everything to 96kHz. This can cause problems with EAC3 in passthrough mode. I will post another version that will not limit the sample rate later. But it might cause the CuBox-i to send 8 channels with more than 96kHz to your amp.
Please try the newer zImage, but turn down the volume in case you are feeding something with more than 2 channels and 96kHz.
Hi Rudi,
thanks for the link and for the explanation why more LPCM channels are present than needed.
This leaves two option for me regarding further upgrades:
– stay with the dev-build of yours
– limit the sampling rate to 96KHz in CuBoxBoth seems to be ok for me

When we switch to a newer kernel, the dev-build will no longer work. Also you cannot restrict the output sample rate in XBMC/Kodi when the device is HDMI. This option is only present for SPDIF. However, it appears that there is a way to change the ALSA driver in the kernel to be able to adapt to this. Given the way Kodi sets up the audio hardware, this would cause an automatic fallback to two channels in case the sample rate is beyond the capabilities for multichannel mode. Maybe I can have a look at this at the weekend…
O.K., I think I modified the kernel to behave like described above. You can download is from here and give it a try. Now Kodi/XBMC should never send streams that go beyond your AVR’s capabilities. But be aware that Kodi/XBMC will prefer bit rate over channels. So if you have a 192kHz / 8 channel source it will be downmixed to 2 channels. If the source is 96kHz or below, 8 channels will be sent. IMHO, in the first case it would be better to downsample from 192 to 96kHz and send all channels. But that has to be done in Kodi/XBMC, not in our kernel driver…
-
AuthorPosts
You must be logged in to reply to this topic.