Bug 1413056

Summary: PulseAudio doesn't recognize modem's sound interface [Sierra MC7304]
Product: Red Hat Enterprise Linux 7 Reporter: Deepu K S <dkochuka>
Component: pulseaudioAssignee: Wim Taymans <wtaymans>
Status: CLOSED CURRENTRELEASE QA Contact: Desktop QE <desktop-qa-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.3CC: cww, dkochuka, tpelka, wtaymans
Target Milestone: rcKeywords: OtherQA
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-28 15:35:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1420851, 1472339    
Attachments:
Description Flags
pulseaudio logs with "ExecStart=/bin/pulseaudio --system --daemonize --disallow-exit --disable-shm --exit-idle-time=-1 -v --log-target=newfile:/tmp/pulseverbose.log --log-time=1" none

Description Deepu K S 2017-01-13 14:01:50 UTC
Description of problem:
Pulseaudio doesn't recognize the Sierra MC7304 card correctly.

The Sierra MC7304 exposes a USB sound interface that we want to use. There are no direct hardwired inputs/outputs from the modem to the outside of the chassis. This is why we have to link/mix the modem's sound card with the system's sound card on the software level.
Using ALSA loopback devices is not stable as we constantly ran into underruns. So we decided to switch to PulseAudio. Our servers are headless and don't have a graphical desktop, that's why PulseAudio is configured to run in system-wide mode.
Now, letting PulseAudio run in system-wide mode has some negative effects. First of all, the modem's sound card isn't recognized when the --disallow-module-loading parameter is set.

The resulting messages are:
=================================================
Dec 21 10:41:57 eddie028.pnet.ch pulseaudio[868]: OK, so you are running PA in system mode. Please note that you most likely shouldn't be doing that.
Dec 21 10:41:57 eddie028.pnet.ch pulseaudio[868]: If you do it nonetheless then it's your own fault if things don't work as expected.
Dec 21 10:41:57 eddie028.pnet.ch pulseaudio[868]: Please read http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/ for an explanation why system mode is usually a bad idea.
Dec 21 10:41:57 eddie028.pnet.ch pulseaudio[868]: Failed to find a working profile.
Dec 21 10:41:57 eddie028.pnet.ch pulseaudio[868]: Failed to load module "module-alsa-card" (argument: "device_id="2" name="usb-Sierra_Wireless__Incorporated_MC7304_0123456789ABCDEF-10-MC7304" card_name="alsa_card.usb-Sierra_Wireless__Incorporated_MC7304_0123456789ABCDEF-10-MC7304" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1""): initialization failed.
=================================================

Secondly, even if we allow the module loading and do not set the --disallow-module-loading parameter, the sound card isn't properly recognized.

The resulting messages are:
=================================================
Dec 21 10:46:48 eddie028.pnet.ch pulseaudio[3149]: Failed to load module "module-alsa-card" (argument: "device_id="2" name="usb-Sierra_Wireless__Incorporated_MC7304_0123456789ABCDEF-10-MC7304" card_name="alsa_card.usb-Sierra_Wireless__Incorporated_MC7304_0123456789ABCDEF-10-MC7304" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1""): initialization failed.
Dec 21 10:46:48 eddie028.pnet.ch pulseaudio[3149]: Failed to find a working profile.
...
[the two messages above are repeated three more times]
...
Dec 21 10:46:48 eddie028.pnet.ch pulseaudio[3149]: Failed to load module "module-alsa-card" (argument: "device_id="2" name="usb-Sierra_Wireless__Incorporated_MC7304_0123456789ABCDEF-10-MC7304" card_name="alsa_card.usb-Sierra_Wireless__Incorporated_MC7304_0123456789ABCDEF-10-MC7304" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1""): initialization failed.
Dec 21 10:46:48 eddie028.pnet.ch pulseaudio[3149]: Tried to configure /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4:1.16/sound/card2 (alsa_card.usb-Sierra_Wireless__Incorporated_MC7304_0123456789ABCDEF-10-MC7304) more often than 5 times in 10s
=================================================

Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux 7.3
pulseaudio-6.0-8.el7.x86_64
alsa-lib-1.1.1-1.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1.
2.
3.

Actual results:
We discovered that resetting the modem with a "AT!RESET" suddenly lets PulseAudio recognize the card correctly, provided that the --disallow-module-loading parameter is set. So we could simply reset the modem automatically at every system boot. However, a reset means that the modem is not available for 20-30 seconds. In our case, the modem is not only used for telephone calls but for internet connectivity, too. So an automatic reset is no option.

Expected results:
What we'd like to see is the modem's sound card being automatically recognized at system boot without a modem reset, if that's feasible. Please also find attached the systemd unit file we use to start/stop PulseAudio as well as PulseAudio's configuration file.

Additional info:

Comment 1 Deepu K S 2017-01-13 14:09:56 UTC
Created attachment 1240352 [details]
pulseaudio logs with "ExecStart=/bin/pulseaudio --system --daemonize --disallow-exit --disable-shm --exit-idle-time=-1 -v --log-target=newfile:/tmp/pulseverbose.log --log-time=1"

Comment 2 Deepu K S 2017-01-13 14:11:09 UTC
Moving out ~/.config/pulse folder and
# mkdir ~/pulse-bkp
# mv ~/.config/pulse/* ~/pulse-bkp

Adding 'autospawn = no' in /etc/pulse/client.conf

Tried above, but didn't help.

Comment 4 Deepu K S 2017-01-18 07:49:14 UTC
To Note,

We noticed that if we fully shutdown the server and boot it again, the sound card interface is visible without a modem reset. So there's a difference between a shutdown&boot and a reboot.

Comment 5 Benjamin Affolter 2017-01-30 10:44:35 UTC
Maybe the following bug report helps, especially comment #5: https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1191898/

Comment 6 Deepu K S 2017-02-07 17:29:13 UTC
Some more information;
During further testing we realized that the problem persists when PulseAudio runs in user mode, so the problem isn't restricted to PulseAudio in system mode.

And a question: How likely it is that this problem is related to the modem's firmware instead of PulseAudio?

Thanks

Comment 7 Wim Taymans 2017-02-20 15:37:06 UTC
(In reply to Deepu K S from comment #6)
> And a question: How likely it is that this problem is related to the modem's
> firmware instead of PulseAudio?

Quite likely, especially when you need to reset the modem to make it work. That suggests that the default state of the modem is not initialized properly at the driver level.

There are also these lines in the pulseaudio code for the source and sinks:

    if (pa_alsa_pcm_is_modem(u->pcm_handle)) {
        pa_log_notice("Device %s is modem, refusing further initialization.", u->device_name);
        goto fail;
    }

But since you don't see those notices and things eventually work, _is_modem likely returns FALSE..