Console player and S/PDIF (Toslink)

Greetings, colleagues!

Tell me, please, how can I solve my problem.

I use a computer without X.Org. On it, I run the CMus console player and listen to music.
The built-in sound card has both analog outputs and a digital optical output (Toslink).
At the analog output, music is present, but there is no optical output.

For testing, I run Linux Mint on this machine and the optical output worked fine. Therefore, it normally works.

Mother board in my computer - Asus E45M1-I DELUXE (Sound chip - Realtek® ALC892).
OS - FreeBSD 12.
The player is configured to the default sound output system - as to the OSS.
In addition, I ran another player - a flac123. The situation is similar.

How can you use the console programs to play music in digital output?

Ogogon.
 
Does it appear in /dev/sndstat?
Code:
root@ot:~ # cat /dev/sndstat
Installed devices:
pcm0: <ATI R6xx (HDMI)> (play)
pcm1: <Realtek ALC892 (Rear Analog)> (play/rec) default
pcm2: <Realtek ALC892 (Front Analog)> (play/rec)
pcm3: <Realtek ALC892 (Rear Digital)> (play)
pcm4: <Realtek ALC892 (Onboard Digital)> (play)
No devices installed from userspace.
root@ot:~ #

There are as many as two digital outputs.
I believe that mine is pcm3. What is pcm4 - I do not know. Probably, in addition to the rear, on the motherboard there is also a digital audio connector.
 
There are as many as two digital outputs.
I believe that mine is pcm3. What is pcm4 - I do not know. Probably, in addition to the rear, on the motherboard there is also a digital audio connector.
You have already tried setting them as default device via sysctl hw.snd.default_unit=3 (3 as in pcm3) and it didn't work?
 
Code:
root@ot:~ # cat /dev/sndstat
Installed devices:
pcm0: <ATI R6xx (HDMI)> (play)
pcm1: <Realtek ALC892 (Rear Analog)> (play/rec) default
pcm2: <Realtek ALC892 (Front Analog)> (play/rec)
pcm3: <Realtek ALC892 (Rear Digital)> (play)
pcm4: <Realtek ALC892 (Onboard Digital)> (play)
No devices installed from userspace.
root@ot:~ #

There are as many as two digital outputs.
I believe that mine is pcm3. What is pcm4 - I do not know. Probably, in addition to the rear, on the motherboard there is also a digital audio connector.

Did you check the volume?

Check out mixer(8) and sound(4). You should be able to fix it with that...
 
As far I am concerned the toslink output should be always set at 100% and then controlled by what is working as pre-amplifier in the audio chain (everything to reproduce audio from toslink should have one). The reason is the toslink output is "line-level".

Just in the case someone concerned with audio quality.

The volume control should always (as possible) be made in the analog domain.

While in the analog domain the volume control is made by + or - the signal voltage, and so the signal (means audio) will be kept intact (if the pre-amplifer was properly projected and built), in the digital domain the volume is controlled (starting from 100%) actually "removing information": less bits, less resolution, and usually more noise.

"Expensive" digital volume controls, aka dsp controlled ones (or dithered digital attenuation), upscale the audio first to a higher bit-depth (usually 24 or 32 bits) to lower later. Very cleaver, very clean, still degrade it and sound hygienic.
 
You have already tried setting them as default device via sysctl hw.snd.default_unit=3 (3 as in pcm3) and it didn't work?
Many thanks.
After I said this spell, everything worked as I wanted ...

After the launch of the CMus, the transmitting LED on the Toslink port began to glow and now in my speakers sing the incomparable Tarja Turunen.

Ogogon.
 
By the way, is it possible to look at what mode the player has set up the sound port?
The clock frequency, the depth of sound in bits ...

Ogogon.
 
By the way, is it possible to look at what mode the player has set up the sound port?
The clock frequency, the depth of sound in bits ...

Ogogon.

It rather depends on how did you set sound(4).

By default it probably is being re-mixed to 48Khz/16Bits wherever the source (audio file). The usual default everywhere.

Assuming you are using a proper external DAC, you could set it to play bitperfect with the downside of playing nothing if the source was encoded by a unsupported (by the DAC) frequency/bit depth.

