Unable to Capture Streaming Audio Using S/PDIF In

I have a Cambridge Audio Sonata NP30 Internet radio connected by Toslink to the S/PDIF In of a Creative Sound Blaster X-Fi USB DAC. Using Audacity 2.1.3 (installed from Fedora Repository) in Fedora 25 (XFCE) I want to capture music from the NP30, but Audacity doesn’t record it. Tried various settings in Audacity and Pulse Audio Volume Control. Have also tried without .asoundrc and with several .asoundrc configurations.
Currently, I have disabled .asoundrc. AlsaMixer lists the Sound Blaster as a PCM Capture Source [Mic] but has nothing about S/PDIF. FWIW, Audacity does play sound files on the computer through headphones connected to the Sound Blaster.
Any help in solving this would be much appreciated.
Audio Device Info:

==============================
Default recording device number: 13
Default playback device number: 13
==============================
Device ID: 0
Device name: HDA Intel HDMI: 0 (hw:0,3)
Host name: ALSA
Recording channels: 0
Playback channels: 8
Low Recording Latency: -1.000000
Low Playback Latency: 0.005805
High Recording Latency: -1.000000
High Playback Latency: 0.034830
Supported Rates:
    32000
    44100
    48000
    88200
    96000
    176400
    192000
==============================
Device ID: 1
Device name: HDA Intel HDMI: 1 (hw:0,7)
Host name: ALSA
Recording channels: 0
Playback channels: 8
Low Recording Latency: -1.000000
Low Playback Latency: 0.005805
High Recording Latency: -1.000000
High Playback Latency: 0.034830
Supported Rates:
    32000
    44100
    48000
    88200
    96000
    176400
    192000
==============================
Device ID: 2
Device name: HDA Intel HDMI: 2 (hw:0,8)
Host name: ALSA
Recording channels: 0
Playback channels: 8
Low Recording Latency: -1.000000
Low Playback Latency: 0.005805
High Recording Latency: -1.000000
High Playback Latency: 0.034830
Supported Rates:
    32000
    44100
    48000
    88200
    96000
    176400
    192000
==============================
Device ID: 3
Device name: HDA Intel HDMI: 3 (hw:0,9)
Host name: ALSA
Recording channels: 0
Playback channels: 8
Low Recording Latency: -1.000000
Low Playback Latency: 0.005805
High Recording Latency: -1.000000
High Playback Latency: 0.034830
Supported Rates:
    32000
    44100
    48000
    88200
    96000
    176400
    192000
==============================
Device ID: 4
Device name: HDA Intel HDMI: 4 (hw:0,10)
Host name: ALSA
Recording channels: 0
Playback channels: 8
Low Recording Latency: -1.000000
Low Playback Latency: 0.005805
High Recording Latency: -1.000000
High Playback Latency: 0.034830
Supported Rates:
    32000
    44100
    48000
    88200
    96000
    176400
    192000
==============================
Device ID: 5
Device name: HDA NVidia: HDMI 0 (hw:1,3)
Host name: ALSA
Recording channels: 0
Playback channels: 8
Low Recording Latency: -1.000000
Low Playback Latency: 0.005805
High Recording Latency: -1.000000
High Playback Latency: 0.034830
Supported Rates:
    32000
    44100
    48000
    88200
    96000
    176400
    192000
==============================
Device ID: 6
Device name: HDA NVidia: HDMI 1 (hw:1,7)
Host name: ALSA
Recording channels: 0
Playback channels: 8
Low Recording Latency: -1.000000
Low Playback Latency: 0.005805
High Recording Latency: -1.000000
High Playback Latency: 0.034830
Supported Rates:
    32000
    44100
    48000
    88200
    96000
    176400
    192000
==============================
Device ID: 7
Device name: USB Sound Blaster HD: Audio (hw:2,0)
Host name: ALSA
Recording channels: 2
Playback channels: 2
Low Recording Latency: 0.007979
Low Playback Latency: 0.007979
High Recording Latency: 0.032000
High Playback Latency: 0.032000
Supported Rates:
    48000
    96000
==============================
Device ID: 8
Device name: USB Sound Blaster HD: Audio #1 (hw:2,1)
Host name: ALSA
Recording channels: 2
Playback channels: 2
Low Recording Latency: 0.008685
Low Playback Latency: 0.008685
High Recording Latency: 0.034830
High Playback Latency: 0.034830
Supported Rates:
    44100
    48000
    96000
==============================
Device ID: 9
Device name: USB Sound Blaster HD: Audio #2 (hw:2,2)
Host name: ALSA
Recording channels: 0
Playback channels: 2
Low Recording Latency: -1.000000
Low Playback Latency: 0.008685
High Recording Latency: -1.000000
High Playback Latency: 0.034830
Supported Rates:
    44100
    48000
