Welcome, Guest
Username: Password: Remember me

NOTE: This is a "Community" forum. Please be mindful that community members are here to help as part of a community effort. We therefore appreciate your effort in keeping this forum a happy place!

If you have a specific issue (e.g. hardware, failure) and want help from our support team, please use our tech support portal (Support menu - > Contact Us).
Thanks a lot of your help in making a better community.

TOPIC: S/PDIF / IEC958 non-audio & copyright bit

S/PDIF / IEC958 non-audio & copyright bit 4 years 10 months ago #22505

  • tofu
  • tofu's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 5
  • Karma: 2
Does the USBStreamer set the non-audio and/or copyright bits on the S/PDIF frame headers on its TOSLINK output?

Here is my problem: I am trying to send an encoded Dolby Digital 5.1 stream to the wireless transmitter of a pair of surround sound headphones. The headphones work 100% OK when plugged into an XBOX One, but when plugged into a PC for DVD playback, they output only garbage noise when the DD 5.1 stream is played. They play PCM 2.0 audio without issue (even from the PC).

I think the reason for this, is that the wireless transmitter base station expects the non-audio and/or copyright bits to be set on the S/PDIF frame headers when playing a DD 5.1 stream.

On some soundcards, mostly PCI as far as I know, it is possible to control these bits via a mixer interface. But not on any USB ones that I've read about.

Would it at all be possible to have an TOSLINK firmware custom-compiled that set the non-audio bit (and maybe copyright bit, I'm not sure if it's needed..)? The bits could just be hard-coded to "1". Or better, a mixer control could be added to configure these, like the ones that exist to select the clock source.

Thanks for considering this.
-Matt
The administrator has disabled public write access.

S/PDIF / IEC958 non-audio & copyright bit 4 years 10 months ago #22507

  • tofu
  • tofu's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 5
  • Karma: 2
Before I bought the USBStreamer, I bought a $10 CM6206 based soundcard on eBay with the hopes of recording S/PDIF. It didn't work for that, but...

Looking at the CM6206 datasheet, I see that it is a register set via USB HID that controls if the non-audio bit is set or not in the S/PDIF output. Seeing as the chip's registers are already written to in the kernel's sound/usb/quirks.c file, I simply flipped the bit there, and voila. The headphones now work in surround mode (though, the interface is permanently in non-audio mode).

So, I think this is fixed and I don't need any more assistance with the matter.

But, the main reason I bought the USBStreamer is for recording ADAT. So it's still going to be very useful for me, regardless.
The administrator has disabled public write access.

S/PDIF / IEC958 non-audio & copyright bit 3 years 2 months ago #33067

  • nonaudio
  • nonaudio's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
Hello Matt,
Your experience is interesting. I am trying to do the same witn ubuntu precise pangolin. I choosed this distribution because all my efforts in terms of spdif communication between a usb box using cm6206-LX and a debian stretch where useless.
With pangolin, I manage communication and commutation with various digital and analog inputs and outputs.
Unfortunately and predictably, all digital signals are muted when copybit arises.
Could you give me more information about your patch of quirks.c. I believe that you are talking about linux/sound/usb/quirks.c , aren't you?
I opened the file to see where is the register data injection and weren't be able to make the relation between hex values and those discribed in the CM6206 datasheet. So, if you can guide me a bit, I would try to configure my box to treat my scms digital signal as non-audio stream.
I could try various configurations (various patches) and give you back the results of my atempts.
Thanks a lot for your help, if possible.

Thierry.
Last Edit: 3 years 2 months ago by nonaudio.
The administrator has disabled public write access.

S/PDIF / IEC958 non-audio & copyright bit 3 years 2 months ago #33068

  • tofu
  • tofu's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 5
  • Karma: 2
hi,
here is what i changed. it is a bit old but i imagine it wouldn't be too difficult to apply to a newer kernel:
--- linux-4.2.3/sound/usb/quirks.c	2015-08-30 14:34:09.000000000 -0400
+++ linux-4.3/sound/usb/quirks.c	2015-12-05 23:43:41.167975339 -0500
@@ -662,7 +662,7 @@
 static int snd_usb_cm6206_boot_quirk(struct usb_device *dev)
 {
 	int err  = 0, reg;
-	int val[] = {0x2004, 0x3000, 0xf800, 0x143f, 0x0000, 0x3000};
+	int val[] = {0x2006, 0x3000, 0xf800, 0x143f, 0x0000, 0x3000};
 
 	for (reg = 0; reg < ARRAY_SIZE(val); reg++) {
 		err = snd_usb_cm106_write_int_reg(dev, reg, val[reg]);

-tofu
The administrator has disabled public write access.

S/PDIF / IEC958 non-audio & copyright bit 3 years 2 months ago #33069

  • nonaudio
  • nonaudio's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
Hi,
Thanks a lot for your flash answer. I will test it "as is" as soon as possible and give you my results after compiling.
You are nice, really.

Thierry.
The administrator has disabled public write access.

S/PDIF / IEC958 non-audio & copyright bit 3 years 2 months ago #33070

  • tofu
  • tofu's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 5
  • Karma: 2
that patch should just make everything *output* from the cm6206 have the non-audio bit set (even uncompressed pcm output). if you're having difficulties recording something via the *input* that has the copyright bit set, it might be hard-coded into the chip/firmware kinda like hdmi's hdcp protection :(
-tofu
The administrator has disabled public write access.

S/PDIF / IEC958 non-audio & copyright bit 3 years 2 months ago #33071

  • nonaudio
  • nonaudio's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
Thanks again.

You're right. It probably works like that, referring to the datasheet. Anyway, if I begin to better understand the bit encoding, I could try other things. Have you already tested the spdif input of your card with copy prohibit input stream?

Have a good day.
The administrator has disabled public write access.

S/PDIF / IEC958 non-audio & copyright bit 3 years 2 months ago #33072

  • tofu
  • tofu's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 5
  • Karma: 2
if i remember correctly, i didn't have any success recording via the cm6206 spdif input.
-tofu
The administrator has disabled public write access.

S/PDIF / IEC958 non-audio & copyright bit 3 years 2 months ago #33073

  • nonaudio
  • nonaudio's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
With a DAT source and no copy prohibited streams, it was easy on windows XP, manageable on Precise Pangolin.
Totally failing on debian stretch with both included kernels 4 available : only analog inputs were working with my 32bit configuration.

Encouraged by the results with pangolin, I would check if any bit combination could unmute the copy prohibited stream.

Anyway, if there is no software solution, I will try a hardware box. On december 1997, Elektor was proposing a good and cheap module for altering spdif subcode. I am not sure to find the EEPROM coding twenty years after, though.

Thanks again. I will give you back any info I'll find about this.
The administrator has disabled public write access.

S/PDIF / IEC958 non-audio & copyright bit 3 years 2 months ago #33074

  • nonaudio
  • nonaudio's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
Hello.
I am back after compiling of 3.13.0.117 with , as only custom change, 2004 -->2006.
As expected, absolutly no change regarding of spdif in mute behaviour. There is some work to do, perhaps searching a way to get blind spdif loopback with "non-audio" subcode at the output...
By the way, I just discover that gnome pulseaudio is unable to manage corectly the usb cm6206 when Unity pulseaudio works perfectly with same kernel.
To be continued...

Thanks for your posts.

Best regards.

Thierry.
The administrator has disabled public write access.
Moderators: devteam