EDIT:

Code:
dev.pcm.%d.bitperfect
        Enable or disable bitperfect mode.     When enabled, channels    will
        skip all dsp processing, such as channel matrixing, rate convert-
        ing and equalizing.  The pure sound stream    will be    fed directly
        to    the hardware.  If VCHANs are enabled, the bitperfect mode will
        use the VCHAN format/rate as the definitive format/rate target.
        The recommended way to use    bitperfect mode    is to disable VCHANs
        and enable    this sysctl.  Default is disabled.
 
It rather depends on how did you set sound(4).

By default it probably is being re-mixed to 48Khz/16Bits wherever the source (audio file). The usual default everywhere.

Assuming you are using a proper external DAC, you could set it to play bitperfect with the downside of playing nothing if the source was encoded by a unsupported (by the DAC) frequency/bit depth.

EDIT:

Code:
dev.pcm.%d.bitperfect
        Enable or disable bitperfect mode.     When enabled, channels    will
        skip all dsp processing, such as channel matrixing, rate convert-
        ing and equalizing.  The pure sound stream    will be    fed directly
        to    the hardware.  If VCHANs are enabled, the bitperfect mode will
        use the VCHAN format/rate as the definitive format/rate target.
        The recommended way to use    bitperfect mode    is to disable VCHANs
        and enable    this sysctl.  Default is disabled.
Thank you!
Sound revived, small details appeared, it ceased to be deaf and transistor!

Now in /etc/sysctl.conf it is written:
Code:
hw.snd.default_unit=3
dev.pcm.3.play.vchans=0
dev.pcm.3.bitperfect=1
Did I understand correctly? Or have I missed something?

Ogogon.
 
By the way, is it possible to look at what mode the player has set up the sound port?
Yes, you can increase verbosity with sysctl hw.snd.verbose=2 and then /dev/sndstat will contain some information about it. But it isn't exactly the nicest thing to read... Not sure if we have a tool that makes it more human readable.
 
Yes, you can increase verbosity with sysctl hw.snd.verbose=2 and then /dev/sndstat will contain some information about it. But it isn't exactly the nicest thing to read... Not sure if we have a tool that makes it more human readable.
Thank you, he began to tell much more. And where you can see the values of the numbers it leads?

And another question. How to allow maximum digital output modes?

I tried to play a sound file with a sound depth of 24 bits. The driver did not want to let him into Toslink.

root@ot:/tmp # flac123 1.flac
flac123 version 0.0.12 'flac123 --help' for more info
ao_oss ERROR: Unsupported number of bits: 24.Error opening ao device 0
Error opening 1.flac
root@ot:/tmp #


However, the hardware of the audio adapter (Realtek® ALC892)) allows this.
http://www.realtek.com.tw/products/productsView.aspx?Langid=1&PFid=28&Level=5&Conn=4&ProdID=284 ("Primary 16/20/24-bit SPDIF-OUT supports 32k/ 44.1k/48k/88.2k/96k/192kHz sample rate")

Does the driver need to allow such modes?
 
Quick reply: I do not know.

EDIT: As far I know you can set it as bitperfect or fixed only.

I guess you are using this ALC892 device just as Toslink output. If so, assuming the bitperfect setup, it is working more like as pass through only.

In this case, what is on the other side of the Toslink connection, because that is the actual DAC?

EDIT_2: is the source you were trying to play 24/192 or 24/176? Many Toslink transmitters are not that reliable to transmit at those frequencies in 24 bits.
 
I guess you are using this ALC892 device just as Toslink output. If so, assuming the bitperfect setup, it is working more like as pass through only.
You are absolutely right. In this configuration, the computer is used as digital audio transport. It opens the container FLAC, carries out minimal conversion and sends everything to the input of the DAC.

In this case, what is on the other side of the Toslink connection, because that is the actual DAC?
To the output of the computer is connected a inexpensive DAC with a tube output. Xiangsheng DAC-01A.
As a S/PDIF Coax/Toslink receiver, he has Cirrus Logic® CS8416.

