You are not logged in.

#1 2019-01-06 19:41:47

kamelie1706
Member
Registered: 2014-02-19
Posts: 176

[SOLVED] Fiio X3 (1st Gen) - How to get the best output?

Hi,
I am testing with
mocp -R ALSA

I understand the logic as below ....

For application using PulseAudio
APP->PulseAudio->ALSA->Soundcard
In pulseaudio mixer I see 3 cards
- Audio internal (motherboard, analogic outputs)
- Audio HDMI (motherboard, hdmi output)
- Fiio USB Audio with 2 options
=> Analogic
=> Numerical (the one I picked)
Fiio volume can be adjusted (but not visible on the device => I conclude the pulseaudio server is actively mixing ....) even if it says:
mocp: ALSA playback 

For application using ALSA
APP->ALSA->PulseAudio->ALSA->Soundcard
This part is a bit confusing to me but that is how I understand it works as I have installed the alsa-pulseaudio plugin.
In alsa mixer 4 sound card
- PulseAudio (default, only master audio can be controlled) 
- Audio internal (motherboard, analogic outputs)
- Audio HDMI (motherboard, hdmi output)
- Fiio USB Audio
Fiio volume cannot be controlled (so no mixing here .... but there might be still some re-sampling)
Managing Pulseaudio master has no influence on Fiio output => Only on the Audio Internal/HDMI => I am confused, Why? Did I mis-understood the chain done via the alsa-pulseaudio?

I tried also with smplayer selecting ALSA ... same behaviour. I could notice that there that I have 2 output for the fiio
- pulse - fiio out
- alsa - fiio out
it shows indeed differently in pulsemixer but behavior is exactly the same ...

More information from mplayer

==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 96000 Hz, 2 ch, s32le, 0.0 kbit/0.00% (ratio: 0->768000)
Selected audio codec: [ffflac] afm: ffmpeg (FFmpeg FLAC audio)
==========================================================================
[AO OSS] audio_setup: Can't open audio device /dev/dsp: No such file or directory
AO: [alsa] 96000Hz 2ch s32le (4 bytes per sample)

Seems going straight to alsa but why then I can manage volume from pulsemixer?
..... Answering to myself with another test with a 6 channel file

==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 58.35.100 (external)
Mismatching header version 58.18.100
AUDIO: 96000 Hz, 6 ch, s32le, 0.0 kbit/0.00% (ratio: 0->2304000)
Selected audio codec: [ffflac] afm: ffmpeg (FFmpeg FLAC audio)
==========================================================================
[AO OSS] audio_setup: Can't open audio device /dev/dsp: No such file or directory
AO: [alsa] 96000Hz 2ch floatle (4 bytes per sample)

There is at least remixing ....

Can I keep pulseaudio for my motherboard sound (analogic and HDMI) but use directly ALSA for my Fiio DAC? Is it somehow already the case?

Thx for the any information that could help me to understand better ... or did I missed something in the Wiki?

In addition some good inputs here
https://forums.linuxmint.com/viewtopic.php?t=253225
Great script to check alsa options

