Audacity auto-enabling Optical Raw on startup [SOLVED]

Lubuntu 14.04
Audacity 2.0.5 (distributed version)
SoundBlaster Audigy 2 Value

If I go into Alsamixer and unmute (i.e enable) the Optical Raw channel, it turns off all sound. Mute it again, and sound is heard. By default, this switch is muted/turned off so all is well normally.

Unfortunately, when Audacity starts up, it automatically causes the Optical Raw channel to be enabled (unmuted). So I lose all sound until I go into Alsamixer and mute the channel. This is a nuisance, and doesn’t happen with any other sound program I’ve used, so I wonder if theres a work-around ?

Presumably Audacity probes all devices when it launches and doing so enables Optical Raw. Probably any application using PortAudio would do the same. You said in https://forum.audacityteam.org/t/can-hear-midi-but-cant-record-it-reprise-solved/34987/17 that other applications also turned off sound by unmuting Optical Raw.

There is a thread at https://forum.audacityteam.org/t/system-sound-crashes-on-audacity-start/27419/1 about SoundBlaster Audigy 2 losing sound on launching Audacity, but it isn’t clear if Optical Raw was the cause. There is a suggestion there that the issue started in Audacity 1.3.13 Beta, but I don’t recommend trying to use 1.3.12. You could try using Audacity 2.0.5 for Windows under WINE.

Do you ever use Optical Raw? If not perhaps you can disable it in a configuration file or script such as .asoundrc ? I am only a casual Linux user so you will have to wait for Steve to tell you if that is a possibility.


Gale

That sounds a bit weird. I doubt that is supposed to happen. I’d guess that is a minor bug in the ALSA driver. Do you know if your using the emu10k1 ALSA driver? The commands cat /proc/asound/cards and aplay -L will give you information about your sound card. Perhaps you could post the outputs from those commands.

Well done for working out what was going on. Again that sounds like a bug (probably the same bug as above) in the ALSA driver.

I can see why it might occur in Audacity and not in other audio programs. Audacity uses PortAudio to connect to the sound system. To populate the list of available devices, PortAudio probes the sound system to find all devices that are available. It would appear that when Portaudio probes the optical input, the input gets turned on. I’ve seen several similar bugs reported about the emu10k1 driver, but apparently Creative Labs have been unhelpful in seeking solutions.

It may be possible to work around the issue by disabling the optical channel - do you use it?

[Edit: just seen that Gale replied while I was typing, so posts may read out of order]

I thought Audacity wasn’t the only culprit, but when I came to think about it, I couldn’t find anything other program that actually messes with optical raw.
Anyway, I am willing to disable this interface, as I never use it.

I really don’t want to use WINE if I can avoid it as thats another can of worms but I can try that if all else fails.

fred@fred-desktop:~$ cat /proc/asound/cards 
 0 [Audigy2        ]: Audigy2 - SB Audigy 4 [SB0610]
                      SB Audigy 4 [SB0610] (rev.0, serial:0x10211102) at 0xdf00, irq 16

fred@fred-desktop:~$ aplay -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=Audigy2
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    Default Audio Device
front:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    Front speakers
rear:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    Rear speakers
center_lfe:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    Center and Subwoofer speakers
side:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    Side speakers
surround40:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    Direct sample mixing device
dmix:CARD=Audigy2,DEV=2
    SB Audigy 4 [SB0610], Multichannel Capture/PT Playback
    Direct sample mixing device
dmix:CARD=Audigy2,DEV=3
    SB Audigy 4 [SB0610], Multichannel Playback
    Direct sample mixing device
dsnoop:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    Direct sample snooping device
dsnoop:CARD=Audigy2,DEV=2
    SB Audigy 4 [SB0610], Multichannel Capture/PT Playback
    Direct sample snooping device
dsnoop:CARD=Audigy2,DEV=3
    SB Audigy 4 [SB0610], Multichannel Playback
    Direct sample snooping device
hw:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    Direct hardware device without any conversions
hw:CARD=Audigy2,DEV=2
    SB Audigy 4 [SB0610], Multichannel Capture/PT Playback
    Direct hardware device without any conversions
hw:CARD=Audigy2,DEV=3
    SB Audigy 4 [SB0610], Multichannel Playback
    Direct hardware device without any conversions
plughw:CARD=Audigy2,DEV=0
    SB Audigy 4 [SB0610], ADC Capture/Standard PCM Playback
    Hardware device with all software conversions
plughw:CARD=Audigy2,DEV=2
    SB Audigy 4 [SB0610], Multichannel Capture/PT Playback
    Hardware device with all software conversions
plughw:CARD=Audigy2,DEV=3
    SB Audigy 4 [SB0610], Multichannel Playback
    Hardware device with all software conversions
fred@fred-desktop:~$

I found a case on line where the problem was reported to occur whenever they turned on their wifi connection !

There appear to be quite a lot of issues with SB0610 sound cards, particularly around use of the S/PDIF output. The usual workarounds are to open AlsaMixer and switch on/off the part with the problem.

