CM6631 usb audio interface .... any good?

Just - do you really need 16bit output, when 24bit covers 16bit losslessly?
Yes :) Can you help me implement this? Is it real?

Perhaps the following information will be useful. I had an Amanero-based DAC that indicated both bit depth and sampling rate. According to the indications of this DAC in OpenELEC, the bit depth always exactly corresponds to the file being played. I think that's the way it should be - what pass in, that pass out without any transformations.

When connecting my DIY DAC based on CM6632A that supports 32 bits, all data is output in 24 bits. Do I understand correctly that this is determined by this (xbmc/AESinkALSA.cpp at a0d424ec8f1050b29c2233e57952c20f1c63c993 * xbmc/xbmc * GitHub) code?
 
It's up to kodi what format it requests. Are you sure your file is really 24bits, and not 32bits? mediainfo or soxi would tell you.

Do I understand correctly that this is determined by this (xbmc/AESinkALSA.cpp at a0d424ec8f1050b29c2233e57952c20f1c63c993 * xbmc/xbmc * GitHub) code?

IMO that's only setting the result value for the rest of kodi. IMO the code is
xbmc/AESinkALSA.cpp at a0d424ec8f1050b29c2233e57952c20f1c63c993 * xbmc/xbmc * GitHub
and this looks OK too xbmc/AESinkALSA.cpp at a0d424ec8f1050b29c2233e57952c20f1c63c993 * xbmc/xbmc * GitHub

I do not know what kodi does when reading params of the input file. But are you sure you want to hack kodi?
 
Are you sure your file is really 24bits, and not 32bits? mediainfo or soxi would tell you.
Yes, I am sure. Most of the files I have in my music library are 16-bit 44.1kHz. The other part is Hi-Res files 24-bit up to 192kHz. I also have several ISO images of DSD files.

But are you sure you want to hack kodi?
If only that would solve the problem. I have previously compiled Kodi from sources. In the meantime, I think we need to look from the CM6632A side, since there was no such problem on Amanero. Unfortunately I don't currently have my old DAC based on Amanero.
 
I had an interface based on the official Amanero firmware, which was called Charleston and which supports the following modes: 44.1; 48.0; 88.2; 96.0; 176.4; 192.0; 352.8; 384.0 kHz samplerate and 16; 24; 32 bit depth. Also it supported: DSD64, DSD128, DSD256, DSD512. This interface had the ability to display the bit depth and samplerate of the currently playing audio file.

I attached a dataset to this interface, but it's in Russian. The discussion of this interface (in Russian) was on this forum. Perhaps Google Translate will help you if you are interested in reading this :)

Perhaps in the future I will be able to take my old DAC for a while for tests.
 

Attachments

  • описание Charleston.pdf
    895.5 KB · Views: 333
OpenELEC is a rather stripped-down system, so the /proc/asound/cardX/pcmYp/subZ/hw_params file is not there. Apparently this is a feature of the ALSA build for this OS. I have attached the output of the ls command to the message. I looked through the entire asound directory for the presence of this file, but did not find it. At the time of the search, the track was being played.

Therefore, I made your recommendations in Ubuntu + Kodi 17.6. I attached the output of hw_params and mediainfo for two tracks to the message. One is 16/44.1 and the other is 24/192. The files show the influence of pulseaudio, which you mentioned earlier. Alternatively, I can try to temporarily disable pulseaudio. Is it worth doing this?
 

Attachments

  • hw_params_Julio Iglesias 24-192.txt
    127 bytes · Views: 128
  • hw_params_France Gall 16-44.1.txt
    127 bytes · Views: 118
  • Julio Iglesias 24-192.txt
    1.6 KB · Views: 113
  • France Gall 16-44.1.txt
    1.4 KB · Views: 137
  • ls_card0.txt
    445 bytes · Views: 119
Tested kodi 19.2 in my Mint (=ubuntu 20.04).

Created test wavs - rate and sample size combination:

Code:
for R in 44100 48000 96000 192000; do for B in 16 24 32; do sox -V -r $R -c 1 -n -b $B -c 2 $R-$B.wav synth 100 sine 1k gain -1; done;done

Playback to Loopback snd-aloop device which accepts any rate and integer sample size. Checked with aplay -D hw:Loopback xxx.wav that the Loopback playback device is correctly set by the wavs

Code:
watch -n 0.2 'cat /proc/asound/Loopback/pcm0p/sub0/hw_params'

Started kodi with alsa plugin support:

Code:
KODI_AE_SINK=ALSA kodi

Kodi settings: advanced, Loopback device, output config 'Best Match', keep audio device alive "Off".

Playing the generated wavs - rates are switched correctly, output always at S24_3LE, no matter what wav resolution was. Looking at logs and the source code explains the reason:

