Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 298613 - media-sound/pulseaudio-0.9.19 reports invalid argument in alsa-util.c: snd_pcm_hw_params_set_channels
Summary: media-sound/pulseaudio-0.9.19 reports invalid argument in alsa-util.c: snd_pc...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo Sound Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-28 06:47 UTC by John Klug
Modified: 2011-01-05 02:12 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Trace files (traces.tar.gz,10.35 KB, application/octet-stream)
2009-12-28 16:46 UTC, John Klug
Details
asound.conf and pulse files (pulse_alsa_etc.tar.gz,3.07 KB, application/octet-stream)
2010-12-28 06:07 UTC, John Klug
Details
Pulseaudio output with defaults removed from default.pa (vvv2.txt,115.19 KB, text/plain)
2010-12-29 06:27 UTC, John Klug
Details
Working module-udev-detect with iec958 (default.pa,4.78 KB, text/plain)
2011-01-04 08:16 UTC, John Klug
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Klug 2009-12-28 06:47:02 UTC
module-udev-detect appears not to work with alsa and iec958.  This problem can be avoided by using module-detect.

The kernel is sys-kernel/gentoo-sources-2.6.31-r6 (2.6.31-r6).

ALSA is media-plugins/alsa-plugins-1.0.20.

Only the analog driver is loaded with NVIDIA ALC888 and module-udev-detect.

D: alsa-mixer.c: Looking at profile output:analog-mono+input:iec958-stereo
D: alsa-mixer.c: Checking for playback on Analog Mono (analog-mono)
D: alsa-util.c: Trying hw:0 with SND_PCM_NO_AUTO_FORMAT ...
D: alsa-util.c: Managed to open hw:0
D: alsa-util.c: snd_pcm_hw_params_set_channels(1) failed: Invalid argument
D: alsa-util.c: Trying hw:0 without SND_PCM_NO_AUTO_FORMAT ...
D: alsa-util.c: Managed to open hw:0
D: alsa-util.c: snd_pcm_hw_params_set_channels(1) failed: Invalid argument
D: alsa-util.c: Trying plug:hw:0 with SND_PCM_NO_AUTO_FORMAT ...
D: alsa-util.c: Managed to open plug:hw:0
D: alsa-util.c: snd_pcm_hw_params_set_channels(1) failed: Invalid argument
D: alsa-util.c: Trying plug:hw:0 without SND_PCM_NO_AUTO_FORMAT ...
D: alsa-util.c: Managed to open plug:hw:0
D: alsa-util.c: snd_pcm_hw_params_set_channels(1) failed: Invalid argument
I: alsa-util.c: Failed to set hardware parameters on plug:hw:0: Invalid argument
D: alsa-mixer.c: Looking at profile output:analog-mono+input:iec958-surround-40
D: alsa-mixer.c: Checking for playback on Analog Mono (analog-mono)
D: alsa-util.c: Trying hw:0 with SND_PCM_NO_AUTO_FORMAT ...
D: alsa-util.c: Managed to open hw:0
D: alsa-util.c: snd_pcm_hw_params_set_channels(1) failed: Invalid argument
D: alsa-util.c: Trying hw:0 without SND_PCM_NO_AUTO_FORMAT ...
D: alsa-util.c: Managed to open hw:0
D: alsa-util.c: snd_pcm_hw_params_set_channels(1) failed: Invalid argument
D: alsa-util.c: Trying plug:hw:0 with SND_PCM_NO_AUTO_FORMAT ...
D: alsa-util.c: Managed to open plug:hw:0
D: alsa-util.c: snd_pcm_hw_params_set_channels(1) failed: Invalid argument
D: alsa-util.c: Trying plug:hw:0 without SND_PCM_NO_AUTO_FORMAT ...
D: alsa-util.c: Managed to open plug:hw:0
D: alsa-util.c: snd_pcm_hw_params_set_channels(1) failed: Invalid argument
I: alsa-util.c: Failed to set hardware parameters on plug:hw:0: Invalid argument
D: alsa-mixer.c: Looking at profile output:analog-stereo
D: alsa-mixer.c: Checking for playback on Analog Stereo (analog-stereo)
  ...

Reproducible: Always

Steps to Reproduce:
1. default.pa has load-module module-udev-detect
2. pulseaudio -vvv
3. No sound with aplay -Dpulse on iec958
Comment 1 Rafał Mużyło 2009-12-28 12:02:40 UTC
More likely it's a problem with alsa-lib
(though pugins may matter too)
Try at least 1.0.21a.
Comment 2 John Klug 2009-12-28 16:42:28 UTC
I moved up as you requested.  I rebooted just to be safe.  No difference.