==============================
Device ID: 10
Device name: SAA7134: PCM (hw:3,0)
Host name: ALSA
Recording channels: 2
Playback channels: 0
Low Recording Latency: 0.012000
Low Playback Latency: -1.000000
High Recording Latency: 0.048000
High Playback Latency: -1.000000
Supported Rates:
==============================
Device ID: 11
Device name: hdmi
Host name: ALSA
Recording channels: 0
Playback channels: 8
Low Recording Latency: -1.000000
Low Playback Latency: 0.005805
High Recording Latency: -1.000000
High Playback Latency: 0.034830
Supported Rates:
    32000
    44100
    48000
    88200
    96000
    176400
    192000
==============================
Device ID: 12
Device name: pulse
Host name: ALSA
Recording channels: 32
Playback channels: 32
Low Recording Latency: 0.008707
Low Playback Latency: 0.008707
High Recording Latency: 0.034830
High Playback Latency: 0.034830
Supported Rates:
    8000
    9600
    11025
    12000
    15000
    16000
    22050
    24000
    32000
    44100
    48000
    88200
    96000
    176400
    192000
==============================
Device ID: 13
Device name: default
Host name: ALSA
Recording channels: 32
Playback channels: 32
Low Recording Latency: 0.008707
Low Playback Latency: 0.008707
High Recording Latency: 0.034830
High Playback Latency: 0.034830
Supported Rates:
    8000
    9600
    11025
    12000
    15000
    16000
    22050
    24000
    32000
    44100
    48000
    88200
    96000
    176400
    192000
==============================
Selected recording device: 7 - USB Sound Blaster HD: Audio (hw:2,0)
Selected playback device: 7 - USB Sound Blaster HD: Audio (hw:2,0)
Supported Rates:
    48000
    96000
==============================
Available mixers:
==============================
Available recording sources:
==============================
Available playback volumes:
==============================
Recording volume is emulated
Playback volume is emulated