I found a solution to “S/PDIF output does not work” which is to run:

iecset audio on

so perhaps the reverse will work for your problem:

iecset audio off

Apparently there are several hardware revisions for the SB0610 and they all work slightly differently, making it near impossible for the ALSA guys to fix without detailed specifications from Creative Labs, which Creative Labs will not allow.

There is a lot of information on the Internet about this type of problem, but much of the information is conflicting, or works on one machine but not on another (I guess due to different hardware revisions).

I don’t think that Audacity is doing anything wrong. In order to discover the available ports, Audacity must perform a port scan of the hardware, but it appears that when doing, some Audigy sound cards respond by unmuting S/PDIF and muting the analog outputs (Why ?)

There is a lot of information about configuring ALSA in this article: Advanced Linux Sound Architecture - ArchWiki


I’m not sure what to suggest…


Have a look in your home directory with hidden files visible (In Nautilus: “View menu > Show hidden files”) and look to see if there is a file called:

.asoundrc

(the dot indicates that it is a hidden file).
If there is, open it in a text editor and post the contents. There may be a workaround that we can perform there.

Thanks.

Seems like iecset audio just toggles the state between consumer and professional - whatever that means. I tried it anyway…

fred@fred-desktop:~$ iecset audio off
Mode: consumer
Data: non-audio
Rate: 48000 Hz
Copyright: permitted
Emphasis: none
Category: PCM coder
Original: original
Clock: 1000 ppm
fred@fred-desktop:~$

There is no .asoundsrc in my home directory :cry: .

I’ll have a look at that link - maybe I can disable the interface though editing /etc/asound.conf …

all I can think of is trying to comment out all references to iec958 in /usr/share/alsa/alsa.conf .
Can’t do any harm can it ?

Make a backup copy first :wink:

it worked :astonished: !
Alsamixer still shows the spdif interface, but Audacity no longer unmutes it on startup :smiley: .

Fantastic :smiley:

Can you tell us exactly what you did. That could be very helpful for anyone else that has the problem.

The Bodge

  1. cd /usr/share/alsa
  2. sudo leafpad alsa.conf
  3. search for the string iec958
  4. insert a ‘#’ character at the start of that line
  5. repeat 3 & 4 until no more left (I had 4 lines in total)
  6. save & quit
  7. reboot
    Check
  8. run alsamixer - the playback tab still shows S/PDIF Optical Raw, and it is muted (as before)
  9. run Audacity - S/PDIF Optical Raw now remains muted (no need to re-mute manually) and sound is heard.

Am I right in thinking that the optical / S/PDIF option is no longer available in Audacity? (not listed in “Help > Audio Device Info”)

I can’t see it there, though I never looked there before I made the change.

Here’s the output of Help > Audio Device Info :

==============================
Default capture device number: 15
Default playback device number: 15
==============================
Device ID: 0
Device name: SB Audigy 4 [SB0610]: ADC Capture/Standard PCM Playback (hw:0,0)
Host name: ALSA
Input channels: 2
Output channels: 2
Low Input Latency: 0.005805
Low Output Latency: 0.008707
High Input Latency: 0.023220
High Output Latency: 0.034830
Supported Rates:
    8000
    9600
    11025
    12000
    15000
    16000
    22050
    24000
    32000
    44100
    48000
    88200
    96000
==============================
Device ID: 1
Device name: SB Audigy 4 [SB0610]: Mic Capture (hw:0,1)
Host name: ALSA
Input channels: 2
Output channels: 0
Low Input Latency: 0.032000
Low Output Latency: -1.000000
High Input Latency: 0.128000
High Output Latency: -1.000000
Supported Rates:
==============================
Device ID: 2
Device name: SB Audigy 4 [SB0610]: Multichannel Capture/PT Playback (hw:0,2)
Host name: ALSA
Input channels: 16
Output channels: 0
Low Input Latency: 0.005333
Low Output Latency: -1.000000
High Input Latency: 0.021333
High Output Latency: -1.000000
Supported Rates:
==============================
Device ID: 3
Device name: SB Audigy 4 [SB0610]: Multichannel Playback (hw:0,3)
Host name: ALSA
Input channels: 0
Output channels: 16
Low Input Latency: -1.000000
Low Output Latency: 0.005333
High Input Latency: -1.000000
High Output Latency: 0.021333
Supported Rates:
    48000
==============================
Device ID: 4
Device name: sysdefault
Host name: ALSA
Input channels: 128
Output channels: 128
Low Input Latency: 0.005805
Low Output Latency: 0.008707
High Input Latency: 0.023220
High Output Latency: 0.034830
Supported Rates:
    8000
    9600
    11025
    12000
    15000
    16000
    22050
    24000
    32000
    44100
    48000
    88200
    96000
    176400
    352800
==============================
Device ID: 5
Device name: front
Host name: ALSA
Input channels: 0
Output channels: 2
Low Input Latency: -1.000000
Low Output Latency: 0.008000
High Input Latency: -1.000000
High Output Latency: 0.032000
Supported Rates:
    8000
    9600
    11025
    12000
    15000
    16000
    22050
    24000
    32000
    44100
    48000
    88200
    96000