equery list alsa
[ Searching for package 'alsa' in all categories among: ]
 * installed packages
[I--] [ ~] media-libs/alsa-lib-1.0.21a (0)
[I--] [  ] media-libs/alsa-oss-1.0.17 (0)
[I--] [ ~] media-plugins/alsa-plugins-1.0.21 (0)
[I--] [  ] media-plugins/gst-plugins-alsa-0.10.24 (0.10)
[I--] [ ~] media-sound/alsa-headers-1.0.21 (0)
[I--] [ ~] media-sound/alsa-utils-1.0.21-r1 (0.9)
Comment 3 John Klug 2009-12-28 16:46:57 UTC
Created attachment 214458 [details]
Trace files

I have included the pulseaudio -vvv output from using module-udev-detect, and the expected iec958 sink using module-detect and pacmd/list-sinks. This was all done with alsa-lib-1.0.21a and alsa-plugins-1.0.21.
Comment 4 Arun Raghavan (RETIRED) gentoo-dev 2010-11-26 04:25:39 UTC
Is this still a problem with recent PulseAudio, alsa-lib and kernel?
Comment 5 John Klug 2010-12-27 00:33:09 UTC
Same problem is still there with the following software levels:

sys-kernel/gentoo-sources-2.6.34-r12
media-libs/alsa-lib-1.0.23 (0)
media-sound/pulseaudio-0.9.21.1 (0)


I still do not get any digital sink (iec958) with module-udev-detect.

The errors are the same.

Problem is avoided by using deprecated module-detect
Comment 6 John Klug 2010-12-27 00:35:53 UTC
Forgot to mention alsa-lib.  I am at 1.0.23

media-libs/alsa-lib-1.0.23
Comment 7 Rafał Mużyło 2010-12-27 16:08:52 UTC
Attach your /etc/asound.conf, .asoundrc and your pulseaudio configuration files.
Post useflags pulseaudio was built with.
Comment 8 John Klug 2010-12-28 06:07:03 UTC
Created attachment 258236 [details]
asound.conf and pulse files

I have no .asoundrc file.

