• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

BEGINNER QUESTION : Getting "BitPerfect" output in Linux ?

danadam

Addicted to Fun and Learning
Joined
Jan 20, 2017
Messages
957
Likes
1,497
It seems this bug has caught up with me: Pulseaudio not detecting supported rates of USB DAC. Neither "avoid-resampling" nor "alternate-sample-rate" works any more :-(
Code:
I: [pulseaudio] alsa-sink.c: Sink does not support sample rate of 96000, set it to a verified value
even though alsa has no problem with switching to this sampling rate:
Code:
]$ cat /proc/asound/Pro57760455/stream0 | grep Rates
    Rates: 44100, 48000, 88200, 96000, 176400, 192000, 352800, 384000, 705600, 768000
    Rates: 44100, 48000, 88200, 96000, 176400, 192000, 352800, 384000, 705600, 768000
]$ aplay -Dhw:2,0 /tmp/pink.96k_32.wav
Playing WAVE '/tmp/pink.96k_32.wav' : Signed 32 bit Little Endian, Rate 96000 Hz, Stereo
 
OP
P

PenguinMusic

Addicted to Fun and Learning
Joined
Dec 20, 2019
Messages
622
Likes
368
It seems this bug has caught up with me: Pulseaudio not detecting supported rates of USB DAC. Neither "avoid-resampling" nor "alternate-sample-rate" works any more :-(
Code:
I: [pulseaudio] alsa-sink.c: Sink does not support sample rate of 96000, set it to a verified value
even though alsa has no problem with switching to this sampling rate:
Code:
]$ cat /proc/asound/Pro57760455/stream0 | grep Rates
    Rates: 44100, 48000, 88200, 96000, 176400, 192000, 352800, 384000, 705600, 768000
    Rates: 44100, 48000, 88200, 96000, 176400, 192000, 352800, 384000, 705600, 768000
]$ aplay -Dhw:2,0 /tmp/pink.96k_32.wav
Playing WAVE '/tmp/pink.96k_32.wav' : Signed 32 bit Little Endian, Rate 96000 Hz, Stereo
Hi,

Would maybe help if you'd give more info :
- distro used ;
- DE Used ; - music player used ;
- ALSA version...

As far as I am concerned, I use Linux Arco (Arch based...) which is rolling release and that is updated every 2 weeks.
Kernel is latest 5.16.x.
DE is Xfce.
Music player used are gmusicbrowser and Strawberry.

The computer feeds 2 USB DACs : an AUNE S6 and a Topping D30.
It also feeds the AUNE S6 withoptical TOSLINK.

I have never encountered such error...

The thing is, I sometimes get an error when the same output is claimed by 2 apps, which ALSA does not support (when PulseAudio does).

Strawberry offers a really nice feature.
If you select to use ALSA it will list all available outputs and create a sink for it and will hsow it to you.
So you can simply copy paste what strawberry says elsewhere (for me in gmusicbrowser).

Regards.
 

danadam

Addicted to Fun and Learning
Joined
Jan 20, 2017
Messages
957
Likes
1,497
Would maybe help if you'd give more info
It was more an information rather than asking for help, but why not:
  • distro: Debian Testing
  • kernel: 5.16.0-4-amd64
  • alsa: well, same as kernel, but libasound2: 1.2.6.1-2
  • pulseaudio: 15.0
  • DE (not sure why it would matter): KDE (plasma 5.24.3, frameworks 5.90.0, qt 5.15.2)
  • player: paplay (part of pulseaudio)
  • DAC: RME ADI-2 Pro
 
Joined
Jan 26, 2023
Messages
43
Likes
10
Do Deadbeef and strawberry outputs work differently ?

I've had this interrogation since I started to play files on both these players, and (feel like) noticing a difference that should not really exist. I'll separate below between "objective" and "subjective" elements :

Objective :
- Both output to a dac via alsa, on an archlinux system
- No EQ applied, no resampling, no replay gain
- Dac (DX3+Pro) correctly display the expected sample rate from both players
- Both players at full volume/no volume control

Subjective :
- Deadbeef feel slightly louder
- Deadbeef feel slightly better detailled/fine/wider