Code:
2021-10-21 10:54:07.643 T:17069    INFO <general>: CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats
2021-10-21 10:54:07.643 T:17069    INFO <general>: CAESinkALSA::InitializeHW - Using data format AE_FMT_S24NE3

Kodi internally uses float32 (like many other audio processors e.g. jackd), therefore the AESink receives the samples in float. Of course the soundcard does not support float format, the initial setting of AE_FMT_FLOAT fails xbmc/AESinkALSA.cpp at a0d424ec8f1050b29c2233e57952c20f1c63c993 * xbmc/xbmc * GitHub and kodi starts to try every format from its format enum, going backward xbmc/AESinkALSA.cpp at a0d424ec8f1050b29c2233e57952c20f1c63c993 * xbmc/xbmc * GitHub . The list is xbmc/AEChannelData.h at a80d1293b0579bbed7dd7d20304ba34a20519f78 * xbmc/xbmc * GitHub - the first integer format from the back of the enum is AE_FMT_S24NE3 xbmc/AEChannelData.h at a80d1293b0579bbed7dd7d20304ba34a20519f78 * xbmc/xbmc * GitHub . Converted to alsa format SND_PCM_FORMAT_S24_3LE xbmc/AESinkALSA.cpp at a0d424ec8f1050b29c2233e57952c20f1c63c993 * xbmc/xbmc * GitHub . Loopback supports SND_PCM_FORMAT_S24_3LE, therefore this format is used for every wav played in kodi.

I find the algorithm and enum order reasonable, S24_3LE is an optimal format for audio playback.
 
Switching between paplayer and videoplayer advancedsettings.xml - Official Kodi Wiki makes no difference, in both cases the format passed to the output AE sink is float.

Of course replacing the internal player with an external bitperfect one works, kodi serves just to select the track and start the player

External players - Official Kodi Wiki

E.g. setting aplay works and makes the playback bitperfect, but giving XBMC no control over the player once started:

Code:
<playercorefactory>
  <players>
    <player name="APLAY" type="ExternalPlayer" audio="true" video="false">
      <filename>/usr/bin/aplay</filename>
      <args>-D hw:Loopback "{1}"</args>
      <hidexbmc>false</hidexbmc>
    </player>
  </players>
  <rules action="prepend">
    <rule audio="true" player="APLAY"/>
  </rules>
</playercorefactory>

But all of this has nothing to do with the output audio device.
 
Last edited:
Hi, All!
Can anybody help me? I bought CM6533 chip on aliexpress and connected it directly to usb on win10. The system recognized the chip as "Mad Catz Rock Band Microphone" with VID_0738&PID_7363. It seems the chip is not new and was soldered out from some equipment. I connected to the chip using utility Config65XX.exe, it shows that EEPROM is empty. When I try to write to EEPROM the utility shows "Operate EEPROM Failed". Is it possible to reprogram the chip or it is unusable? Maybe anybody recommend me appropriate forum?
 
Hi, All!
Can anybody help me? I bought CM6533 chip on aliexpress and connected it directly to usb on win10. The system recognized the chip as "Mad Catz Rock Band Microphone" with VID_0738&PID_7363. It seems the chip is not new and was soldered out from some equipment. I connected to the chip using utility Config65XX.exe, it shows that EEPROM is empty. When I try to write to EEPROM the utility shows "Operate EEPROM Failed". Is it possible to reprogram the chip or it is unusable? Maybe anybody recommend me appropriate forum?
If this appears, it is certainly a reused chip.
I only buy when it is a lote of 3 or 5 units, to avoid reused chips.
But you can write yes, did you follow the steps as shown on page 29 of the datasheet?
Do you have the standard firmware? Or did you develop the code?
Do you know if model CM6535 has SPDIF I/O enabled in standard firmware? I really want a 24-bit interface with SPDIF I/O only.
 
felipeunix, thanks for you answer. I thought that Config65XX utility can do the steps shown on page 29. So I need to interact with chip using SPI, thanks for the hint. I did not develop the code for 8051, but I will try to find samples for the start point. I will pay attention to SPDIF realization in firmware if I have any.
 
After 6 years, I built an amplifier again using a CM6631A module. I will describe some of my experiences, I think it will be useful for others as well.

-Flashtool 2.1.0.9 runs on Windows 10.

-If the fw upgrade process stops during upgrade and the CM6631A no longer works, you can still repair it using the free Zladig program, you will need to install a driver for it as a libusb-win32 device using Zladig. Flashtool can then write new firmware to the device. This happened with me once. https://zadig.akeo.ie/

