No more sound with spdif and ioboard

For topics which do not fit in other specific forums.
Atohmdiy
Posts: 143
Joined: Thu Jul 02, 2020 12:20 am
Has thanked: 5 times
Been thanked: 17 times

No more sound with spdif and ioboard

Unread post by Atohmdiy »

Hello,
I am using the spdif output from the ioboard, then through a toslink transmitter.

Everything was working fine until the new core updates. Several machine have no sound anymore (Mega CD, NEO GEO, NES, SNES). The others still have sounds, so the problem is not related to me, i also try an old NEO GEO core and it worked.

Thank you
User avatar
Threepwood
Posts: 133
Joined: Mon May 25, 2020 9:14 am
Has thanked: 4 times
Been thanked: 23 times

Re: No more sound with spdif and ioboard

Unread post by Threepwood »

I use an optical toslink cable to get digital sound into my recording interface from the MiSTer via a 5.5 I/O board's mini-toslink out. Still have sound on these cores. Maybe something has not updated properly, like the MiSTer binary?
Atohmdiy
Posts: 143
Joined: Thu Jul 02, 2020 12:20 am
Has thanked: 5 times
Been thanked: 17 times

Re: No more sound with spdif and ioboard

Unread post by Atohmdiy »

I haven't update for a month or a month and half, yesterday i updates all the cores and main. Since then, the cores i mentioned didn't have any sound with spdif, the others are working fine. I will try to update them manually and see.
Atohmdiy
Posts: 143
Joined: Thu Jul 02, 2020 12:20 am
Has thanked: 5 times
Been thanked: 17 times

Re: No more sound with spdif and ioboard

Unread post by Atohmdiy »

Just made some test and it confirms what i was thinking. The problem comes from the last updates of the cores, spdif doesn't work anymore for some cores. I tried different cores version :
NES_20201102.rbf i have sound, with NES_20210114.rbf i haven't.
Same for SNES, SNES_20210121.rbf no sound, with SNES_20201106.rbf i have sound.
For megacd it's the MegaCD_20200620, after that no sound. Neo GEO it's NeoGeo_20200928.rbf to have sound.

I hope there will be a fix for this, the sound system i use is completely spdif. I use ioboard 6.1.
bellwood420
Core Developer
Posts: 48
Joined: Fri Dec 11, 2020 2:39 pm
Has thanked: 3 times
Been thanked: 32 times

Re: No more sound with spdif and ioboard

Unread post by bellwood420 »

There was a framework update related to spdif output between the versions @Atohmdiy mentioned.
It may be affecting.

viewtopic.php?f=28&t=1803
Atohmdiy
Posts: 143
Joined: Thu Jul 02, 2020 12:20 am
Has thanked: 5 times
Been thanked: 17 times

Re: No more sound with spdif and ioboard

Unread post by Atohmdiy »

Not sure any dev will look to this problem here, maybe i should open an issue in github ?
bellwood420
Core Developer
Posts: 48
Joined: Fri Dec 11, 2020 2:39 pm
Has thanked: 3 times
Been thanked: 32 times

Re: No more sound with spdif and ioboard

Unread post by bellwood420 »

Atohmdiy wrote: Sun Feb 07, 2021 6:54 pm Not sure any dev will look to this problem here, maybe i should open an issue in github ?
@Atohmdiy

I think I could help you but I don't have IO board and spdif environment for testing.
Moreover it seems to be a compatibility issue specific to receiver device.
So I need your help.

The change I mentioned above can be divided into 3 parts.
I made 3 builds(NES_A, NES_B, NES_C) which revert each part.
Would you mind trying these builds to identify what is causing the issue?
Attachments
NES.zip
(3.92 MiB) Downloaded 242 times
Atohmdiy
Posts: 143
Joined: Thu Jul 02, 2020 12:20 am
Has thanked: 5 times
Been thanked: 17 times

Re: No more sound with spdif and ioboard

Unread post by Atohmdiy »

Thank you for the help. I have sound only with NES_A core.
bellwood420
Core Developer
Posts: 48
Joined: Fri Dec 11, 2020 2:39 pm
Has thanked: 3 times
Been thanked: 32 times

Re: No more sound with spdif and ioboard

Unread post by bellwood420 »

Atohmdiy wrote: Mon Feb 08, 2021 5:52 pm Thank you for the help. I have sound only with NES_A core.
@Atohmdiy