I don't have the means to measure output volume or conduct proper blindtestThe only inegality I can find is on the dipsplay of the output, as seen below : on Deadbeef, you can actually pick the SPDIF output, or the front output, etc., like you would in VLC. With Strawberry, you just pick the soundcard without this level of detail. So, does that difference would explain a different sound ?Or at least a different volume (that would appear better but only because it's actually louder?) ? SPDIF vs not SPDIF ?
 

Attachments

  • Deadbeef1.png
    Deadbeef1.png
    31.4 KB · Views: 62
  • Strawberry1.png
    Strawberry1.png
    62.9 KB · Views: 68

Sal1950

Grand Contributor
The Chicago Crusher
Forum Donor
Joined
Mar 1, 2016
Messages
14,073
Likes
16,609
Location
Central Fl
If both are feeding your DAC via the USB connection, I can see no reason for a difference.
 

MRC01

Major Contributor
Joined
Feb 5, 2019
Messages
3,424
Likes
4,030
Location
Pacific Northwest
If there is a real difference, it could be processing in different audio layers. For example, is one pushing audio directly via ALSA, where the other is using PulseAudio?
 
Joined
Jan 26, 2023
Messages
43
Likes
10
If there is a real difference, it could be processing in different audio layers. For example, is one pushing audio directly via ALSA, where the other is using PulseAudio?
Both are supposed to use directly alsa. It only goes through a Pulseaudio server if I use it as a sink for EQ (as detailed in this thread) but that's not the case in this example.

If both are feeding your DAC via the USB connection, I can see no reason for a difference.
They are both feeding the DAC via USB, but they can do so via different outputs. You don't get a choice in Strawberry, but in Deadbeef you have all of those (see screenshot below). If these different outputs exist, I can only guess that there is a difference in how the sound files are treated between one or the other, isn't it ? And ~subjectively~, feels like spdif, the circled one, is a tad better than the underlined ones. Or is it just a different way of sending strictly similar data based on whether the receiving device is able to treat Spdif and only that ?
 

Attachments

  • deadbeef2.png
    deadbeef2.png
    72.8 KB · Views: 65

MRC01

Major Contributor
Joined
Feb 5, 2019
Messages
3,424
Likes
4,030
Location
Pacific Northwest
... They are both feeding the DAC via USB, but they can do so via different outputs. You don't get a choice in Strawberry, but in Deadbeef you have all of those (see screenshot below). If these different outputs exist, I can only guess that there is a difference in how the sound files are treated between one or the other, isn't it ? And ~subjectively~, feels like spdif, the circled one, is a tad better than the underlined ones. Or is it just a different way of sending strictly similar data based on whether the receiving device is able to treat Spdif and only that ?
If you have a digital recorder, you can test this. Connect the computer's USB output to the digital recorder and play both music files that sound slightly different, one after the other, in separate files. Then compare the files.
 

MRC01

Major Contributor
Joined
Feb 5, 2019
Messages
3,424
Likes
4,030
Location
Pacific Northwest
PS: since it's a Linux system you don't need a recorder. You can capture the stream using build-in sound commands, like this. It uses Pulseaudio, but maybe you can come up with another that uses only ALSA:
---
# Create a Pulseaudio stream that "tees" the main audio stream, so we can capture it
audev="alsa_output.pci-0000_04_02.0.iec958-stereo"
filnam="MyCaptureFile"
strnam="MyCaptureStream"
pactl load-module module-combine-sink sink_name="$strnam" slaves="$audev" sink_properties=device.description="$strnam"
# Start capturing the stream
parec -v -d "$strnam".monitor --fix-format --fix-rate --fix-channels "$filnam"
---
The variable "audev" is specific to my computer. You'll have to use your own sound card device.
You can open such a raw audio file in Audacity, analyze it, export as WAV, FLAC, etc.
 