Steps for successful firmware update:
-Plug-in the CM6631A, select the proper device (there can be more than one on the list, check for 0D8C... on the list), then press erase.
-Important, be sure to remove, than re-plug the CM6631A before trying to upload the new firmware.
-Select the proper USB device (there can be more than one on the list, check for 0D8C... on the list) then load your firmware.
-Re-connect after firmware update.

I uploaded the files to keep them available.
I also uploaded my own firmware file, I use it with PCM5102A DAC in 3-wire I2S mode. (for 45/49MHz crystal pair CM6631A's, 32bit / 384k mode)
 

Attachments

  • CM6631A_firmware_for_PCM5102A_32bit_384k.zip
    19.9 KB · Views: 343
  • Firmware_Tool_2.1.0.9.zip
    1.2 MB · Views: 374
  • CM6631AConfigurateTool.zip
    880.5 KB · Views: 351
  • Thank You
Reactions: 1 user
After 6 years, I built an amplifier again using a CM6631A module. I will describe some of my experiences, I think it will be useful for others as well.

-Flashtool 2.1.0.9 runs on Windows 10.

-If the fw upgrade process stops during upgrade and the CM6631A no longer works, you can still repair it using the free Zladig program, you will need to install a driver for it as a libusb-win32 device using Zladig. Flashtool can then write new firmware to the device. This happened with me once. https://zadig.akeo.ie/

Steps for successful firmware update:
-Plug-in the CM6631A, select the proper device (there can be more than one on the list, check for 0D8C... on the list), then press erase.
-Important, be sure to remove, than re-plug the CM6631A before trying to upload the new firmware.
-Select the proper USB device (there can be more than one on the list, check for 0D8C... on the list) then load your firmware.
-Re-connect after firmware update.

I uploaded the files to keep them available.
I also uploaded my own firmware file, I use it with PCM5102A DAC in 3-wire I2S mode. (for 45/49MHz crystal pair CM6631A's, 32bit / 384k mode)

Is it possible to configure SPDIF input?
I would like to build with SPDIF I/O only.
You know how?
Any content about inputs is so hard to find. :(
 
Hello, everyone!

I am trying to connect my ADSP21489 with my XMOS I2S interface. However, I have not been successful because the XMOS is in master mode. I have also tried the same thing with SA9227, but have not been successful there either.

I have heard from ppp000 that the playback function of CM6631 can be set up to slave mode by updating its firmware. Has anybody had experience with that? Can somebody recommend a board from Aliexpress or Ebay that I can use. (I live in Europe and can't order from other sites.)
 
Hello, everyone!

I am trying to connect my ADSP21489 with my XMOS I2S interface. However, I have not been successful because the XMOS is in master mode. I have also tried the same thing with SA9227, but have not been successful there either.

I have heard from ppp000 that the playback function of CM6631 can be set up to slave mode by updating its firmware. Has anybody had experience with that? Can somebody recommend a board from Aliexpress or Ebay that I can use. (I live in Europe and can't order from other sites.)
XMOS you can adjust according to the library, everything is in the documentation.

SA9227 does not provide documentation, how did you manage to do this?
Share with us the firmwares for SA9227?
 
Hello Forum,

I gave the CM6631A a try and brought a simple board form Aliexpress. https://de.aliexpress.com/item/1005005178398281.html

This workes quiet well, if a simply attach a I2S amplifer to it. But I would like to combine this board with an ADAU1701 DSP that is already interfacing an APTx Bluetooth module. Hence the CM has to run in an I2S slave configuration. How can I archive that? Is it even possible to configure the CM6631A as an I2S slave device to output USB sound towards my DSP?

BR Chris
 
-Flashtool 2.1.0.9 runs on Windows 10
It doesn't work on Windows 10x64 Home

I have the CM6631A device bought on Ali in 2023. It has analog Speakers, Headphones and 2 SPDIF (coax. & opt.) outputs.
Everything works well on Win10x64 with C_MEDIA_Inc._USB_Audio_Class_1.0_and_2.0_DAC_Device_Driver_DAC_10.0.12.10, but this device is displayed in Windows as Speakers, but I want as SPDIF to transmit also multi-channel audio to the receiver (PCM max. 2x96kHz/24-bit, Dolby/DTS 6.1).
Device ID: USB\VID_0D8C&PID_0004&REV_0208&MI_00
Can I reflash such a device with new firmware created with CM6631AConfigurateTool after change to SPDIF ?
Will the Speakers and Headphones analog outputs also work?
Sorry, I'm very afraid of ruining the device :unsure:
 

Attachments

  • CM6631A-inside.jpg
    CM6631A-inside.jpg
    133.2 KB · Views: 52
  • DSC01596.JPG
    DSC01596.JPG
    615.3 KB · Views: 53