Thank you for the feedback.
Then how about this build (NES_D)?

P.S.
Could you let me know what toslink receiver device are you using?
Attachments
NES_D.zip
(1.31 MiB) Downloaded 217 times
Atohmdiy
Posts: 143
Joined: Thu Jul 02, 2020 12:20 am
Has thanked: 5 times
Been thanked: 17 times

Re: No more sound with spdif and ioboard

Unread post by Atohmdiy »

Hello,
Just try it and yes i have sound with NES_D.
S0urceror
Posts: 23
Joined: Sat Nov 21, 2020 4:11 pm
Has thanked: 1 time
Been thanked: 8 times

Re: No more sound with spdif and ioboard

Unread post by S0urceror »

Hi Atohmdiy,

As the author of the Spdif fix I want to help. Can you describe which setup you have? Where does your Toslink go to?

The fix that I proposed was to correctly set the sample rate and the copy bit in the Spdif stream. Maybe you have hardware that is sensitive to this. Maybe I can for example remove the sample rate fix but leave the copy bit and see if that makes a difference.

Really would like a solution that works for all..
bellwood420
Core Developer
Posts: 48
Joined: Fri Dec 11, 2020 2:39 pm
Has thanked: 3 times
Been thanked: 32 times

Re: No more sound with spdif and ioboard

Unread post by bellwood420 »

S0urceror wrote: Tue Feb 09, 2021 8:44 pm Maybe I can for example remove the sample rate fix but leave the copy bit and see if that makes a difference.
@S0urceror

I did this examination on the posts above with Atohmdiy's help :)
Here is the result.

Code: Select all

NES_A.rbf: bit 2  (Copy bit) removed  -> Have sound
NES_B.rbf: bit 15 (LX bit)   removed  -> No sound
NES_C.rbf: bit 25 (48kHz)    removed  -> No sound
NED_D.rbf: bit 2 and 15 to be conditional like below(default false) -> Have sound

-----------------------------------------------------------------------------------------------
if (subframe_count_q[8:1] == 8'd2 && scms_disable == 1'b1)
    channel_status_bit = 1'b1;
else if (subframe_count_q[8:1] == 8'd15 && scms_disable == 1'b1)
    channel_status_bit = 1'b1;
This is the fact although I feel it is strange behavior(Is there a device not allowing to play music without copyright?)

I think the best way to benefit all is to make bit 2(and 15) optional.
There is room for discussion about where to put the option and its default value. MiSTer.ini?
S0urceror
Posts: 23
Joined: Sat Nov 21, 2020 4:11 pm
Has thanked: 1 time
Been thanked: 8 times

Re: No more sound with spdif and ioboard

Unread post by S0urceror »

bellwood420 wrote: Wed Feb 10, 2021 1:08 am This is the fact although I feel it is strange behavior(Is there a device not allowing to play music without copyright?)
That is strange indeed. Did we also try just with the copy-bit? And leave the L-bit and sample-rate bit zero?

In other posts on this forum I also saw other users being surprised that Toslink started to work for them suddenly after the latest PR. So I think it is best to make this optional in the .ini.
bellwood420
Core Developer
Posts: 48
Joined: Fri Dec 11, 2020 2:39 pm
Has thanked: 3 times
Been thanked: 32 times

Re: No more sound with spdif and ioboard

Unread post by bellwood420 »

S0urceror wrote: Wed Feb 10, 2021 6:44 am Did we also try just with the copy-bit? And leave the L-bit and sample-rate bit zero?
That case is not tested, but I think it is not meaningful to set bit 25 to zero since it is conflicting with actual sampling rate as you know.
At least for Atohmdiy's environment, sampling rate didn't appear to be causing the issue, IMHO.
Atohmdiy
Posts: 143
Joined: Thu Jul 02, 2020 12:20 am
Has thanked: 5 times
Been thanked: 17 times

Re: No more sound with spdif and ioboard

Unread post by Atohmdiy »

Hello,
My sound system is custom with this dac that feature two spdif, one toslink and one rca ;
https://www.audiophonics.fr/fr/dac-diy/ ... 12557.html

I don't know if the dac handle the spdif by itself or if they use an IC.
S0urceror
Posts: 23
Joined: Sat Nov 21, 2020 4:11 pm
Has thanked: 1 time
Been thanked: 8 times

Re: No more sound with spdif and ioboard

Unread post by S0urceror »