==============================
Device ID: 6
Device name: rear
Host name: ALSA
Input channels: 0
Output channels: 2
Low Input Latency: -1.000000
Low Output Latency: 0.008000
High Input Latency: -1.000000
High Output Latency: 0.032000
Supported Rates:
    8000
    9600
    11025
    12000
    15000
    16000
    22050
    24000
    32000
    44100
    48000
    88200
    96000
==============================
Device ID: 7
Device name: center_lfe
Host name: ALSA
Input channels: 0
Output channels: 2
Low Input Latency: -1.000000
Low Output Latency: 0.008000
High Input Latency: -1.000000
High Output Latency: 0.032000
Supported Rates:
    8000
    9600
    11025
    12000
    15000
    16000
    22050
    24000
    32000
    44100
    48000
    88200
    96000
==============================
Device ID: 8
Device name: side
Host name: ALSA
Input channels: 0
Output channels: 2
Low Input Latency: -1.000000
Low Output Latency: 0.008000
High Input Latency: -1.000000
High Output Latency: 0.032000
Supported Rates:
    8000
    9600
    11025
    12000
    15000
    16000
    22050
    24000
    32000
    44100
    48000
    88200
    96000
==============================
Device ID: 9
Device name: surround40
Host name: ALSA
Input channels: 0
Output channels: 4
Low Input Latency: -1.000000
Low Output Latency: 0.008000
High Input Latency: -1.000000
High Output Latency: 0.032000
Supported Rates:
    8000
    9600
    11025
    12000
    15000
    16000
    22050
    24000
    32000
    44100
    48000
    88200
    96000
==============================
Device ID: 10
Device name: surround41
Host name: ALSA
Input channels: 0
Output channels: 128
Low Input Latency: -1.000000
Low Output Latency: 0.008000
High Input Latency: -1.000000
High Output Latency: 0.032000
Supported Rates:
    8000
    9600
    11025
    12000
    15000
    16000
    22050
    24000
    32000
    44100
    48000
    88200
    96000
==============================
Device ID: 11
Device name: surround50
Host name: ALSA
Input channels: 0
Output channels: 128
Low Input Latency: -1.000000
Low Output Latency: 0.008000
High Input Latency: -1.000000
High Output Latency: 0.032000
Supported Rates:
    8000
    9600
    11025
    12000
    15000
    16000
    22050
    24000
    32000
    44100
    48000
    88200
    96000
==============================
Device ID: 12
Device name: surround51
Host name: ALSA
Input channels: 0
Output channels: 6
Low Input Latency: -1.000000
Low Output Latency: 0.008000
High Input Latency: -1.000000
High Output Latency: 0.032000
Supported Rates:
    8000
    9600
    11025
    12000
    15000
    16000
    22050
    24000
    32000
    44100
    48000
    88200
    96000
==============================
Device ID: 13
Device name: surround71
Host name: ALSA
Input channels: 0
Output channels: 8
Low Input Latency: -1.000000
Low Output Latency: 0.008000
High Input Latency: -1.000000
High Output Latency: 0.032000
Supported Rates:
    8000
    9600
    11025
    12000
    15000
    16000
    22050
    24000
    32000
    44100
    48000
    88200
    96000
==============================
Device ID: 14
Device name: pulse
Host name: ALSA
Input channels: 32
Output channels: 32
Low Input Latency: 0.008707
Low Output Latency: 0.008707
High Input Latency: 0.034830
High Output Latency: 0.034830
Supported Rates:
    8000
    9600
    11025
    12000
    15000
    16000
    22050
    24000
    32000
    44100
    48000
    88200
    96000
    176400
    192000
==============================
Device ID: 15
Device name: default
Host name: ALSA
Input channels: 32
Output channels: 32
Low Input Latency: 0.008707
Low Output Latency: 0.008707
High Input Latency: 0.034830
High Output Latency: 0.034830
Supported Rates:
    8000
    9600
    11025
    12000
    15000
    16000
    22050
    24000
    32000
    44100
    48000
    88200
    96000
    176400
    192000
==============================
Selected capture device: 0 - SB Audigy 4 [SB0610]: ADC Capture/Standard PCM Playback (hw:0,0)
Selected playback device: 15 - default
Supported Rates:
    8000
    11025
    16000
    22050
    32000
    44100
    48000
==============================
Available mixers:
==============================
Available capture sources:
==============================
Available playback volumes:
0 - Master:0
1 - Bass:0
2 - Treble:0
3 - PCM Center:0
4 - PCM Front:0
5 - PCM LFE:0
6 - PCM Side:0
7 - PCM Surround:0
8 - Front:0
9 - Surround:0
10 - Center:0
11 - LFE:0
12 - Side:0
13 - Synth:0
14 - Wave:0
15 - IEC958 Optical:0
16 - Aux2:0
17 - AMic:0
18 - Analog Mix:0
19 - Audigy CD:0
==============================
Capture volume is emulated
Playback volume is native