EDIT_2: is the source you were trying to play 24/192 or 24/176? Many Toslink transmitters are not that reliable to transmit at those frequencies in 24 bits.
I believe that you need to speak not about the Toslink transmitter. This primitive module, which receives a signal with a TTL level and flashes the transmitting LED.
It is more correct to talk about the S/PDIF driver.
In my case, this is Realtek® ALC892. The documentation says that "Primary 16/20/24-bit SPDIF-OUT supports a sampling frequency of 32k/44.1k/48k/88.2k/96k/192kHz"
Frankly, I have not heard about the frequency of 176k before.

Ogogon.
 
Frankly, I have not heard about the frequency of 176k before.

Yeah, they are rather uncommon but you still see them around: Example. :)

EDIT: The use of 176Khz was reasonable common in the past, like 88Khz too. Probably matching with the advance of the digital recording gear.

I believe that you need to speak not about the Toslink transmitter. This primitive module, which receives a signal with a TTL level and flashes the transmitting LED.

I was actually talking about the transmitter. Some of them do not work properly on those higher frequencies. While they do support they also fail some times. Why? I do not know. :)
 
Just in case you are interested, the 6N3 valve your DAC use is usually replaceable with 5670/2C51 (TungSol are the best) what most people think sounds better, and are inexpensive. The other and better alternative is WE396a but that one is pricey, and probably hard to find these days.
 
Just in case you are interested, the 6N3 valve your DAC use is usually replaceable with 5670/2C51 (TungSol are the best) what most people think sounds better, and are inexpensive. The other and better alternative is WE396a but that one is pricey, and probably hard to find these days.
Thank you. In my DAC installed a Soviet 6N3P-E (rus. 6Н3П-Е) produced by "Svetlana" (Leningrad/St. Petersburg). Usually, such an elite firm as "Svetlana" was not distracted by a trifle of 6N3P type, but it was an order from whether the military, or the space agency, and they tried very hard. Tube with the prefix "-E", which should mean increased accuracy of manufacture and durability.
 
Nice.

I never heard a 6N3P but you made me remember of 6N6P what is an amazing valve (they are not interchangeable). Probably one of the best sounding Soviet valves ever.

Well, there is ECC40 what is another very special Soviet valve but with the downside of using a B8A base, what is very hard to find these days.

And yeah, Mil. Specs are always special versions and should last "forever". Western valves usually name the military ones with different names like 10Y became VT-25, etc.

A funny thing about Soviet valves they tends to be more "bassy" than the westerns ones. The GM70 in particular have a very unique "jumbo" sound.

You could talk with THOSE guys if you need more valves, I think they run they business from Turkey and St. Petersburg; however I never did anything with them and so I can't say a thing about they reliability.

EDIT: very expensive but should one of the best DACs in the market: LampizatOr.
 
Nice.
I never heard a 6N3P but you made me remember of 6N6P what is an amazing valve (they are not interchangeable). Probably one of the best sounding Soviet valves ever.
But I - on the contrary. 6N6P even in the hands did not hold, but with 6N3P and 6N2P there was a lot.

Well, there is ECC40 what is another very special Soviet valve but with the downside of using a B8A base, what is very hard to find these days.
I believe that you are mistaken. ECC40 is in my opinion "Philips" and does not have a Soviet analog.

A funny thing about Soviet valves they tends to be more "bassy" than the westerns ones. The GM70 in particular have a very unique "jumbo" sound.
Lamps of GM series (rus. ГМ-xxx) and GU (rus. ГУ-xxx) were used in amplifying technique, speaking in Russian "not from a good life".
These are powerful generator high-frequency tubes, large, not economical, with a very inconvenient voltage and current of heat.
Simply, there were no others. The Soviet industry did very well what the military needs, but poorly and reluctantly to do what is necessary for normal people.

You could talk with THOSE guys if you need more valves, I think they run they business from Turkey and St. Petersburg; however I never did anything with them and so I can't say a thing about they reliability.
Thank you. But now in Russia domestic tubes can be bought much cheaper than these guys sell. At one time they were made in incredible quantities, but the tube boom, alas, ended. Now private individuals with personal hoards can sell almost everything.

EDIT: very expensive but should one of the best DACs in the market: LampizatOr.
Yes, thank you, I know this project.

Ogogon.
 
Back
Top