Joined
Jan 26, 2023
Messages
43
Likes
10
Sorry it took me a while to get something working. I did not manage to figure out how to use and adapt the sound commands you wrote, so I used a recorder (via usd->dac->jack->mic ext/in), then compared the files in audacity. On the two files/extracts from those files I compared, it found a difference going between -0,01 to -0.07 RMS dB from strawberry to deadbeef (although if this result sound weird, it's probably because I did something wrong somewhere in the measuring or comparison considering how little I felt like I was mastering this process :oops:)
 

MRC01

Major Contributor
Joined
Feb 5, 2019
Messages
3,424
Likes
4,030
Location
Pacific Northwest
A difference of 0.07 dB is in the "barely audible" range of perception, yet is too subtle to be perceived as a difference in level, but as "better", "richer", "fuller", etc.
In other words, "I can tell they are slightly different but the difference is too subtle to pin down."
If your recording method used "mic", that is analog so it was D/A converted. This could have introduced the subtle difference you mentioned. For a true comparison you need to record the bits.
 

Sal1950

Grand Contributor
The Chicago Crusher
Forum Donor
Joined
Mar 1, 2016
Messages
14,073
Likes
16,609
Location
Central Fl
A difference of 0.07 dB is in the "barely audible" range of perception, yet is too subtle to be perceived as a difference in level, but as "better", "richer", "fuller", etc.
Do you believe you could reliably identify one from the other under blind conditions?
 

MRC01

Major Contributor
Joined
Feb 5, 2019
Messages
3,424
Likes
4,030
Location
Pacific Northwest
Do you believe you could reliably identify one from the other under blind conditions?
With the right musical signal, maybe. White/pink noise is a good signal to use for level sensitivity testing. I've DBTed down to about 0.1 dB. So a difference of 0.07 dB is at least close to audibility. Of course with music the sensitivity may be lower, depending on what it is.
 

Sal1950

Grand Contributor
The Chicago Crusher
Forum Donor
Joined
Mar 1, 2016
Messages
14,073
Likes
16,609
Location
Central Fl
The problem with Cantata and gmusicbrowser is that they are not supported anymore :-(
But those are still the ones I prefer...

For Cantata, you have to edit a file.
That file can be found (on my system) as an invisible file in the "home" folder.
To see the invisible files, hit "Ctrl - H".

You should have a "local" folder that appears.
Open it.

Inside that folder, you should have a folder called "share".
Open it.

Inside that folder you should have a folder called "cantata".
Open it.

Inside that folder, you should have a folder called "mpd".
Open it.

Inside that folder, you should see a file called "mpd.conf".
Open it.

In your text editor, just make sure that you have something like this :

audio_output {
type "alsa"
name "ALSA sound card"
# Optional
device "hw:2,0"
mixer_control "PCM"
}

The only thing that you may have to change is the "device "hw:2,0".

To know what you should enter there, you will have to open a terminal.
In the terminal, type "aplay -l".
This will give a list of audio output.
Look at the output you would like to use.
For that device you should see a line like this (this is in french, but I assume you can translate easily :) )
"carte 0: PCH [HDA Intel PCH], périphérique 1: ALC1150 Digital [ALC1150 Digital]".
Note the # of "card" and the # of peripheral (in this case that would be "0,1").

Just enter that combination as a string after the "hw:X,X".

Save the file.

Start Cantata.

Done...

This looks like it is long...
It litterally takes 3 minutes top !

Regards.
@PenguinMusic
I'd appreciate a bit of help if you can.
Lately things have changed both it my distro's handling of devices and Strawberry's detection.
I struggled till finding the needed change in Strawberry was to set the Alsa Plugin to "PCM", it then detects
the device as this,

"hdmi:CARD=NVidia,DEV=1"

and feeds the bitstream to my AVP correctly again.
This is my current output of "aplay -l"

"**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC1220 Analog [ALC1220 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC1220 Digital [ALC1220 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [EB321HQU]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 1 [DENON-AVR]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 10: HDMI 4 [HDMI 4]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 11: HDMI 5 [HDMI 5]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 12: HDMI 6 [HDMI 6]
Subdevices: 1/1
Subdevice #0: subdevice #0
[sal@localhost ~]$ "

I've yet to determine a working configuration for Cantata's file.
Any ideas or help would be greatly appreciated.
TIA, Sal
 
Top Bottom