1) Analog alsa audio output interface `hw:0,0'
 - device name       = SB                                                          
 - interface name    = ALC892 Analog                                               
 - usb audio class   = (n/a)                                                       
 - character device  = /dev/snd/pcmC0D0p                                           
 - encoding formats  = S16_LE, S32_LE                                              
 - monitor file      = /proc/asound/card0/pcm0p/sub0/hw_params                     
 - stream file       = (n/a)                                                       

 2) Analog alsa audio output interface `hw:0,1'
 - device name       = SB                                                          
 - interface name    = ALC892 Digital                                              
 - usb audio class   = (n/a)                                                       
 - character device  = /dev/snd/pcmC0D1p                                           
 - encoding formats  = S16_LE, S32_LE                                              
 - monitor file      = /proc/asound/card0/pcm1p/sub0/hw_params                     
 - stream file       = (n/a)                                                       

 3) Analog alsa audio output interface `hw:1,3'
 - device name       = HDMI                                                        
 - interface name    = HDMI 0                                                      
 - usb audio class   = (n/a)                                                       
 - character device  = /dev/snd/pcmC1D3p                                           
 - encoding formats  = S16_LE, S32_LE                                              
 - monitor file      = /proc/asound/card1/pcm3p/sub0/hw_params                     
 - stream file       = (n/a)                                                       

 4) Analog alsa audio output interface `hw:1,7'
 - device name       = HDMI                                                        
 - interface name    = HDMI 1                                                      
 - usb audio class   = (n/a)                                                       
 - character device  = /dev/snd/pcmC1D7p                                           
 - encoding formats  = S16_LE, S32_LE                                              
 - monitor file      = /proc/asound/card1/pcm7p/sub0/hw_params                     
 - stream file       = (n/a)                                                       

 5) USB Audio Class Digital alsa audio output interface `hw:2,0'
 - device name       = DAC                                                         
 - interface name    = USB Audio                                                   
 - usb audio class   = 2 - isochronous asynchronous                                
 - character device  = /dev/snd/pcmC2D0p                                           
 - encoding formats  = S32_LE                                                      
 - monitor file      = /proc/asound/card2/pcm0p/sub0/hw_params                     
 - stream file       = /proc/asound/card2/stream0

Another great discussion related
https://www.reddit.com/r/linuxmasterrac … tings_for/

pacmd list-sinks

3 sink(s) available.
    index: 1
        name: <alsa_output.pci-0000_00_14.2.analog-stereo.equalizer>
        driver: <module-equalizer-sink.c>
        flags: HW_MUTE_CTRL LATENCY DYNAMIC_LATENCY
        state: SUSPENDED
        suspend cause: IDLE
        priority: 1000
        volume: front-left: 44649 /  68%,   front-right: 44649 /  68%
                balance 0,00
        base volume: 65536 / 100%
        volume steps: 65537
        muted: no
        current latency: 0,00 ms
        max request: 0 KiB
        max rewind: 0 KiB
        monitor source: 1
        sample spec: float32le 2ch 44100Hz
        channel map: front-left,front-right
                     Stéréo
        used by: 0
        linked by: 0
        configured latency: 0,00 ms; range is 16,00 .. 1999,82 ms
        module: 29
        properties:
                device.master_device = "alsa_output.pci-0000_00_14.2.analog-stereo"
                device.class = "filter"
                device.description = "FFT based equalizer on Audio interne Surround analogique 2.1"
                device.icon_name = "audio-card"
  * index: 4
        name: <alsa_output.usb-SmartAction_FiiO_USB_Audio_Class_2.0_DAC_0007-00.iec958-stereo>
        driver: <module-alsa-card.c>
        flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
        state: SUSPENDED
        suspend cause: IDLE
        priority: 9048
        volume: front-left: 49807 /  76% / -7,15 dB,   front-right: 49807 /  76% / -7,15 dB
                balance 0,00
        base volume: 65536 / 100% / 0,00 dB
        volume steps: 65537
        muted: no
        current latency: 0,00 ms
        max request: 0 KiB
        max rewind: 0 KiB
        monitor source: 4
        sample spec: s32le 2ch 48000Hz
        channel map: front-left,front-right
                     Stéréo
        used by: 0
        linked by: 0
        configured latency: 0,00 ms; range is 0,50 .. 1837,50 ms
        card: 2 <alsa_card.usb-SmartAction_FiiO_USB_Audio_Class_2.0_DAC_0007-00>
        module: 30
        properties:
                alsa.resolution_bits = "32"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "USB Audio"
                alsa.id = "USB Audio"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.card = "2"
                alsa.card_name = "FiiO USB Audio Class 2.0 DAC"
                alsa.long_card_name = "SmartAction FiiO USB Audio Class 2.0 DAC at usb-0000:00:13.2-1, high speed"
                alsa.driver_name = "snd_usb_audio"
                device.bus_path = "pci-0000:00:13.2-usb-0:1:1.0"
                sysfs.path = "/devices/pci0000:00/0000:00:13.2/usb4/4-1/4-1:1.0/sound/card2"
                udev.id = "usb-SmartAction_FiiO_USB_Audio_Class_2.0_DAC_0007-00"
                device.bus = "usb"
                device.vendor.id = "2972"
                device.vendor.name = "SmartAction"
                device.product.id = "0001"
                device.product.name = "FiiO USB Audio Class 2.0 DAC"
                device.serial = "SmartAction_FiiO_USB_Audio_Class_2.0_DAC_0007"
                device.string = "iec958:2"
                device.buffering.buffer_size = "705600"
                device.buffering.fragment_size = "352800"
                device.access_mode = "mmap+timer"
                device.profile.name = "iec958-stereo"
                device.profile.description = "Stéréo numérique (IEC958)"
                device.description = "FiiO USB Audio Class 2.0 DAC Stéréo numérique (IEC958)"
                alsa.mixer_name = "USB Mixer"
                alsa.components = "USB2972:0001"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-usb"
        ports:
                iec958-stereo-output: Sortie numérique (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
                        properties:

        active port: <iec958-stereo-output>
    index: 5
        name: <alsa_output.pci-0000_00_14.2.analog-surround-21>
        driver: <module-alsa-card.c>
        flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
        state: SUSPENDED
        suspend cause: IDLE
        priority: 9039
        volume: front-left: 44649 /  68% / -10,00 dB,   front-right: 44649 /  68% / -10,00 dB,   lfe: 44649 /  68% / -10,00 dB
                balance 0,00
        base volume: 65536 / 100% / 0,00 dB
        volume steps: 65537
        muted: no
        current latency: 0,00 ms
        max request: 0 KiB
        max rewind: 0 KiB
        monitor source: 5
        sample spec: s16le 3ch 44100Hz
        channel map: front-left,front-right,lfe
        used by: 0
        linked by: 1
        configured latency: 0,00 ms; range is 16,00 .. 1999,82 ms
        card: 1 <alsa_card.pci-0000_00_14.2>
        module: 7
        properties:
                alsa.resolution_bits = "16"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "ALC892 Analog"
                alsa.id = "ALC892 Analog"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.card = "0"
                alsa.card_name = "HDA ATI SB"
                alsa.long_card_name = "HDA ATI SB at 0xfe7f8000 irq 16"
                alsa.driver_name = "snd_hda_intel"
                device.bus_path = "pci-0000:00:14.2"
                sysfs.path = "/devices/pci0000:00/0000:00:14.2/sound/card0"
                device.bus = "pci"
                device.vendor.id = "1002"
                device.vendor.name = "Advanced Micro Devices, Inc. [AMD/ATI]"
                device.product.id = "4383"
                device.product.name = "SBx00 Azalia (Intel HDA) (M5A88-V EVO)"
                device.form_factor = "internal"
                device.string = "surround21:0"
                device.buffering.buffer_size = "529152"
                device.buffering.fragment_size = "264576"
                device.access_mode = "mmap+timer"
                device.profile.name = "analog-surround-21"
                device.profile.description = "Surround analogique 2.1"
                device.description = "Audio interne Surround analogique 2.1"
                alsa.mixer_name = "Realtek ALC892"
                alsa.components = "HDA:10ec0892,1043841b,00100302"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-pci"
        ports:
                analog-output-lineout: Sortie ligne (priority 9900, latency offset 0 usec, available: yes)
                        properties:

        active port: <analog-output-lineout>

Last but not least
https://askubuntu.com/questions/294512/ … pulseaudio

I case someone is looking for similar answers ....

Last edited by kamelie1706 (2019-01-07 18:09:31)

Offline

#2 2019-01-06 23:46:20

kamelie1706
Member
Registered: 2014-02-19
Posts: 176

Re: [SOLVED] Fiio X3 (1st Gen) - How to get the best output?

Interesting ...
I have not touched my daemon file yet

; daemonize = no
; fail = yes
; allow-module-loading = yes
; allow-exit = yes
; use-pid-file = yes
; system-instance = no
; local-server-type = user
; enable-shm = yes
; enable-memfd = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB
; lock-memory = no
; cpu-limit = no

; high-priority = yes
; nice-level = -11

; realtime-scheduling = yes
; realtime-priority = 5

; exit-idle-time = 20
; scache-idle-time = 20

; dl-search-path = (depends on architecture)

; load-default-script-file = yes
; default-script-file = /etc/pulse/default.pa

; log-target = auto
; log-level = notice
; log-meta = no
; log-time = no
; log-backtrace = 0

; resample-method = speex-float-1
; avoid-resampling = false
; enable-remixing = yes
; remixing-use-all-sink-channels = yes
; enable-lfe-remixing = no
; lfe-crossover-freq = 0

flat-volumes = no
; flat-volumes = yes

; rlimit-fsize = -1
; rlimit-data = -1
; rlimit-stack = -1
; rlimit-core = -1
; rlimit-as = -1
; rlimit-rss = -1
; rlimit-nproc = -1
; rlimit-nofile = 256
; rlimit-memlock = -1
; rlimit-locks = -1
; rlimit-sigpending = -1
; rlimit-msgqueue = -1
; rlimit-nice = 31
; rlimit-rtprio = 9
; rlimit-rttime = 200000

; default-sample-format = s16le
; default-sample-rate = 44100
; alternate-sample-rate = 48000
; default-sample-channels = 2
; default-channel-map = front-left,front-right

; default-fragments = 4
; default-fragment-size-msec = 25

; enable-deferred-volume = yes
; deferred-volume-safety-margin-usec = 8000
; deferred-volume-extra-delay-usec = 0

Some extra testing with a flac 192kHz/24 bits file:

If I use mocp or mplayer and select from pulsemixer:
Fiio USB Audio Class 2.0 DAC Stereo (IEC958)  S/PDIF Digital audio
I can see on the fiio that I get 48kHz/24bits
I tried to launch mocp with -R ALSA option but did not help.

But .... using VLC and selecting the same output (Fiio USB Audio Class 2.0 DAC Stereo IEC958 S/PDIF Digital audio) in vlc audio options I got the the 192kHz/24 bits of the file ....

It seems VLC is the only one able to by-pass pulse audio! In this scenario if I try to modify volume of my fiio using the pulsemixer ... no effect meaning it confirms vlc took control directly using ALSA and ALSA did not go back to Pulseaudio (via the plugin) .... no clue how!

No conflict as I have my motherboard as default for the rest ...

Strange I cannot do the same with mplayer nor mocp!

Last edited by kamelie1706 (2019-01-06 23:54:27)

Offline

#3 2019-01-07 18:08:24

kamelie1706
Member
Registered: 2014-02-19
Posts: 176

Re: [SOLVED] Fiio X3 (1st Gen) - How to get the best output?

Lets start again following the wiki

aplay -L

sysdefault:CARD=DAC
    FiiO USB Audio Class 2.0 DAC, USB Audio
    Default Audio Device
front:CARD=DAC,DEV=0
    FiiO USB Audio Class 2.0 DAC, USB Audio
    Front speakers
surround21:CARD=DAC,DEV=0
    FiiO USB Audio Class 2.0 DAC, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=DAC,DEV=0
    FiiO USB Audio Class 2.0 DAC, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=DAC,DEV=0
    FiiO USB Audio Class 2.0 DAC, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=DAC,DEV=0
    FiiO USB Audio Class 2.0 DAC, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=DAC,DEV=0
    FiiO USB Audio Class 2.0 DAC, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=DAC,DEV=0
    FiiO USB Audio Class 2.0 DAC, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=DAC,DEV=0
    FiiO USB Audio Class 2.0 DAC, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
usbstream:CARD=DAC
    FiiO USB Audio Class 2.0 DAC
    USB Stream Output

aplay -l

carte 2: DAC [FiiO USB Audio Class 2.0 DAC], périphérique 0: USB Audio [USB Audio]
  Sous-périphériques: 1/1
  Sous-périphérique #0: subdevice #0

Test with 24/192 wav file.

aplay -D hw:DAC sr004-01-24192.wav
=> failed because sample format not compatible (expecting S32_LE)

aplay -D plughw:DAC sr004-01-24192.wav
=> works great, the fiio display the correct information
=> pulseaudio has no influence, I can even disable the card there, still playing.
I need to read more about this plughw option ....

For the reference I tested also with mplayer ...
mplayer -ao alsa:device=plughw=DAC sr004-01-24192.wav

For moc
mocp -O AlsaDevice="plughw:DAC" sr004-01-24192.wav
=> works even if I get warning message
ALSA lib control.c:1375:(snd_ctl_open_noupdate) Invalid CTL plughw:DAC
Indeed from alsamixer it says the device has no control ... does it really matter?

Last edited by kamelie1706 (2019-01-07 18:23:24)

Offline

#4 2019-01-09 10:38:45

kamelie1706
Member
Registered: 2014-02-19
Posts: 176

Re: [SOLVED] Fiio X3 (1st Gen) - How to get the best output?

More reading on the subject
http://lacocina.nl/audiophile-mpd

Many great scripts there ... have to test if they work for arch

And a good one to check usage of DSD with mdp .... my fiio x3 seems not supporting it by USB (works from internal memory) :-(
https://thepenguin.eu/2017-12-22-mpd-and-dsd-files/

Last edited by kamelie1706 (2019-01-10 18:20:40)

Offline

Board footer

Powered by FluxBB