CM6631 usb audio interface .... any good?

Such error give indication that firmware on the receiver is hang or on the host you have active multiple instances of the same driver, some dormant. If Windows 10, it can be wrong installation of the driver (a clash between built-in UAC 2.0 and CM driver. Uninstall CM driver and restart computer. Try with a built-in UAC 2.0 driver first. If decided to install a driver again, do it with device unplugged. Installator may ask you to plug-in device, then do it. Otherwise wait till it finishes successfuly. Now it is a time to plug-in USB cable. This is a general guide to deal with Win 10 problems.

However you had a different message before. Don't play with different word lenght, stick with 24-bit. Then unplug USB cable, verify that device have disappeared from Device Manager. If not, remove driver manually from the list. Power cycle the receiver and try again.
 
Last edited:
Uninstall CM driver and restart computer.
I did not install a own driver for CM6632A, since earlier on this forum it was written that the driver for the firmware from the SDK is installed by Windows Update.
 

Attachments

  • Driver.png
    Driver.png
    110.2 KB · Views: 341
  • Driver 2.png
    Driver 2.png
    111.6 KB · Views: 326
It's amazing, but I don't find C-Media drivers in the list of installed applications. I also deleted everything related to ASIO. However, I understand you, since I myself see ASIO for C-Media in the output devices list. Most likely, there was an incorrect removal of drivers sometime. I'll try to figure it out.
 
How to configure S/PDIF output in Windows

Hi,
I would like to use SPDIF output of CM6631A based controller on Windows11.
I have popular CM6631A based USB sound card like:
HiFi CM6631A 32bit 384K USB To SPDIF Coaxial Optical Fiber Output DAC Board 4891652178744 | eBay
After plug WIN11 recognised only:
  • USB2.0 High-Speed True HD Audio
but not SPDIF out.
Some time ago I used this card in Linux and it recognized both:
  • USB2.0 High-Speed True HD Audio Digital Stereo (IEC958)
  • Digital Output (S/PDIF)

I use default Windows drivers:
Microsoft, ver.:10.0.22000.1, Date: 05.06.2021
I also found (in the internet) and installed C-Media drivers:
C-Media, ver.:10.0.12.9, Date: 29.11.2016
But without the difference: still the system do not see SPDIF output.
Is there any way to configure this in Windows?
 
For some USB boards the SPDIF output appears as a separate sound device in Windows. For other USB board the SPDIF output appears as the same device as the I2S output (in other words, there is only one device shown in Windows). IIRC the type of board or device you are using only shows up as one device in Windows. Have you checked the I2S and SPDIF outputs with a scope when music is playing to see if any signal is there?
 
Have you checked the I2S and SPDIF outputs with a scope when music is playing to see if any signal is there?

Yes music is playing.
I would like to use SPDIF to passthrough multichannel signal to the external AVR (AC3, DTS, etc decoder). It worked fine in Linux when I selected 'Digital Output (S/PDIF)' but in Windows 11 only two channels are passed. I don't know how to configure it and whether it is possible at all with the current Win drivers...
 
Windows assumes by default audio streams are PCM and will automatically resample such streams as it deems necessary. That can ruin DSD and or other non-stereo steams. Using ASIO drivers or else WASAPI Exclusive Mode can cause Windows to leave audio streams unmolested. If there is no ASIO driver for the USB device then maybe the freeware ASIO4ALL driver could help. Don't know.
 
See how Kodi in Linux recognise the two output of the CM6631A USB card:
Code:
Device 1
    m_deviceName      : Default
    m_displayName     : Default
    m_displayNameExtra: Default Output Device
    m_deviceType      : AE_DEVTYPE_PCM
    m_channels        : FL, FR
    m_sampleRates     : 5512,8000,11025,16000,22050,32000,44100,48000,64000,88200,96000,176400,192000,384000
    m_dataFormats     : AE_FMT_U8,AE_FMT_S16NE,AE_FMT_S24NE3,AE_FMT_S24NE4,AE_FMT_S32NE,AE_FMT_FLOAT
    m_streamTypes     : No passthrough capabilities
Device 2
    m_deviceName      : alsa_output.usb-C-Media_Electronics_Inc._USB2.0_High-Speed_True_HD_Audio-00.iec958-stereo
    m_displayName     : CM6631A Audio Processor Digital Stereo (IEC958)
    m_displayNameExtra: Digital Output (S/PDIF)
    m_deviceType      : AE_DEVTYPE_IEC958
    m_channels        : FL, FR
    m_sampleRates     : 5512,8000,11025,16000,22050,32000,44100,48000,64000,88200,96000,176400,192000,384000
    m_dataFormats     : AE_FMT_U8,AE_FMT_S16NE,AE_FMT_S24NE3,AE_FMT_S24NE4,AE_FMT_S32NE,AE_FMT_FLOAT,AE_FMT_RAW
    m_streamTypes     : STREAM_TYPE_AC3,STREAM_TYPE_DTSHD_CORE,STREAM_TYPE_DTS_1024,STREAM_TYPE_DTS_512,STREAM_TYPE_DTS_2048
The difference is deviceType (PCM vs. IEC958). The first (Default) output has 'No passthrough capabilities' the second 'Digital Output (S/PDIF)' can send streamTypes: STREAM_TYPE_AC3, STREAM_TYPE_DTSHD_CORE, STREAM_TYPE_DTS_1024, STREAM_TYPE_DTS_512, STREAM_TYPE_DTS_2048.

Why Windows can't handle SPDIF passthrough? Is it due to poor Windows drivers?
 
Last edited:
I noticed that when playing music through KODI (OpenELEC) in the corresponding CM6632A register I can see the 24-bit format. But in Windows, the format exactly corresponds to what I set in the device properties.
In the KODI settings, you can only limit the sampling frequency, but not the bit depth. What is the reason for this?
 
Last edited:
I want to clarify. When playing through KODI (OpenELEC) a 16/44.1 file, in the status register I read the values corresponding to 24/44.1.When playing a Hi-Res file 24/176, the value in the status register now corresponds to the input file. It turns out that for some reason, CM6632A in Linux always runs at maximum bit depth. In the firmware, I limited the bit depth to 24 bits. Later I want to check what will happen if I limit the input mode to 32 bits in the firmware. I suspect that in this case, all files, regardless of their bit depth, will be played in 32-bit format.
 

Attachments

  • definition of Reg-00h.png
    definition of Reg-00h.png
    67.4 KB · Views: 180
Last edited:
P.M.: The kodi dump suggests kodi opens the raw hw:X device wrapped with the plug plugin - hence all the frame rates and sample formats supported by the report.

The actual sample format passed to any alsa sound device is listed in /proc/asound/cardX/pcmYp/subZ/hw_params where X is card ID, X is device ID, Y is subdevice ID (typically 0). For USB audio devices more info is listed in /proc/asound/cardX/stream0.

Also please post here a dump of lsusb -l for your USB device, it will tell many interesting facts about your device. Including why linux offers the SPDIF output and how it was "detected". More on that after that dump. Thanks.
 
Thank you phofman for the recommendations.

I tested it on my CM6632A development board with firmware that allows 32 bits to be played on two computers. Ubuntu 18.04 (pulse audio) is installed on one computer, and OpenELEC is installed on the other computer.

When playing a 16/44.1 file on a standard Totem player, I see 16/44.1, but when playing a 24/192 file, I see 24/48. As if there is a limit on the sampling frequency of 48 kHz.

When playing a 16/44.1 file on OpenELEC, I see 24/44.1, but when playing a 24/192 file, I see 24/192. In this case, as if there is a limit on the bit depth of 24 bits.

I have attached reports on your recommendations for Ubuntu and OpenELEC to the message.

There is only one word in the hw_params file. As far as I remember it word "closed".


I think in order to ensure bitperfect, it is necessary that the bit depth and sampling rate correspond exactly to the file being played.
 

Attachments

  • lsusb_OpenELEC.txt
    14.9 KB · Views: 87
  • lsusb_Ubuntu 18.04.txt
    15 KB · Views: 80
  • stream0_OpenELEC.txt
    903 bytes · Views: 98
  • stream0_Ubuntu 18.04.txt
    944 bytes · Views: 76
When playing a 16/44.1 file on a standard Totem player, I see 16/44.1, but when playing a 24/192 file, I see 24/48. As if there is a limit on the sampling frequency of 48 kHz.

That's because in ubuntu you are playing through the pulseaudio audio mixer which can flip between two frequencies only (48 and 44.1kHz being the default setting). All other frequencies are resampled to either of them.

When playing a 16/44.1 file on OpenELEC, I see 24/44.1, but when playing a 24/192 file, I see 24/192. In this case, as if there is a limit on the bit depth of 24 bits.

That distribution does not use PA and Kodi outputs directly to alsa (through the plug plugin as you showed last time but that has no effect in this case).

There is only one word in the hw_params file. As far as I remember it word "closed".

When nothing is being played, the device is closed. You would see the values during playback. But the lsusb and stream0 dumps show all we need.

The dumps are identical for ubuntu and openelec, with ubuntu having newer kernel/userspace which got improved info reports slightly.

The stream0 file is more descriptive, lsusb gives extra details.

Samplerates natively supported by the device: 44100, 48000, 88200, 96000, 176400, 192000, 352800, 384000

Channels: 2 for all combinations

Sample formats natively supported: PCM 16bit, 24bit, 32bit (bmFormats is 0x00000001) and the 64 bit SPECIAL format with bmFormats 0x80000000 meaning raw data - DSD?

Mute feature, no volume feature

Data sent every 125us which minimizes latency.

The device reports only one output terminal (of type "speaker"), it reports nothing about a dedicated output terminal of type SPDIF (which the standard defines but very few devices actually use).

Now the SPDIF. Alsa comes with config files in /usr/share/alsa. USB audio cards use file /usr/share/alsa/cards/USB-Audio.conf which configures many PCM devices (those listed by aplay -L). Section USB-Audio.pcm.iec958_device defines special PCM devices for SPDIF output - some have device 1 (those with an extra audio interface for SPDIF), some have none (those with the device 999 set by that config). If a device is not listed here (which the CM6632 is not), the general SPDIF config for device 0 is applied from general file /usr/share/alsa/pcm/iec958.conf. Please notice that all the iec958 config does is define the name (iec958 = spdif) and configure the AES preamble bits for the SPDIF transmitter. Otherwise it behaves just like a regular PCM device (which it is).

Now how did Kodi recognize the SPDIF. It simply reads the alsa PCM device name and if it finds spdif or iec958 substring, it marks the device as AE_DEVTYPE_IEC958 xbmc/AESinkALSA.cpp at a0d424ec8f1050b29c2233e57952c20f1c63c993 * xbmc/xbmc * GitHub which gets reported in that dump in xbmc/AEDeviceInfo.cpp at a80d1293b0579bbed7dd7d20304ba34a20519f78 * xbmc/xbmc * GitHub

As of the AES SPDIF preamble controls - I could not find any way to pass them to the chip through USB. Neither found any mention of that in the register documentation posted in this thread (but that was I2C access IIUC). So I do not know how these are delivered to the chip (if at all).

IMO windows cannot offer SPDIF output because the device itself reports no SPDIF output, IMO. The SPDIF output in linux is "guessed" by the alsa config - since the device is not blacklisted in /usr/share/alsa/cards/USB-Audio.conf, the iec958 PCM device is generated and subsequently recognized by KODI.

Just my 2 cents, maybe I have overlooked something.
 
@phofman thanks for your interesting arguments
SPDIF passthrough (using C-Media CM6631A card works well on my Ubuntu server 20.04. I can send multichannel compressed digital sound signal through SPDIF to external AC3 and DTS decoders. I would like the same on my laptop with Windows11;) But I can see that it will be difficult on native Windows...

So I figured I'd install Ubuntu Desktop on a separate USB 3.0 ssd drive and boot from it when I needed Spdif out from my USB CM6631 sound card.
 
Thank you phofman again.

The SPDIF output was needed by bern for passthrough output. I have disabled SPDIF IN/OUT in CM6632A firmware, as it is not required in my project. You correctly pointed out that my device has two channels supporting from 16 to 32 bits at samplerate from 44.1kHz to 384kHz, and also has a mute featere.
Communication with the microcontroller is carried out via the I2C bus, and then to the terminal (UART) and to the graphic LCD.

...and the 64 bit SPECIAL format with bmFormats 0x80000000 meaning raw data - DSD?
Yes, it should be according to the firmware, but a few pages earlier the problem was discussed that I can't output DSD stream from foobar2000 under Windows 10. I then tried to output the DSD stream on my other computer with a clean Windows 10, where no drivers for C-Media were installed, but there was the same problem - the DSD stream was not output. Either an error message came out when trying to play DSD content, or there was no indication of the presence of a DSD stream on the development board, where there was a default firmware from the SDK supporting the DSD stream.

Thus, I currently have two problems:
1. The inability to play the DSD stream in Windows 10.
2. Output of any data in OpenELEC in 24-bit format, regardless of the format of the file itself.
 
The SPDIF output was needed by bern for passthrough output. I have disabled SPDIF IN/OUT in CM6632A firmware, as it is not required in my project.

I see, so the lsusb -v dump was not for SPDIF-enabled configuration. I did not know that. Maybe lsusb for the SPDIF-enabled setup would look different and more could be inferred about the SPDIF playback not available in windows.

2. Output of any data in OpenELEC in 24-bit format, regardless of the format of the file itself.

OpenELEC = kodi alsa output. IMO you will get details of the format selection process if you enable debug in kodi xbmc/AESinkALSA.cpp at a0d424ec8f1050b29c2233e57952c20f1c63c993 * xbmc/xbmc * GitHub

Just - do you really need 16bit output, when 24bit covers 16bit losslessly?