USB to Toslink adapter for Linux

rubato

Member
Joined
Nov 27, 2024
Messages
48
Location
USA
I just purchased this Cubilux USB to Toslink adapter, connecting to a WiiM Pro Plus. Unfortunately, I haven't been able to get it to work with my Linux system: it shows up in Sound Preferences and I can select it there, but no sound comes out when I try to play something. I've verified that it does work with my Mac Mini, so the adapter and the rest of the path to the speakers all seem to be working.

Looking further, I'm wondering if I should have tried its slightly less capable cousin, which Amazon does list as working with Linux. Does anyone have experience using these or any other adapters with Linux?
 
What is the format of the media you are attempting to play ?
What variety of Linux are you running ?
If you ssh to your Linux box and use the command
aplay -L
what output do you get ?
 
For testing I've been using random mp3 files that I have lying around, plus some YouTube videos through Firefox. There's also a Test Speakers pane in Sound Preferences that plays "left speaker" and "right speaker". I don't know what the format for that is, but when I try it just hangs for ten seconds or so. The hoped-for use is streaming music through the web from services not supported in the WHA. I can do that now from my iPad with AirPlay, but I'm looking for alternative methods.

The Linux is PCLinuxOS, using PipeWire. Possibly not the most capable distro when it comes to sound support.

aplay -L shows
Code:
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
default
    Default ALSA Output (currently PipeWire Media Server)
sysdefault:CARD=PCH
    HDA Intel PCH, ALC897 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC897 Analog
    Front output / input
surround21:CARD=PCH,DEV=0
    HDA Intel PCH, ALC897 Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, ALC897 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, ALC897 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, ALC897 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, ALC897 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, ALC897 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
hdmi:CARD=PCH,DEV=0
    HDA Intel PCH, HDMI 0
    HDMI Audio Output
hdmi:CARD=PCH,DEV=1
    HDA Intel PCH, HDMI 1
    HDMI Audio Output
hdmi:CARD=PCH,DEV=2
    HDA Intel PCH, HDMI 2
    HDMI Audio Output
hdmi:CARD=PCH,DEV=3
    HDA Intel PCH, HDMI 3
    HDMI Audio Output
sysdefault:CARD=Adapter
    USB SPDIF Adapter, USB Audio
    Default Audio Device
front:CARD=Adapter,DEV=0
    USB SPDIF Adapter, USB Audio
    Front output / input
surround21:CARD=Adapter,DEV=0
    USB SPDIF Adapter, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Adapter,DEV=0
    USB SPDIF Adapter, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Adapter,DEV=0
    USB SPDIF Adapter, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Adapter,DEV=0
    USB SPDIF Adapter, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Adapter,DEV=0
    USB SPDIF Adapter, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Adapter,DEV=0
    USB SPDIF Adapter, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Adapter,DEV=0
    USB SPDIF Adapter, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
iec958:CARD=Adapter,DEV=1
    USB SPDIF Adapter, USB Audio #1
    IEC958 (S/PDIF) Digital Audio Output
 
I would strip things out (Pipewire) and simplify.
Just try configuring PCLinuxOS to output audio to USB and see if you get anything
 
It's showing up as your default audio device in alsa:
sysdefault:CARD=Adapter
USB SPDIF Adapter, USB Audio
Default Audio Device


First, use alsamixer to make sure the volume is up.

Next, run speaker-test, and you should hear white noise, assuming your WiiM's optical input is selected. If no sound, make sure there's red light coming out the end of your optical cable.
 
When I run alsamixer and choose the builtin sound card, I see

alsamixer1.png

but when I select the USB adapter I see

alsamixer2.png

Is that normal?
 
Muted. Can you adjust it using the Up arrow on your keyboard?
 
Up and down arrows both have no effect. I can use the right arrow to move to the MM box, which shows as

Extension Unit [Off]
 
As with everything Linux, there are plenty of ways to do things. Try searching for "ALSA mute" for some possible answers.

 
I tried booting Linux Mint from a USB stick and the adapter works there. Mint 22.1 also uses PipeWire, so the problem is apparently specific to PCLinuxOS. For what it's worth, I'm not sure the problem is output volume. When I select the built-in audio output I can run aplay and and get ten seconds of music

Code:
[jlj@beelink Music]$ time aplay -d 10 -v fancy-free.wav
Playing WAVE 'fancy-free.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
ALSA <-> PipeWire PCM I/O Plugin
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 2
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 16
  buffer_size  : 22050
  period_size  : 5512
  period_time  : 125000
  tstamp_mode  : ENABLE
  tstamp_type  : GETTIMEOFDAY
  period_step  : 1
  avail_min    : 5512
  period_event : 0
  start_threshold  : 22050
  stop_threshold   : 22050
  silence_threshold: 0
  silence_size : 0
  boundary     : 6206523236469964800

real    0m10.235s
user    0m0.046s
sys    0m0.047s

When I switch the output to the adapter the same command blocks until I hit ^C

Code:
[jlj@beelink Music]$ time aplay -d 10 -v fancy-free.wav
Playing WAVE 'fancy-free.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
ALSA <-> PipeWire PCM I/O Plugin
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 2
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 16
  buffer_size  : 22050
  period_size  : 5512
  period_time  : 125000
  tstamp_mode  : ENABLE
  tstamp_type  : GETTIMEOFDAY
  period_step  : 1
  avail_min    : 5512
  period_event : 0
  start_threshold  : 22050
  stop_threshold   : 22050
  silence_threshold: 0
  silence_size : 0
  boundary     : 6206523236469964800
^CAborted by signal Interrupt...

real    0m54.460s
user    0m0.003s
sys    0m0.022s
[jlj@beelink Music]$

Is a puzzlement.
 
Back
Top