Atohmdiy wrote: Wed Feb 10, 2021 5:34 pm I don't know if the dac handle the spdif by itself or if they use an IC.
I think the left top IC is doing the I2S and Toslink conversion. The photo of the product page does not show the type number clearly. Can you check the product code on the IC?
bellwood420
Core Developer
Posts: 48
Joined: Fri Dec 11, 2020 2:39 pm
Has thanked: 3 times
Been thanked: 32 times

Re: No more sound with spdif and ioboard

Unread post by bellwood420 »

DAC IC (ESS ES9038Q2M) seems to be receiving toslink directly by itself not via receiver like AK4113, DIR9001, WM8804, CS8416 etc...

Someone on the web is posting a reverse engineered schematics of similar board (not exactly the same one but using the same IC and looks similar in appearance)

Schematics:
https://2.bp.blogspot.com/-RG-DtX_1b20/ ... /image.png
Photo:
https://1.bp.blogspot.com/-kSGtdshumLA/ ... 171116.jpg

Datasheet also shows that it can receive spdif signal directly.
http://file2.dzsc.com/product/18/05/25/ ... 233543.pdf

I wish we could peek its SPDIF CHANNEL STATUS register to see what is happening...
S0urceror
Posts: 23
Joined: Sat Nov 21, 2020 4:11 pm
Has thanked: 1 time
Been thanked: 8 times

Re: No more sound with spdif and ioboard

Unread post by S0urceror »

Yes. It looks like to ES9038 reads all the bits in the Spdif stream and shows it in one of its registers. So it should support the enabled bits as part of my fix. I wish I had one of these boards to check it for myself. I’ll continue to search for a solution.
bellwood420
Core Developer
Posts: 48
Joined: Fri Dec 11, 2020 2:39 pm
Has thanked: 3 times
Been thanked: 32 times

Re: No more sound with spdif and ioboard

Unread post by bellwood420 »

@S0urceror

I don't have IO board but I noticed that I can capture spdif bitstream from GPIO pin using logic analyzer :)
Please check attached capture.

C bit is being asserted on Frame #1 (Right ch) and Frame #2 (Left ch).
It should be asserted on Frame #2 (Left ch and Right ch).

I haven't looked deeply into the spdif logic, but the the generated signal is not what you intended.
It may be confusing ES9038Q2M, on the other hand, most other devices may be interpreting it in a good way.

------
EDIT:

I took a look at the logic.

Preamble and audio sample are finally captured to FFs at load_subframe_q being asserted, so outputs delay one subframe to subframe_count_q value.
However channel_status_bit is not captured like them, directly used, has no delay to subframe_count_q value.
I think the issue will be fixed when channel_status_bit is captured as well as preamble and audio sample.
Attachments
capture.png
capture.png (129.49 KiB) Viewed 9170 times
Atohmdiy
Posts: 143
Joined: Thu Jul 02, 2020 12:20 am
Has thanked: 5 times
Been thanked: 17 times

Re: No more sound with spdif and ioboard

Unread post by Atohmdiy »

This board is well known of the diyaudio community, there is a very long subject that speak of it in diyaudio.com :

https://www.diyaudio.com/forums/digital ... board.html

Maybe someone there could be of some help if you informations.
bellwood420
Core Developer
Posts: 48
Joined: Fri Dec 11, 2020 2:39 pm
Has thanked: 3 times
Been thanked: 32 times

Re: No more sound with spdif and ioboard

Unread post by bellwood420 »

Not to get this issue being buried, I got MiSTer IO board and ES9038Q2M DAC board.

I confirmed no sound with the latest spdif output to ES9038Q2M.
And the fix I mentioned above worked.

Opened PR...
https://github.com/MiSTer-devel/Template_MiSTer/pull/26
Atohmdiy
Posts: 143
Joined: Thu Jul 02, 2020 12:20 am
Has thanked: 5 times
Been thanked: 17 times

Re: No more sound with spdif and ioboard

Unread post by Atohmdiy »

That's great, thank you. ;)
S0urceror
Posts: 23
Joined: Sat Nov 21, 2020 4:11 pm
Has thanked: 1 time
Been thanked: 8 times

Re: No more sound with spdif and ioboard

Unread post by S0urceror »

@bellwood420, I confirm it also works on my SPDIF capture card which was the reason for my initial fix. Looks like we're now entirely within the standard.
Post Reply