The file baddefault.pa is used to verify that pulseaudio cannot find iec958 with module-udev-detect.
Comment 9 John Klug 2010-12-28 06:10:16 UTC
$ equery uses -a media-sound/pulseaudio-0.9.21.1
[ Searching for packages matching media-sound/pulseaudio-0.9.21.1... ]
[ Colour Code : set unset ]
[ Legend : Left column  (U) - USE flags from make.conf              ]
[        : Right column (I) - USE flags packages was installed with ]
[ Found these USE variables for media-sound/pulseaudio-0.9.21.1 ]
 U I
 + + X             : Adds support for X11
 + + alsa          : Adds support for media-libs/alsa-lib (Advanced Linux Sound Architecture)
 - + asyncns       : Use libasyncns for asynchronous name resolution.
 + + avahi         : Add avahi/Zeroconf support
 - - bluetooth     : Enables Bluetooth Support
 + + caps          : Use Linux capabilities library to control privilege
 + + dbus          : Enable dbus support for anything that needs it (gpsd, gnomemeeting, etc)
 - - doc           : Adds extra documentation (API, Javadoc, etc)
 - + glib          : Enable glib eventloop support
 + + gnome         : Adds GNOME support
 + + hal           : Enable Hardware Abstraction Layer (HAL) support
 + + ipv6          : Adds support for IP version 6
 - - jack          : Adds support for the JACK Audio Connection Kit
 + + libsamplerate : Build with support for converting sample rates using libsamplerate
 + + lirc          : Adds support for lirc (Linux's Infra-Red Remote Control)
 - - oss           : Adds support for OSS (Open Sound System)
 - - system-wide   : Allow preparation and installation of the system-wide init script for PulseAudio. Since this support is only supported for embedded situations, do not enable without reading the upstream instructions at http://pulseaudio.org/wiki/WhatIsWrongWithSystemMode .
 + + tcpd          : Adds support for TCP wrappers
 - - test          : Workaround to pull in packages needed to run with FEATURES=test. Portage-2.1.2 handles this internally, so don't set it in make.conf/package.use anymore
 - + udev          : Enable sys-fs/udev integration (device discovery, power and storage device support, etc)
Comment 10 Rafał Mużyło 2010-12-28 13:00:04 UTC
Try again with the one you claim isn't working, but with set-default-{sink, source} commented out.
Comment 11 John Klug 2010-12-29 06:27:33 UTC
Created attachment 258300 [details]
Pulseaudio output with defaults removed from default.pa

Once again, I only have analog sinks with the following two lines commented out:

#set-default-sink alsa_output.iec958
#set-default-source alsa_input.iec958
Comment 12 Rafał Mużyło 2010-12-29 12:33:23 UTC
Those messages are most likely just capabilities tests.
Daemon seems to start correctly and I suspect that SIGINT is just you pressing ^C.
Two sinks and two sources are set up: "alsa_output.pci-0000_00_07.0.analog-stereo", "alsa_output.pci-0000_00_07.0.analog-stereo.monitor", "alsa_input.pci-0000_00_07.0.analog-stereo" and "alsa_input.pci-0000_01_08.1.analog-stereo".

There's "Profile output:iec958-stereo+input:iec958-stereo supported." message, among other.

Does paplay work ?
Comment 13 John Klug 2011-01-02 05:42:16 UTC
pacmd / list-sinks does not list an iec958 sink (with module-udev-detect).

Using the Alsa provided files for tests ...

$ paplay -d iec958-stereo Front_Left.wav
Stream error: No such entity
 
Without a device paplay hangs.


With module-detect, and set-default-sink alsa_output.iec958
the following works:

$ aplay Front_Left.wav 
Playing WAVE 'Front_Left.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono

$ aplay -dpulse Front_Left.wav 
Playing WAVE 'Front_Left.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono


paplay hangs as before. I have never used it before.


Comment 14 Rafał Mużyło 2011-01-02 07:48:08 UTC
Honestly, I'm getting a feeling you're trying to pick your teeth with a pickaxe.
I'm not saying it can't be done, but it demands skill, which can only be gained by training, which may be very painful.

Make sure alsa-plugins is built with pulseaudio useflag.
With pacmd, see list-cards first, then use set-card-profile.
How do you run the daemon anyway ?

Use only module-udev-detect and set neither module-alsa-sink nor module-alsa-source (regarding attached default.pa).

Try 'paplay --raw /dev/urandom' for tests (perhaps add -v for more output).
Comment 15 John Klug 2011-01-02 20:25:50 UTC
Since I was told to comment out the default source/sink, I have not used a default source/sink with module-udev-detect. With module-detect, paplay --raw /dev/urandom creates sound.  With module-udev-detect, it does not.

Here is the output using module-udev-detect with no default source or sink specified.  There is no sound (as would be expected, as nothing is connected to the analog output, and that is the only sink):

paplay -v --raw /dev/urandom


Opening a playback stream with sample specification 's16le 2ch 44100Hz' and channel map 'front-left,front-right'.
Connection established.[K
Stream successfully created.
Buffer metrics: maxlength=4194304, tlength=352800, prebuf=349276, minreq=3528
Using sample spec 's16le 2ch 44100Hz', channel map 'front-left,front-right'.
Connected to device alsa_output.pci-0000_00_07.0.analog-stereo (0, not suspended).
Stream started.[K
Time: 0.000 sec; Latency: 2351519 usec.        
Time: 0.029 sec; Latency: 2322157 usec.        
Comment 16 Rafał Mużyło 2011-01-03 09:20:55 UTC
So, the point is: everything *is* working correctly.
Now, just use pacmd to switch profile to iec958-stereo and if that works,
check the docs on how to pass that via config file.
Comment 17 John Klug 2011-01-04 08:16:14 UTC
Created attachment 258794 [details]
Working module-udev-detect with iec958

The only thing that doesn't look right here is that I had to use a card index of 0.  I thought card index numbers were supposed to have been eliminated a long time ago.

Also, pacmd help is incorrect:

   set-card-profile          Change the profile of a card (args: index, name)


Notice it says index [comma] name

This is incorrect.  It should be a space.

Also the man page for pulse-client.conf does not mention set-card-profile, but does mention default-sink.
Comment 18 Rafał Mużyło 2011-01-04 12:01:22 UTC
That help text just lists the args, not shows format.

Well, technically you probably could have used default-{sink,source}
with 
alsa_{output,input}.pci-0000_00_07.0.iec958-stereo.

Anyway, it was a configuration problem, so not a bug.

Oh, and a hint, drop hal useflag from pulseaudio, obviously it's not really used anymore.
Comment 19 John Klug 2011-01-05 02:12:13 UTC
I verified that this works in my default.pa (I removed set-card-profile):

set-default-sink alsa_output.pci-0000_00_07.0.iec958-stereo