Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux? |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-11-2017, 06:40 PM
|
#1
|
LQ Newbie
Registered: Aug 2012
Posts: 9
Rep: 
|
ALSA: SB Omni Surround 5.1 - IEC958 is routed to the analog output, not the digital output.
Hi, I am trying to use the IEC958 output of a 'Soundblaster Omni Surround 5.1' USB soundcard to connect to my digital receiver.
When using Debian GNU/Linux (stretch) the analog outputs work just fine with ALSA/PulseAudio.
But when I try to use the IEC958 output the audio still gets routed to the analog output, not to the digital output!
I have already figured out what the problem is but am unable to fix it.
When listing the audio PCMs with 'aplay -L' it lists the IEC985 output as:
Code:
iec958:CARD=S51,DEV=0
SB Omni Surround 5.1, USB Audio
IEC958 (S/PDIF) Digital Audio Output
This is incorrect, DEV=0 routes the audio to the analog output of the soundcard.
The correct parameter should be DEV=1 for normal audio playback and DEV=2 for AC3 passthrough.
Of course I can manually specify the correct alsa device when using media-players (mpv, vlc) but this is very messy and does not always work, especially in combination with PulseAudio...
I have been looking for a way to change this erroneous default configuration by using a custom .asoundrc (or even by modifying the settings in /usr/share/alsa/alsa.conf) but so far this has only resulted in more problems.
Please help.
The machine dual boots with Windows 8.1 and I have confirmed that both 'DolbyDigital Live' and AC3 passthrough are working with Windows.
Code:
Soundcard:
manufacturer: Creative Technology
name: Soundblaster Omni Surround 5.1
type: USB 2.0
model: SB1560 ( Rev. C )
firmware: 1.0.160916
Machine: Alienware 17
BIOS version: A14
OS: Debian GNU/Linux stretch (upgraded to testing)
Kernel: Linux 4.11.0-1-amd64
ALSA: 1.1.3-1
PulseAudio: 10.0-2
Code:
alex@Alienware:~$ lsusb | grep Creative
Bus 003 Device 006: ID 041e:322c Creative Technology, Ltd
Code:
alex@Alienware:~$ cat /proc/asound/cards
0 [PCH ]: HDA-Intel - HDA Intel PCH
HDA Intel PCH at 0xd2310000 irq 31
1 [S51 ]: USB-Audio - SB Omni Surround 5.1
Creative Technology Ltd SB Omni Surround 5.1 at usb-0000:00:14.0-4.4, high spee
2 [NVidia ]: HDA-Intel - HDA NVidia
HDA NVidia at 0xd1000000 irq 17
Code:
alex@Alienware:~$ cat /proc/asound/S51/stream0
Creative Technology Ltd SB Omni Surround 5.1 at usb-0000:00:14.0-4.4, high spee : USB Audio
Playback:
Status: Stop
Interface 1
Altset 1
Format: S16_LE
Channels: 2
Endpoint: 1 OUT (ASYNC)
Rates: 48000, 96000
Data packet interval: 500 us
Interface 1
Altset 2
Format: S24_3LE
Channels: 2
Endpoint: 1 OUT (ASYNC)
Rates: 48000, 96000
Data packet interval: 500 us
Interface 1
Altset 3
Format: S16_LE
Channels: 6
Endpoint: 1 OUT (ASYNC)
Rates: 48000, 96000
Data packet interval: 500 us
Interface 1
Altset 4
Format: S24_3LE
Channels: 6
Endpoint: 1 OUT (ASYNC)
Rates: 48000, 96000
Data packet interval: 500 us
Capture:
Status: Stop
Interface 3
Altset 1
Format: S16_LE
Channels: 2
Endpoint: 2 IN (ASYNC)
Rates: 48000, 96000
Data packet interval: 500 us
Interface 3
Altset 2
Format: S24_3LE
Channels: 2
Endpoint: 2 IN (ASYNC)
Rates: 48000, 96000
Data packet interval: 500 us
Code:
alex@Alienware:~$ cat /proc/asound/S51/stream1
Creative Technology Ltd SB Omni Surround 5.1 at usb-0000:00:14.0-4.4, high spee : USB Audio #1
Playback:
Status: Stop
Interface 2
Altset 1
Format: S16_LE
Channels: 2
Endpoint: 4 OUT (ASYNC)
Rates: 44100, 48000, 96000
Data packet interval: 500 us
Interface 2
Altset 2
Format: S24_3LE
Channels: 2
Endpoint: 4 OUT (ASYNC)
Rates: 44100, 48000, 96000
Data packet interval: 500 us
Code:
alex@Alienware:~$ cat /proc/asound/S51/stream2
Creative Technology Ltd SB Omni Surround 5.1 at usb-0000:00:14.0-4.4, high spee : USB Audio #2
Playback:
Status: Stop
Interface 2
Altset 3
Format: S16_LE
Channels: 2
Endpoint: 4 OUT (ASYNC)
Rates: 44100, 48000, 96000
Data packet interval: 500 us
Code:
alex@Alienware:~$ aplay -L
default
Playback/recording through the PulseAudio sound server
null
Discard all samples (playback) or generate zero samples (capture)
equal
sysdefault:CARD=PCH
HDA Intel PCH, ALC3661 Analog
Default Audio Device
front:CARD=PCH,DEV=0
HDA Intel PCH, ALC3661 Analog
Front speakers
surround21:CARD=PCH,DEV=0
HDA Intel PCH, ALC3661 Analog
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
HDA Intel PCH, ALC3661 Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
HDA Intel PCH, ALC3661 Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
HDA Intel PCH, ALC3661 Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
HDA Intel PCH, ALC3661 Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
HDA Intel PCH, ALC3661 Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
dmix:CARD=PCH,DEV=0
HDA Intel PCH, ALC3661 Analog
Direct sample mixing device
dsnoop:CARD=PCH,DEV=0
HDA Intel PCH, ALC3661 Analog
Direct sample snooping device
hw:CARD=PCH,DEV=0
HDA Intel PCH, ALC3661 Analog
Direct hardware device without any conversions
plughw:CARD=PCH,DEV=0
HDA Intel PCH, ALC3661 Analog
Hardware device with all software conversions
sysdefault:CARD=S51
SB Omni Surround 5.1, USB Audio
Default Audio Device
front:CARD=S51,DEV=0
SB Omni Surround 5.1, USB Audio
Front speakers
surround21:CARD=S51,DEV=0
SB Omni Surround 5.1, USB Audio
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=S51,DEV=0
SB Omni Surround 5.1, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=S51,DEV=0
SB Omni Surround 5.1, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=S51,DEV=0
SB Omni Surround 5.1, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=S51,DEV=0
SB Omni Surround 5.1, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=S51,DEV=0
SB Omni Surround 5.1, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=S51,DEV=0
SB Omni Surround 5.1, USB Audio
IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=S51,DEV=0
SB Omni Surround 5.1, USB Audio
Direct sample mixing device
dmix:CARD=S51,DEV=1
SB Omni Surround 5.1, USB Audio #1
Direct sample mixing device
dmix:CARD=S51,DEV=2
SB Omni Surround 5.1, USB Audio #2
Direct sample mixing device
dsnoop:CARD=S51,DEV=0
SB Omni Surround 5.1, USB Audio
Direct sample snooping device
dsnoop:CARD=S51,DEV=1
SB Omni Surround 5.1, USB Audio #1
Direct sample snooping device
dsnoop:CARD=S51,DEV=2
SB Omni Surround 5.1, USB Audio #2
Direct sample snooping device
hw:CARD=S51,DEV=0
SB Omni Surround 5.1, USB Audio
Direct hardware device without any conversions
hw:CARD=S51,DEV=1
SB Omni Surround 5.1, USB Audio #1
Direct hardware device without any conversions
hw:CARD=S51,DEV=2
SB Omni Surround 5.1, USB Audio #2
Direct hardware device without any conversions
plughw:CARD=S51,DEV=0
SB Omni Surround 5.1, USB Audio
Hardware device with all software conversions
plughw:CARD=S51,DEV=1
SB Omni Surround 5.1, USB Audio #1
Hardware device with all software conversions
plughw:CARD=S51,DEV=2
SB Omni Surround 5.1, USB Audio #2
Hardware device with all software conversions
hdmi:CARD=NVidia,DEV=0
HDA NVidia, HDMI 0
HDMI Audio Output
hdmi:CARD=NVidia,DEV=1
HDA NVidia, HDMI 1
HDMI Audio Output
dmix:CARD=NVidia,DEV=3
HDA NVidia, HDMI 0
Direct sample mixing device
dmix:CARD=NVidia,DEV=7
HDA NVidia, HDMI 1
Direct sample mixing device
dsnoop:CARD=NVidia,DEV=3
HDA NVidia, HDMI 0
Direct sample snooping device
dsnoop:CARD=NVidia,DEV=7
HDA NVidia, HDMI 1
Direct sample snooping device
hw:CARD=NVidia,DEV=3
HDA NVidia, HDMI 0
Direct hardware device without any conversions
hw:CARD=NVidia,DEV=7
HDA NVidia, HDMI 1
Direct hardware device without any conversions
plughw:CARD=NVidia,DEV=3
HDA NVidia, HDMI 0
Hardware device with all software conversions
plughw:CARD=NVidia,DEV=7
HDA NVidia, HDMI 1
Hardware device with all software conversions
|
|
|
07-12-2017, 07:24 PM
|
#2
|
LQ Newbie
Registered: Aug 2012
Posts: 9
Original Poster
Rep: 
|
I have managed to solve most problems, I've even got AC3 passthrough working with PulseAudio
The only thing that still doesn't fully work is software AC3 encoding.
The 'a52' and 'a52upmix' alsa devices created by the configuration scripts below work nicely when using
Code:
pasuspender -- mpv --audio-device='alsa/a52:CARD=S51' audiofile.flac
But when I try to play a video using this method then the audio stutters and the video framerate slows down and does not sync with the audio. (I have not tried to let mpv do the a52 encoding yet.)
Also if I try to use software AC3 with PulseAudio it seems to work at first but after a couple of seconds the indicator on my receiver starts to blink and the audio mutes. (This is followed by 1 processor core ramping up to about 50% usage...)
Does anyone here have a working software AC3 encoder using PulseAudio?
What follows are the configuration scripts I have written and tested.
The PulseAudio mixer now has the following extra profiles available:
Code:
For digital PCM playback on hw:S51,1 :
'Digital Stereo (IEC958) Output'
For software AC3 encoding on hw:S51,2 :
'Digital Surround 5.1 (IEC958/AC3) Output'
'Digital Stereo to Surround 5.1 Upmix (IEC958/AC3) Output'
For AC3 passthrough on hw:S51,2 (Must select the AC3 checkbox under advanced mixer settings):
'AC3 Passthrough (IEC958/raw) Output'
For anyone who has the same or similar issues; You can place all these files in a temporary directory and execute the 'install.sh' script. I have also included a small utility that works like 'aplay -L' but allows to search for a sound device (see example at the end.)
iec958.conf:
Code:
# File: /usr/share/alsa/alsa.conf.d/iec958.conf
#
# This creates a IEC958 port for all cards on device 1.
# Input: uncompressed digital audio (ie. stereo PCM audio)
# SB Omni Surround: 16bit or 24bit @ 44.1kHz, 48kHz or 96kHz
#
pcm.iec958 {
@args [ CARD ]
@args.CARD { type string }
type plug
slave {
pcm {
@func concat strings [ "hw:CARD=" $CARD ",DEV=1" ]
}
format S24_3LE
rate "unchanged"
}
hint {
show {
@func refer
name defaults.namehint.basic
}
description "IEC958 (S/PDIF) Digital Audio Output"
device 1
}
}
iec958raw.conf:
Code:
# File: /usr/share/alsa/alsa.conf.d/iec958.conf
#
# This creates a raw IEC958 port for device 2 on all cards.
# Input: compressed digital audio (AC3, DTS, ...)
#
#pcm.iec958raw {
# @args [ CARD AES0 AES1 AES2 AES3 ]
# @args.CARD { type string }
# @args.AES0 { type integer default 0x04 } # Consumer, not-copyright, emphasis-non, mode-0
# @args.AES1 { type integer default 0x82 } # original, PCM coder
# @args.AES2 { type integer default 0x00 } # source and channel
# @args.AES3 { type integer default 0x02 } # fs=48000Hz, clock accuracy=1000ppm
# type iec958
# slave {
# pcm {
# type hw
# card $CARD
# device 2
# }
# }
# status [ $AES0 $AES1 $AES2 $AES3 ]
# preamble.z 0x08
# preamble.x 0x02
# preamble.y 0x04
# hint {
# show {
# @func refer
# name defaults.namehint.basic
# }
# description "IEC958 (AC3) Digital Audio Output without any conversions"
# device 2
# }
#}
pcm.iec958raw {
@args [ CARD ]
@args.CARD { type string }
type hw
card $CARD
device 2
hint {
show {
@func refer
name defaults.namehint.basic
}
description "IEC958 (AC3) Digital Audio Output without any conversions"
device 2
}
}
a52.conf:
Code:
# File: /usr/share/alsa/alsa.conf.d/a52.conf
#
# 5.1 channel AC3 encoder
# Output device: iec958raw:CARD
#
# plug is used to convert to the correct sample format.
# rate is used to convert to the correct bitrate (stutters if done with plug).
# route is required, if not used then audio will not play.
# a52 is used to encode the audio to AC3
#
pcm.a52 {
@args [ CARD ]
@args.CARD { type string }
type plug
slave {
pcm {
type rate
slave {
pcm {
type route
slave {
pcm {
type a52
rate 48000
channels 6
format S16_LE
bitrate 999 # works for me, default is 640
slavepcm {
@func concat strings [ "iec958raw:CARD=" $CARD ]
}
}
channels 6
}
ttable {
0.0 = 1
1.1 = 1
2.2 = 1
3.3 = 1
4.4 = 1
5.5 = 1
}
}
rate 48000
}
converter samplerate_best
}
channels 6
format S16_LE
rate "unchanged"
}
hint {
show {
@func refer
name defaults.namehint.basic
}
description "IEC958 (AC3) Digital Surround 5.1 with all software conversions"
device 2
}
}
a52upmix.conf:
Code:
# File: /usr/share/alsa/alsa.conf.d/a52upmix.conf
#
# 2.0 -> 5.1 channel AC3 encoder
# Output device: iec958raw:CARD
#
# plug is used to convert to the correct sample format.
# rate is used to convert to the correct bitrate (stutters if done with plug).
# route is used tp upmix the stereo input to 6 channels.
# a52 is used to encode the audio to AC3
#
pcm.a52upmix {
@args [ CARD ]
@args.CARD { type string }
type plug
slave {
pcm {
type rate
slave {
pcm {
type route
slave {
pcm {
type a52
rate 48000
channels 6
format S16_LE
bitrate 999 # works for me, default is 640
slavepcm {
@func concat strings [ "iec958raw:CARD=" $CARD ]
}
}
channels 6
}
ttable {
0.0 = 1
0.2 = -0.6
0.3 = -0.39
0.4 = 0.5
0.5 = 0.5
1.1 = 1
1.2 = -0.39
1.3 = -0.6
1.4 = 0.5
1.5 = 0.5
}
}
rate 48000
}
converter samplerate_best
}
channels 2
format S16_LE
rate "unchanged"
}
hint {
show {
@func refer
name defaults.namehint.basic
}
description "IEC958 (AC3) Digital Surround 2.0 -> 5.1 with all software conversions"
device 2
}
}
sb-omni-surround-5.1.conf:
Code:
# file: /usr/share/pulseaudio/alsa-mixer/profile-sets/sb-omni-surround-5.1.conf
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of the
# License, or (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
; Creative Sound Blaster Omni Surround 5.1
;
; This sound card have Mic/Line in at hw:%f,1,0 on Linux prior to 4.3-rc1,
; but starting from Linux 4.3-rc1 Mic/Line is at hw:%f,0,0
; This config supports both cases.
; Also by default there are some non-existing (physically) inputs
; and outputs that are not present here.
; And finally officially supported modes are stereo and 5.1 + stereo S/PDIF,
; so only these modes included.
;
; See default.conf for an explanation on the directives used here.
[General]
auto-profiles = yes
[Mapping analog-stereo-output]
device-strings = front:%f
channel-map = left,right
paths-output = analog-output
priority = 4
direction = output
; Linux 4.2.x- have microphone input as device 1
; While Linux 4.3-rc1+ have microphone input as device 0
[Mapping analog-stereo-input]
device-strings = hw:%f hw:%f,1,0
paths-input = analog-input-mic analog-input-linein
channel-map = left,right
direction = input
[Mapping analog-surround-51]
device-strings = surround51:%f
channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe
paths-output = analog-output
priority = 3
direction = output
[Mapping iec958-stereo]
description = Digital Stereo (IEC958)
device-strings = iec958:%f
channel-map = left,right
paths-output = iec958-stereo-output
priority = 10
direction = output
[Mapping hdmi-stereo-extra1]
description = AC3 Passthrough (IEC958/raw)
device-strings = iec958raw:%f
channel-map = left,right
paths-output = iec958-stereo-output
priority = 10
direction = output
[Mapping hdmi-stereo-extra2]
description = Digital Stereo to Surround 5.1 Upmix (IEC958/AC3)
device-strings = a52upmix:%f
paths-output = iec958-stereo-output
channel-map = left,right
priority = 10
direction = output
[Mapping iec958-ac3-surround-51]
device-strings = a52:%f
channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe
paths-output = iec958-stereo-output
priority = 10
direction = output
listpcm.c:
Code:
//
// listpcm.c - Modified version of 'aplay -L' that allows to search for a PCM
//
// gcc -Os -g0 listpcm.c -o listpcm -lasound
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <alsa/asoundlib.h>
static snd_pcm_stream_t stream = SND_PCM_STREAM_PLAYBACK;
static void pcm_list(const char* search)
{
void **hints, **n;
char *name, *descr, *descr1, *io;
const char *filter;
int x;
if (snd_device_name_hint(-1, "pcm", &hints) < 0) return;
n = hints;
filter = stream == SND_PCM_STREAM_CAPTURE ? "Input" : "Output";
while (*n) {
name = snd_device_name_get_hint(*n, "NAME");
descr = snd_device_name_get_hint(*n, "DESC");
// IO direction, input or output
io = snd_device_name_get_hint(*n, "IOID");
if (!(io && strcmp(io, filter))) {
// Only list the PCMs we are searching for
if (!search || strstr(name,search)) {
// List PCM
printf("%s", name);
// Align descriptions at 4 tabs
x = 4 - strlen(name) / 8;
while(x--) putchar('\t');
// Print description (on the same line)
if (descr) {
descr1 = descr;
while (*descr1) {
if (*descr1 == '\n') printf(" (");
else putchar(*descr1);
descr1++;
}
putchar(')');
}
putchar('\n');
}
}
if (name) free(name);
if (descr) free(descr);
if (io) free(io);
n++;
}
snd_device_name_free_hint(hints);
}
int main (int argc, char **argv)
{
if (argc == 1) pcm_list(NULL); // list all PCMs
else {
if (strstr(argv[1],"-h") != 0 || strstr(argv[1],"--help") != 0) {
printf(
"Seach for a specified ALSA device.\n"
"Usage: %s [\"device name substring\"]\n"
"Example: %s \"iec958\"\n"
, argv[0], argv[0]
);
return 1;
}
pcm_list(argv[1]); // search through PCM list
}
return 0;
}
install.sh:
Code:
#!/bin/bash
#
# SB Omni Surround 5.1 - Install script for debian 9 (stretch)
# Modifies the default ALSA and PulseAudio configuration to fix IEC958 output
#
set -e
[ `id -u` == 0 ] && {
# Must run as normal user in order to restart PulseAudio
echo "Run as normal user..."
false
}
# Install packages
sudo apt-get update
sudo apt-get -y install build-essential libasound2-dev libasound2-plugins
# Modify /usr/share/alsa/alsa.conf
sudo sed -i 's/^\(pcm.iec958\)/\#\1/' /usr/share/alsa/alsa.conf
sudo sed -i 's/^\(pcm.spdif\)/\#\1/' /usr/share/alsa/alsa.conf
# Install new plugins in /usr/share/alsa/alsa.conf.d
sudo cp -fv a52.conf /usr/share/alsa/alsa.conf.d
sudo chown root:root /usr/share/alsa/alsa.conf.d/a52.conf
sudo chmod 0644 /usr/share/alsa/alsa.conf.d/a52.conf
sudo cp -fv a52upmix.conf /usr/share/alsa/alsa.conf.d
sudo chown root:root /usr/share/alsa/alsa.conf.d/a52upmix.conf
sudo chmod 0644 /usr/share/alsa/alsa.conf.d/a52upmix.conf
sudo cp -fv iec958.conf /usr/share/alsa/alsa.conf.d
sudo chown root:root /usr/share/alsa/alsa.conf.d/iec958.conf
sudo chmod 0644 /usr/share/alsa/alsa.conf.d/iec958.conf
sudo cp -fv iec958raw.conf /usr/share/alsa/alsa.conf.d
sudo chown root:root /usr/share/alsa/alsa.conf.d/iec958raw.conf
sudo chmod 0644 /usr/share/alsa/alsa.conf.d/iec958raw.conf
# Install new pulseaudio mixer profile in /usr/share/pulseaudio/alsa-mixer/profile-sets
sudo cp -fv sb-omni-surround-5.1.conf /usr/share/pulseaudio/alsa-mixer/profile-sets
sudo chown root:root /usr/share/pulseaudio/alsa-mixer/profile-sets/sb-omni-surround-5.1.conf
sudo chmod 0644 /usr/share/pulseaudio/alsa-mixer/profile-sets/sb-omni-surround-5.1.conf
# Restart pulseaudio
pulseaudio -k
# Build/Install listpcm
gcc -D_FORTIFY_SOURCE=2 -Xlinker --strip-all -Os -g0 -fstack-protector-strong -Wall -Werror -Wformat-security listpcm.c -o listpcm -lasound
sudo cp -fv ./listpcm /usr/bin
sudo chown root:root /usr/bin/listpcm
sudo chmod 0755 /usr/bin/listpcm
rm -f ./listpcm
listpcm
The file
Code:
/usr/share/alsa/alsa.conf
must also be edited to comment out these two lines:
(the install.sh scripts does this automatically)
Code:
pcm.iec958 cards.pcm.iec958
pcm.spdif iec958
The output of 'listpcm' should look something like this:
Code:
alex@Alienware:~$ listpcm S51
sysdefault:CARD=S51 SB Omni Surround 5.1, USB Audio (Default Audio Device)
front:CARD=S51,DEV=0 SB Omni Surround 5.1, USB Audio (Front speakers)
surround21:CARD=S51,DEV=0 SB Omni Surround 5.1, USB Audio (2.1 Surround output to Front and Subwoofer speakers)
surround40:CARD=S51,DEV=0 SB Omni Surround 5.1, USB Audio (4.0 Surround output to Front and Rear speakers)
surround41:CARD=S51,DEV=0 SB Omni Surround 5.1, USB Audio (4.1 Surround output to Front, Rear and Subwoofer speakers)
surround50:CARD=S51,DEV=0 SB Omni Surround 5.1, USB Audio (5.0 Surround output to Front, Center and Rear speakers)
surround51:CARD=S51,DEV=0 SB Omni Surround 5.1, USB Audio (5.1 Surround output to Front, Center, Rear and Subwoofer speakers)
surround71:CARD=S51,DEV=0 SB Omni Surround 5.1, USB Audio (7.1 Surround output to Front, Center, Side, Rear and Woofer speakers)
dmix:CARD=S51,DEV=0 SB Omni Surround 5.1, USB Audio (Direct sample mixing device)
dmix:CARD=S51,DEV=1 SB Omni Surround 5.1, USB Audio #1 (Direct sample mixing device)
dmix:CARD=S51,DEV=2 SB Omni Surround 5.1, USB Audio #2 (Direct sample mixing device)
dsnoop:CARD=S51,DEV=0 SB Omni Surround 5.1, USB Audio (Direct sample snooping device)
dsnoop:CARD=S51,DEV=1 SB Omni Surround 5.1, USB Audio #1 (Direct sample snooping device)
dsnoop:CARD=S51,DEV=2 SB Omni Surround 5.1, USB Audio #2 (Direct sample snooping device)
hw:CARD=S51,DEV=0 SB Omni Surround 5.1, USB Audio (Direct hardware device without any conversions)
hw:CARD=S51,DEV=1 SB Omni Surround 5.1, USB Audio #1 (Direct hardware device without any conversions)
hw:CARD=S51,DEV=2 SB Omni Surround 5.1, USB Audio #2 (Direct hardware device without any conversions)
plughw:CARD=S51,DEV=0 SB Omni Surround 5.1, USB Audio (Hardware device with all software conversions)
plughw:CARD=S51,DEV=1 SB Omni Surround 5.1, USB Audio #1 (Hardware device with all software conversions)
plughw:CARD=S51,DEV=2 SB Omni Surround 5.1, USB Audio #2 (Hardware device with all software conversions)
a52:CARD=S51 SB Omni Surround 5.1, USB Audio #2 (IEC958 (AC3) Digital Surround 5.1 with all software conversions)
a52upmix:CARD=S51 SB Omni Surround 5.1, USB Audio #2 (IEC958 (AC3) Digital Surround 2.0 -> 5.1 with all software conversions)
iec958:CARD=S51 SB Omni Surround 5.1, USB Audio #1 (IEC958 (S/PDIF) Digital Audio Output)
iec958raw:CARD=S51 SB Omni Surround 5.1, USB Audio #2 (IEC958 (AC3) Digital Audio Output without any conversions)
Last edited by ABruines; 07-12-2017 at 08:04 PM.
|
|
|
07-13-2017, 07:38 PM
|
#3
|
LQ 5k Club
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842
Rep: 
|
oops I was going to post a link to a conf but you already know about it.
sorry
so instead I will ask, as I don't have this device,
in windows it needs firmware.
what happens in Linux?
Last edited by aus9; 07-13-2017 at 07:40 PM.
|
|
|
07-15-2017, 08:02 PM
|
#4
|
LQ Newbie
Registered: Aug 2012
Posts: 9
Original Poster
Rep: 
|
The firmware I mentioned in my initial post is flashed to the soundcard (same as a motherboard BIOS) using a (windows) utility. Linux does not need to load it, when plugged into an USB port it is immediately seen by ALSA.
Does anyone know how to send a bugreport to the ALSA people? The bugtracker on http://www.alsa-project.org/ is down and I'm not allowed to subscribe to a mailing list.
I'm hesitant to email the authors directly (probably ends up in a spam filter anyway...)
|
|
|
07-15-2017, 09:09 PM
|
#5
|
LQ Newbie
Registered: Aug 2012
Posts: 9
Original Poster
Rep: 
|
I'm severely regretting updating to debian stretch, things were better with jessie
Debian has moved from mplayer2 to mpv and the latter really sucks.
I used to have on the fly 5.1 channel AAC/DTS/whatever to AC3 working with mplayer2 and the lavcac3enc plugin. With mpv I am getting stereo only, no matter what I do.
I think I might need to use a 'type iec958' plugin instead of the 'type hw' in my iec958raw.conf
I already tried to use it but the documentation is very sparse and I can not get it to work. When I try to use the the section I commented out in my iec958raw.conf with mpv I get the following error:
Quote:
[ao] Trying audio driver 'alsa'
[ao] Using preferred device 'iec958raw:S51'
[ao/alsa] requested format: 48000 Hz, stereo channels, spdif-ac3
[ao/alsa] using ALSA version: 1.1.3
[ao/alsa] opening device 'iec958raw:S51' => 'raw:S51,AES0=6,AES1=130,AES2=0,AES3=2'
[ao/alsa] Unable to get initial parameters: Invalid argument
[ao] Failed to initialize audio driver 'alsa'
[ao] This audio driver/device was forced with the --audio-device option.
[ao] Try unsetting it.
[cplayer] Could not open/initialize audio device -> no sound.
|
The alternative 'iec958raw' device using the 'type hw' plugin also does not work when used with mpv, and yet when I use the pulseaudio driver it does work (stereo only) even though that ends up using the exact same alsa device.
When I try to use the ALSA a52 plugin with mpv it works, but the audio still gets remixed back to stereo:
Code:
[af] Adding filter format
[af] Setting option 'channels' = '6' (flags = 0)
[af] Adding filter lavrresample
[lavrresample] Remix: stereo -> 5.1
[af] Audio filter chain:
[af] [in] 48000Hz stereo 2ch floatp
[af] [lavrresample] 48000Hz 5.1 6ch floatp [a]
[af] [format] 48000Hz 5.1 6ch floatp
[af] [out] 48000Hz 5.1 6ch floatp
[af] [ao] 48000Hz 5.1 6ch floatp
[ao] Trying audio driver 'alsa'
[ao] Using preferred device 'a52:S51'
[ao/alsa] requested format: 48000 Hz, 5.1 channels, floatp
[ao/alsa] using ALSA version: 1.1.3
[ao/alsa] opening device 'a52:S51'
[ao/alsa] trying format float
[ao/alsa] snd_pcm_query_chmaps() returned NULL
[ao/alsa] Going to set final HW params:
[ao/alsa] ---
[ao/alsa] ACCESS: RW_INTERLEAVED
[ao/alsa] FORMAT: FLOAT_LE
[ao/alsa] SUBFORMAT: STD
[ao/alsa] SAMPLE_BITS: 32
[ao/alsa] FRAME_BITS: 64
[ao/alsa] CHANNELS: 2
[ao/alsa] RATE: 48000
[ao/alsa] PERIOD_TIME: 32000
[ao/alsa] PERIOD_SIZE: 1536
[ao/alsa] PERIOD_BYTES: 12288
[ao/alsa] PERIODS: 8
[ao/alsa] BUFFER_TIME: 256000
[ao/alsa] BUFFER_SIZE: 12288
[ao/alsa] BUFFER_BYTES: 98304
[ao/alsa] TICK_TIME: ALL
[ao/alsa] ---
[ao/alsa] channel map reported by ALSA: FL FR
[ao/alsa] which we understand as: stereo
[ao/alsa] which is what we requested.
[ao/alsa] hw pausing supported: no
[ao/alsa] buffersize: 12288 samples
[ao/alsa] period size: 1536 samples
[ao/alsa] device buffer: 12288 samples.
[ao/alsa] using soft-buffer of 12288 samples.
[cplayer] AO: [alsa] 48000Hz stereo 2ch float
[cplayer] AO: Description: ALSA audio output
[af] Removing filter lavrresample
[af] Adding filter lavrresample
[lavrresample] Remix: stereo -> 5.1
[af] Adding filter lavrresample
[lavrresample] Remix: 5.1 -> stereo
[af] Audio filter chain:
[af] [in] 48000Hz stereo 2ch floatp
[af] [lavrresample] 48000Hz 5.1 6ch floatp [a]
[af] [format] 48000Hz 5.1 6ch floatp
[af] [lavrresample] 48000Hz stereo 2ch float [a]
[af] [out] 48000Hz stereo 2ch float
[af] [ao] 48000Hz stereo 2ch float
[cplayer] starting audio playback
It seems that ALSA is unable to provide a channel layout so mpv defaults back to stereo (note the line that says: '[ao/alsa] snd_pcm_query_chmaps() returned NULL').
This digital audio thing is actually making me think about migrating back to Windows (after 15 years of using Linux on my desktop). 
Last edited by ABruines; 07-15-2017 at 09:10 PM.
|
|
|
07-15-2017, 10:09 PM
|
#6
|
LQ 5k Club
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842
Rep: 
|
HI
I see you have tried mplayer and mpv. I can use mpv to play an aac encoded audio file mp4a type
but it plays equally well in vlc and vlc provide more info on the file if interested
eg vlc -> tools -> codec info (tells me my media file was encoded by itunes and 44100 hz)
2) I wonder if you would accept suggetions from a weirdo (me)?
copy your existing scripts somewhere safe
create a second local user.
create a .asoundrc file for user1
create a system wide /etc/asound.conf which will be for all other users (user2)
~/.asoundrc contents
pcm.!default {
type hw
card 1
device 1
}
/etc/asound.conf contents
pcm.!default {
type hw
card 1
device 2
}
reboot to test if interested
login to user1 to use device 1
logout and login to user2 to device 2
no doubt you have already tried simple solutions....so feel free to have a laugh at my simple attempts
who wants to be sane in this crazy world?
Last edited by aus9; 07-15-2017 at 10:10 PM.
|
|
1 members found this post helpful.
|
07-19-2017, 05:46 AM
|
#7
|
LQ Newbie
Registered: Aug 2012
Posts: 9
Original Poster
Rep: 
|
I really appreciate that you're trying to help, so I certainly won't laugh at your attempt. However your proposed solution does nothing for me, I have indeed tried simple solution before and this one would be more trouble than it is worth.
Currently I am taking a very close look at the JACK Audio Connection Kit.
I've never tried that before and have managed to compile 'ac3jack' (after fixing some compilation issues)
So far the jack server is running and ac3jack starts (lighting the AC3 indicator on my digital receiver) but so far I have been unable to route the audio to it.
|
|
|
05-17-2018, 01:40 PM
|
#8
|
LQ Newbie
Registered: May 2018
Posts: 1
Rep: 
|
Thanks
Hi ABruines,
big thanks for posting what worked for you, it certainly helped me a lot getting the S/PDIF output up and running myself.
|
|
|
04-01-2019, 03:31 PM
|
#9
|
LQ Newbie
Registered: Mar 2006
Posts: 4
Rep:
|
Hey
Hey guys,
I have exactly the same issue and it is very exhausting.. Did you manage to find any clean solution? It seems there was some movements in the alsa repo the last months
https://github.com/pulseaudio/pulsea...round-5.1.conf
But I cant make omni Souround to give me a 5.1 sound via SPDIF.
Cheers
Last edited by c0nfuser; 04-03-2019 at 02:51 AM.
|
|
|
06-25-2020, 04:55 AM
|
#10
|
LQ Newbie
Registered: Jun 2020
Posts: 1
Rep: 
|
SB OMNI 51 Status
Sorry to dig this thread up but I wanted to mentioned that I can't get my OMNI5.1 working with Digital Out at all anymore regardless of distro, its no longer properly compatible with LINUX IMO.
I have tried the instructions above but the result is removed output options (I use MANJARO) because commenting out "pcm.iec958 cards.pcm.iec958" &
"pcm.spdif iec958" just removes digital out all together. I suspect the fix above needs to be updated.
Granted I translated a few things to work under Arch, but not luck.
I have submitted a issue tracked on gitlab pulseaudio (cannot link, just manual nav to it) but its unlikely to get any traction since not many people use these soundcards anymore.
I may need to bite the bullet and buy a newer model DAC with better support.
It should be noted that early 2019 I didn't have any issues with the OMNI, even had spdif pass-through working but no idea if I did anything special back then to get it working (I have very poor memory).
|
|
|
All times are GMT -5. The time now is 10:19 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|