To record internet radio, why not just record the stream directly, for example with VLC?
(Google suggests: https://www.vlchelp.com/record-online-radio-streams-mp3/)

I used to do what you suggested, but what I want to do has advantages.

  1. Audio Quality
    From everything I’ve read, the sound (and recording) quality is likely to be superior when using external devices due to elimination of interference from computer components and probably better quality of external DACs.
  2. Convenience
    Even if the above isn’t true or I’m unable to perceive any difference, using the external radio has several advantages:
    · With presets, I simply press a button on the remote control to change stations.
    · To capture, I just click the Record button in Audacity.
    · Very convenient to be able to edit immediately in Audacity.
    · Overall, I find Audacity preferable to VLC for recording/editing. Even if I played the stations on the computer, I would use Audacity for those purposes.

In the case of capturing a digital audio stream, that is not correct. The internet radio station is digital data, a stream of 1’s and 0’s. If you write those 1’s and 0’s to disk then it makes no difference how you do it. Using VLC to write the stream to disk avoids DA/AD conversion, so as long as you write in a lossless format (such as WAV), then you will be getting an exact copy of the data that comes through your internet connection.


Your “Audio device info” includes:

Device ID: 10
Device name: SAA7134: PCM (hw:3,0)

What is that? It’s a digital stream input of some sort, but what is the physical device?

Thanks for the information. What I wrote, then, doesn’t apply to capturing digital streams, but presumably does to playing them.
Doesn’t the digital connection from the NP30 radio to the Sound Blaster DAC also bypass DA/AD conversion, providing the same exact copy as using VLC?
SAA7134 seems to relate to TV/video:
“Philips SAA7134Philips SAA7134: A PCI interface chipset from NXP/ Philips that provides video decoder functionality.
It is supported under Linux by the saa7134 and associated kernel driver modules.” https://linuxtv.org/wiki/index.php/Philips_SAA7134

What you wrote can apply to some degree to capturing analog audio. The signal path between the analog input and the digital output of the A/D converter is vulnerable to electromagnetic interference, particularly microphone inputs (due to the high gain required). The inside of a computer is a hostile environment for analog audio, so good quality internal sound cards need to be very carefully designed and the vulnerable parts of the circuitry need to be well shielded. That rarely happens with cheap sound cards, which has lead to internal sound cards getting a poor reputation in some circles, somewhat unfairly as there are some excellent quality internal sound cards available, though they tend to not be cheap.

Playback tends to be less of a problem because the output audio level is relatively high, so less prone to interference, though care should still be taken to keep the analog output away from noisy electrical components (such as video cards and fans).

It ‘may’ do. It depends what happens inside the NP30 radio.

Yes, but physically what is it? Do you have a video capture card installed?

That’s informative.
As far as I can see, there are 2 video cards but neither is a capture device.

$ lspci -vnn | grep VGA -A 12
00:02.0 VGA compatible controller [0300]: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller [8086:0412] (rev 06) (prog-if 00 [VGA controller])
	Subsystem: Gigabyte Technology Co., Ltd Device [1458:d000]
	Flags: bus master, fast devsel, latency 0, IRQ 31
	Memory at f7400000 (64-bit, non-prefetchable) [size=4M]
	Memory at d0000000 (64-bit, prefetchable) [size=256M]
	I/O ports at f000 [size=64]
	Capabilities: <access denied>
	Kernel driver in use: i915
	Kernel modules: i915

00:03.0 Audio device [0403]: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller [8086:0c0c] (rev 06)
	Subsystem: Intel Corporation Device [8086:2010]
	Flags: bus master, fast devsel, latency 0, IRQ 33
--
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GF119 [GeForce GT 610] [10de:104a] (rev a1) (prog-if 00 [VGA controller])
	Subsystem: Gigabyte Technology Co., Ltd Device [1458:362a]
	Flags: bus master, fast devsel, latency 0, IRQ 30
	Memory at f6000000 (32-bit, non-prefetchable) [size=16M]
	Memory at e0000000 (64-bit, prefetchable) [size=128M]
	Memory at e8000000 (64-bit, prefetchable) [size=32M]
	I/O ports at e000 [size=128]
	Expansion ROM at 000c0000 [disabled] [size=128K]
	Capabilities: <access denied>
	Kernel driver in use: nouveau
	Kernel modules: nouveau

01:00.1 Audio device [0403]: NVIDIA Corporation GF119 HDMI Audio Controller [10de:0e08] (rev a1)

$ arecord -L
default
    Playback/recording through the PulseAudio sound server
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
sysdefault:CARD=HD
    USB Sound Blaster HD, USB Audio
    Default Audio Device
front:CARD=HD,DEV=0
    USB Sound Blaster HD, USB Audio
    Front speakers
surround21:CARD=HD,DEV=0
    USB Sound Blaster HD, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=HD,DEV=0
    USB Sound Blaster HD, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=HD,DEV=0
    USB Sound Blaster HD, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=HD,DEV=0
    USB Sound Blaster HD, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=HD,DEV=0
    USB Sound Blaster HD, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=HD,DEV=0
    USB Sound Blaster HD, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=HD,DEV=0
    USB Sound Blaster HD, USB Audio #1
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=HD,DEV=0
    USB Sound Blaster HD, USB Audio
    Direct sample mixing device
dmix:CARD=HD,DEV=1
    USB Sound Blaster HD, USB Audio #1
    Direct sample mixing device
dsnoop:CARD=HD,DEV=0
    USB Sound Blaster HD, USB Audio
    Direct sample snooping device
dsnoop:CARD=HD,DEV=1
    USB Sound Blaster HD, USB Audio #1
    Direct sample snooping device
hw:CARD=HD,DEV=0
    USB Sound Blaster HD, USB Audio
    Direct hardware device without any conversions
hw:CARD=HD,DEV=1
    USB Sound Blaster HD, USB Audio #1
    Direct hardware device without any conversions
plughw:CARD=HD,DEV= 0
    USB Sound Blaster HD, USB Audio
    Hardware device with all software conversions
plughw:CARD=HD,DEV=1
    USB Sound Blaster HD, USB Audio #1
    Hardware device with all software conversions
sysdefault:CARD=SAA7134
    SAA7134, SAA7134 PCM
    Default Audio Device
dmix:CARD=SAA7134,DEV=0
    SAA7134, SAA7134 PCM
    Direct sample mixing device
dsnoop:CARD=SAA7134,DEV=0
    SAA7134, SAA7134 PCM
    Direct sample snooping device
hw:CARD=SAA7134,DEV=0
    SAA7134, SAA7134 PCM
    Direct hardware device without any conversions
plughw:CARD=SAA7134,DEV=0
    SAA7134, SAA7134 PCM
    Hardware device with all software conversions

After countless hours of struggle in the Linux audio jungle with much trial and error, many dead-ends, and a disappointing lack of relevant help on this forum, I finally stumbled upon the steps to a solution. Guided by information found at https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture, http://alsa.opensrc.org/MultipleCards and http://alsa.opensrc.org/Usb-audio, I configured HD as the default sound card in /usr/share/alsa/alsa.conf, in /etc/modprobe.d/ created alsa-base.conf and configured the card order and created and configured modprobe.conf. Problem solved – until the next time Linux audio inevitably strikes with another of its myriad problems.

Thanks for the update. Good to know that it was an audio system configuration problem rather than an Audacity issue. Thanks also for posting the links which may be useful for anyone else having similar problems.