Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1847508 - No sound with Creative Soundblaster Z since update to alsa-lib-1.2.3-8
Summary: No sound with Creative Soundblaster Z since update to alsa-lib-1.2.3-8
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: alsa-lib
Version: 32
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jaroslav Kysela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-06-16 14:10 UTC by Wolfgang Ulbrich
Modified: 2020-06-22 08:10 UTC (History)
1 user (show)

Fixed In Version: alsa-lib-1.2.3.1-1.fc32
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-06-22 08:10:16 UTC
Type: Bug


Attachments (Terms of Use)
alsa-info working (61.85 KB, text/plain)
2020-06-18 08:53 UTC, Wolfgang Ulbrich
no flags Details
alsa-info non-working (62.26 KB, text/plain)
2020-06-18 08:54 UTC, Wolfgang Ulbrich
no flags Details
alsa-info diff between good and bad (2.70 KB, patch)
2020-06-18 08:55 UTC, Wolfgang Ulbrich
no flags Details | Diff
als-info non working with both patches (62.26 KB, text/plain)
2020-06-18 09:44 UTC, Wolfgang Ulbrich
no flags Details

Description Wolfgang Ulbrich 2020-06-16 14:10:23 UTC
Description of problem:
Since update to 1.2.3-8 i don't have sound any more with my sound blaster Z.
All channel setups don't work any more.
Card is supported since kernel-5.0 and firmware is in latest firmware package.

[root@mother rave]# aplay -l
**** Liste der Hardware-Geräte (PLAYBACK) ****
Karte 0: Creative [HDA Creative], Gerät 0: CA0132 Analog [CA0132 Analog]
  Sub-Geräte: 0/1
  Sub-Gerät #0: subdevice #0
Karte 0: Creative [HDA Creative], Gerät 1: CA0132 Digital [CA0132 Digital]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 3: HDMI 0 [HDMI 0]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 7: HDMI 1 [HDMI 1]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 8: HDMI 2 [HDMI 2]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 9: HDMI 3 [HDMI 3]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 10: HDMI 4 [HDMI 4]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0


[root@mother rave]# cat /etc/asound.conf
#
# Place your global alsa-lib configuration here...
#

# set up default sound card which will be used by applications!
defaults.pcm.!card Creative
defaults.pcm.!device 0
defaults.ctl.!card Creative

# Rate Converter Plugin Using Speex Resampler
defaults.pcm.rate_converter "speexrate_best"

# The first ALSA device of the first soundcard
# (here: Analog Multichannel Ouput).
# See /proc/asound and "aplay -l".
pcm.creative {
	type hw
	card Creative
	device 0
}

# Dmix software mixing device.
# Takes multiple input streams, resamples them to target
# rate (here: 48kHz) and sends it to the sound card.
pcm.dmix51 {
	type dmix
	ipc_key 1024
	slave {
		pcm "creative"
		channels 6
		rate 48000
		period_time 0		# Fixes audio crackling/stutter
		period_size 1024	# with libsamplerate and chromium.
		buffer_time 0		# Not all options may be
		buffer_size 4096	# absolutely necessary.
	}
}

pcm.upmix51 {
    type upmix
    slave.pcm "dmix51"
    delay 15
	# Specifying the number of channels to upmix to here is mandatory.
    channels 6
}


pcm.dsnooper {
    type dsnoop
    ipc_key 1536
    slave.pcm "creative"
}

pcm.duplex {
    type asym
    playback.pcm "upmix51"
    capture.pcm "dsnooper"
}

pcm.!default {
	type plug
	slave.pcm "pcm.duplex"
}

Everything is working well with alsa-lib-1.2.2-2.fc32.x86_64 or older versions.

Please let me know if you need more debug info?


Version-Release number of selected component (if applicable):
alsa-lib-1.2.3-8


Actual results:

No sound output with creative soundblaster z

Expected results:

Working sound output with creative soundblaster z

Additional info:

Note, i am using alsa because more than a 2.0 channel setup is broken with pulseaudio.

Comment 1 Martin Wolf 2020-06-18 01:21:43 UTC
I think I have the same bug. I reverted to 1.2.3-2 and it is functional again.

With 1.2.3-8 pulseaudio crashed:
Process 5296 (pulseaudio) of user 0 dumped core.

Stack trace of thread 5296:
#0  0x00007fb3f9c90a25 raise (libc.so.6 + 0x3ca25)
#1  0x00007fb3f9c79895 abort (libc.so.6 + 0x25895)
#2  0x00007fb3f9cd48c7 __libc_message (libc.so.6 + 0x808c7)
#3  0x00007fb3f9cdbdec malloc_printerr (libc.so.6 + 0x87dec)
#4  0x00007fb3f9cdd0f5 _int_free (libc.so.6 + 0x890f5)
#5  0x00007fb3e8241061 snd1_dlobj_cache_cleanup (libasound.so.2 + 0x3f061)
#6  0x00007fb3e823940c snd_config_update_free_global (libasound.so.2 + 0x3740c)
#7  0x00007fb3e83c335f module_alsa_card_LTX_pa__init (module-alsa-card.so + 0x535f)
#8  0x00007fb3fa09d591 pa_module_load (libpulsecore-13.99.so + 0x33591)
#9  0x00007fb3e83cc4a3 verify_access (module-udev-detect.so + 0x34a3)
#10 0x00007fb3e83cd4e3 module_udev_detect_LTX_pa__init (module-udev-detect.so + 0x44e3)
#11 0x00007fb3fa09d591 pa_module_load (libpulsecore-13.99.so + 0x33591)
#12 0x00007fb3fa089324 pa_cli_command_load (libpulsecore-13.99.so + 0x1f324)
#13 0x00007fb3fa09133a pa_cli_command_execute_line_stateful (libpulsecore-13.99.so + 0x2733a)
#14 0x00007fb3fa091af9 pa_cli_command_execute_file_stream (libpulsecore-13.99.so + 0x27af9)
#15 0x0000563373b32224 main (pulseaudio + 0x8224)
#16 0x00007fb3f9c7b042 __libc_start_main (libc.so.6 + 0x27042)
#17 0x0000563373b32f9e _start (pulseaudio + 0x8f9e)

Stack trace of thread 5304:
#0  0x00007fb3f9d4ac6e ppoll (libc.so.6 + 0xf6c6e)
#1  0x00007fb3fa0a7304 pa_rtpoll_run (libpulsecore-13.99.so + 0x3d304)
#2  0x00007fb3e8358b4d thread_func (libalsa-util.so + 0x30b4d)
#3  0x00007fb3f9fc35ac internal_thread_func (libpulsecommon-13.99.so + 0x595ac)
#4  0x00007fb3f9e2e432 start_thread (libpthread.so.0 + 0x9432)
#5  0x00007fb3f9d559d3 __clone (libc.so.6 + 0x1019d3)

Stack trace of thread 5303:
#0  0x00007fb3f9d4ac6e ppoll (libc.so.6 + 0xf6c6e)
#1  0x00007fb3fa0a7304 pa_rtpoll_run (libpulsecore-13.99.so + 0x3d304)
#2  0x00007fb3e8358b4d thread_func (libalsa-util.so + 0x30b4d)
#3  0x00007fb3f9fc35ac internal_thread_func (libpulsecommon-13.99.so + 0x595ac)
#4  0x00007fb3f9e2e432 start_thread (libpthread.so.0 + 0x9432)
#5  0x00007fb3f9d559d3 __clone (libc.so.6 + 0x1019d3)

Stack trace of thread 5305:
#0  0x00007fb3f9d4ac6e ppoll (libc.so.6 + 0xf6c6e)
#1  0x00007fb3fa0a7304 pa_rtpoll_run (libpulsecore-13.99.so + 0x3d304)
#2  0x00007fb3e8358b4d thread_func (libalsa-util.so + 0x30b4d)
#3  0x00007fb3f9fc35ac internal_thread_func (libpulsecommon-13.99.so + 0x595ac)
#4  0x00007fb3f9e2e432 start_thread (libpthread.so.0 + 0x9432)
#5  0x00007fb3f9d559d3 __clone (libc.so.6 + 0x1019d3)

Stack trace of thread 5306:
#0  0x00007fb3f9d4ac6e ppoll (libc.so.6 + 0xf6c6e)
#1  0x00007fb3fa0a7304 pa_rtpoll_run (libpulsecore-13.99.so + 0x3d304)
#2  0x00007fb3e835f915 thread_func (libalsa-util.so + 0x37915)
#3  0x00007fb3f9fc35ac internal_thread_func (libpulsecommon-13.99.so + 0x595ac)
#4  0x00007fb3f9e2e432 start_thread (libpthread.so.0 + 0x9432)
#5  0x00007fb3f9d559d3 __clone (libc.so.6 + 0x1019d3)

Comment 2 Jaroslav Kysela 2020-06-18 06:45:37 UTC
Thanks Martin. I see the problem now. Upstream fix: https://github.com/alsa-project/alsa-lib/commit/20e003a63d14edabd59e40e5d0b8ed2f11f8c9b8

Comment 3 Jaroslav Kysela 2020-06-18 06:49:16 UTC

*** This bug has been marked as a duplicate of bug 1846742 ***

Comment 4 Wolfgang Ulbrich 2020-06-18 08:32:21 UTC
Sorry, i tried your commit, but it doesn't fix my original reported problem from https://bugzilla.redhat.com/show_bug.cgi?id=1847508

"No sound with Creative Soundblaster Z since update to alsa-lib-1.2.3-8"

I don't use pulseaudio, because pulseaudio doesn't support more than a 2.0 channel setup with my card, and my card is a middle-highend PCIe card and an usb one.

So, my report wasn't about crashing pulsaudio, sadly another user wrote his pulseaudio problems here!!!

Why did you close https://bugzilla.redhat.com/show_bug.cgi?id=1847508 ?

I am happy to give more information to debug, but please ask me.

Comment 5 Jaroslav Kysela 2020-06-18 08:39:02 UTC
Sorry, my fault (marking this bug a the duplicate of another not relevant). The trace in comment #1 was helpful to fix that another bug.

Could you attach working / non-working output from 'alsa-info.sh --no-upload'? Thank you.

Comment 6 Wolfgang Ulbrich 2020-06-18 08:53:37 UTC
Created attachment 1697918 [details]
alsa-info working

Comment 7 Wolfgang Ulbrich 2020-06-18 08:54:16 UTC
Created attachment 1697919 [details]
alsa-info non-working

Comment 8 Wolfgang Ulbrich 2020-06-18 08:55:25 UTC
Created attachment 1697921 [details]
alsa-info diff between good and bad

Comment 9 Wolfgang Ulbrich 2020-06-18 08:58:39 UTC
Thank you, i made a diff between both alsa-info.

Stream and channel map are broken :/

-  Converter: stream=5, channel=0
+  Converter: stream=0, channel=0

 		iface PCM
 		name 'Playback Channel Map'
-		value.0 3
-		value.1 4
-		value.2 7
-		value.3 8
-		value.4 5
-		value.5 6
+		value.0 0
+		value.1 0
+		value.2 0
+		value.3 0
+		value.4 0
+		value.5 0

I saw that you changed something with PCM in your rpm.

Comment 10 Jaroslav Kysela 2020-06-18 09:07:18 UTC
Could you try to revert this commit?

  commit 3b46b03f099da2f39c205a25b3cc62ec688fe6b3
  Author: Jonas Holmberg <jonashg>
  Date:   Tue Mar 31 17:09:25 2020 +0200

    pcm: add chmap option to route plugin
    
    Add a config definition "chmap" to override the channel maps in the same
    way as in the hw and null plugins.
    
    Signed-off-by: Jonas Holmberg <jonashg>
    Signed-off-by: Takashi Iwai <tiwai>

Comment 11 Wolfgang Ulbrich 2020-06-18 09:43:56 UTC
It helps to restore origin alsa-info, but sound is silent.

Node 0x02 [Audio Output] wcaps 0x49d: Stereo Amp-Out
  Control: name="Front Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Device: name="CA0132 Analog", type="Audio", device=0
  Amp-Out caps: ofs=0x5a, nsteps=0x63, stepsize=0x03, mute=1
  Amp-Out vals:  [0x4f 0x46]
  Converter: stream=5, channel=0
  PCM:
    rates [0x5e4]: 16000 44100 48000 88200 96000 192000
    bits [0xa]: 16 24
    formats [0x1]: PCM


**** List of PLAYBACK Hardware Devices ****
card 0: Creative [HDA Creative], device 0: CA0132 Analog [CA0132 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0




	control.55 {
		iface PCM
		name 'Playback Channel Map'
		value.0 3
		value.1 4
		value.2 7
		value.3 8
		value.4 5
		value.5 6
		comment {
			access read
			type INTEGER
			count 6
			range '0 - 36'
		}
	}

What i did?
I simply added both new patches to your SRPM.

Patch0:   alsa-git.patch
Patch1:   alsa-lib-1.2.3-config.patch
Patch2:   alsa-lib-1.0.14-glibc-open.patch
Patch3:   alsa-lib_fix-the-race-when-snd_libdir_origin-is-freed-v2.patch
Patch4:   alsa-lib_0001-Revert-pcm-add-chmap-option-to-route-plugin.patch

%prep
%setup -q -n %{name}-%{version}%{?prever}%{?postver}
%patch0 -p1 -b .alsa-git
%patch1 -p1 -b .config
%patch2 -p1 -b .glibc-open
%patch3 -p1 -b .fix-the-race
%patch4 -p1 -b .Revert-pcm

Comment 12 Wolfgang Ulbrich 2020-06-18 09:44:58 UTC
Created attachment 1697932 [details]
als-info non working with both patches

Comment 13 Wolfgang Ulbrich 2020-06-18 09:46:39 UTC
Note, there isn't any new different between `alsa-info working` and `alsa-info non working with both patches`

Comment 14 Jaroslav Kysela 2020-06-18 09:59:15 UTC
Could you move to working alsa-lib in the system and compile the test alsa-lib outside?

The alsa-lib git tree is on github: https://github.com/alsa-project/alsa-lib , just clone it and do './gitcompile' in the cloned directory.
Then clone and compile (./gitcompile) also alsa-utils: https://github.com/alsa-project/alsa-utils .

From this point, you can do tests with aplay from the compiled alsautils:

  $ cd alsa-utils/aplay
  $ .. modify go.sh for your paths to self-compiled alsa-lib..
  $ ./go.sh <aplay_arguments>

If the problem is visible also with this test bed, you can easily do 'git bisect' in the alsa-lib tree (don't forgot to recompile the library after each iteration).

Comment 15 Wolfgang Ulbrich 2020-06-18 10:42:08 UTC
Jaroslaw,
i don't find this path/binary in self compiled alsa-utils

ALSA_CONFIG_UCM2="$HOME/alsa/alsa-ucm-conf/ucm2" \


[rave@mother alsa-utils-test]$ ls -l alsaucm/ |grep ucm
-rwxrwxr-x 1 rave rave 86192 18. Jun 12:21 alsaucm
-rw-rw-r-- 1 rave rave  5931 18. Jun 12:14 alsaucm.rst

I am happy to biscet the issue when get this config working for aplay.

Comment 16 Wolfgang Ulbrich 2020-06-18 11:23:39 UTC
Ok, ucm configs are in extra source ftp://ftp.alsa-project.org/pub/lib/alsa-ucm-conf-%{version_alsa_ucm}.tar.bz2

Than i can simply use system dir.

Comment 17 Wolfgang Ulbrich 2020-06-18 12:15:32 UTC
I don't understand how to use ./go.sh together with aplay to play a file?

And it seems that go.sh use alsaucm and not aplay.

[rave@mother alsaucm]$ ./go.sh -h
Usage: ./alsaucm <options> [command]

Available options:
  -h,--help                  this help
  -c,--card NAME             open card NAME
  -i,--interactive           interactive mode
  -b,--batch FILE            batch mode (use '-' for the stdin input)
  -n,--no-open               do not open first card found

Available commands:
  open NAME                  open card NAME
  reset                      reset sound card to default state
  reload                     reload configuration
  listcards                  list available cards
  dump FORMAT                dump all config information (format: text,json)
  list IDENTIFIER            list command, for items with value + comment
  list1 IDENTIFIER           list command, for items without comments
  get IDENTIFIER             get string value
  geti IDENTIFIER            get integer value
  set IDENTIFIER VALUE       set string value
  h,help                     help
  q,quit                     quit

 Performance counter stats for './alsaucm -h':

              1,05 msec task-clock:u              #    0,692 CPUs utilized          
                 0      context-switches:u        #    0,000 K/sec                  
                 0      cpu-migrations:u          #    0,000 K/sec                  
                95      page-faults:u             #    0,091 M/sec                  
           615.923      cycles:u                  #    0,587 GHz                      (88,65%)
            31.115      stalled-cycles-frontend:u #    5,05% frontend cycles idle   
           144.259      stalled-cycles-backend:u  #   23,42% backend cycles idle    
           535.653      instructions:u            #    0,87  insn per cycle         
                                                  #    0,27  stalled cycles per insn
           107.514      branches:u                #  102,551 M/sec                  
                 0      branch-misses:u           #    0,00% of all branches          (11,35%)

       0,001515037 seconds time elapsed

       0,000000000 seconds user
       0,001516000 seconds sys


What should i do?

Comment 18 Wolfgang Ulbrich 2020-06-18 12:24:12 UTC
Ok, i just creste a new go.sh for aplay 

```
#!/bin/bash

#GDB="gdb --args"
#GDB="strace"
#GDB="valgrind --leak-check=yes --show-reachable=yes"
GDB="perf stat"

#ALSA_CONFIG_UCM="$HOME/alsa/alsa-ucm-conf/ucm" \
ALSA_CONFIG_UCM2="/usr/share/alsa/ucm2" \
LD_PRELOAD="/media/Data/Programme/Linux/Mate-Desktop/git-version/others/alsa-lib-test/src/.libs/libasound.so" \
$GDB ./aplay "$@"
```
gives me no sound with current master of alsa-lib.

```
rave@mother aplay]$ ./go.sh 04_Thinking_Of_You_\(Remastered\).wav 
Playing WAVE '04_Thinking_Of_You_(Remastered).wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
aplay: set_params:1407: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 44100
PERIOD_TIME: (21333 21334)
PERIOD_SIZE: (940 941)
PERIOD_BYTES: (3760 3764)
PERIODS: (3 5)
BUFFER_TIME: (85328 85329)
BUFFER_SIZE: 3763
BUFFER_BYTES: 15052
TICK_TIME: 0

 Performance counter stats for './aplay 04_Thinking_Of_You_(Remastered).wav':

              7.20 msec task-clock:u              #    0.098 CPUs utilized          
                 0      context-switches:u        #    0.000 K/sec                  
                 0      cpu-migrations:u          #    0.000 K/sec                  
               172      page-faults:u             #    0.024 M/sec                  
           2799945      cycles:u                  #    0.389 GHz                      (86.12%)
            148956      stalled-cycles-frontend:u #    5.32% frontend cycles idle     (86.07%)
            520599      stalled-cycles-backend:u  #   18.59% backend cycles idle      (75.72%)
           4951211      instructions:u            #    1.77  insn per cycle         
                                                  #    0.11  stalled cycles per insn  (81.55%)
           1186202      branches:u                #  164.726 M/sec                    (84.57%)
             34325      branch-misses:u           #    2.89% of all branches          (85.98%)

       0.073188906 seconds time elapsed

       0.003233000 seconds user
       0.004346000 seconds sys
```

Not sure if that usage is correct?

Comment 19 Jaroslav Kysela 2020-06-18 12:54:56 UTC
I forgot that I have go.sh only in my tree for aplay. Anyway, the alsaucm version is almost identical.

Ok, you may comment out the line:

# GDB="perf stat"

Also verify if your aplay direct command (without go.sh) works with the older version of alsa-lib: aplay 04_Thinking_Of_You_(Remastered).wav

If it works with the old alsa-lib version, then try to bisect alsa-lib to the commit which cause this failure.

Thank you for your patience.

Comment 20 Wolfgang Ulbrich 2020-06-18 13:14:02 UTC
I just found the culprit:

d12df1dc9c095bcb52d104e5a39043b56424e9d2 is the first bad commit
commit d12df1dc9c095bcb52d104e5a39043b56424e9d2
Author: sylvain.bertrand <sylvain.bertrand>
Date:   Wed Apr 15 00:44:39 2020 +0000

    pcm: dmix: fix sw_params handling of timestamp types in direct plugins
    
    In pcms using direct plugins (dmix/dsnoop/dshare), the timestamp type could
    be different from the terminating hw plugin, then the kernel driver.
    
    Be sure such pcms have plugins using consistently the same timestamp type.
    
    signed-off-by: Sylvain Bertrand <sylvain.bertrand>
    Signed-off-by: Takashi Iwai <tiwai>

 src/conf/alsa.conf       |  1 +
 src/conf/pcm/dmix.conf   |  4 ++++
 src/conf/pcm/dsnoop.conf |  4 ++++
 src/pcm/pcm_direct.c     | 36 +++++++++++++++++++++++++++++++++++-
 src/pcm/pcm_direct.h     |  2 ++
 src/pcm/pcm_dmix.c       |  4 ++++
 src/pcm/pcm_dshare.c     |  4 ++++
 src/pcm/pcm_dsnoop.c     |  4 ++++
 src/pcm/pcm_local.h      |  2 ++
 9 files changed, 60 insertions(+), 1 deletion(-)

When reverting d12df1dc9c095bcb52d104e5a39043b56424e9d2 i have sound with `./go.sh 04_Thinking_Of_You_\(Remastered\).wav` :)


[rave@mother alsa-lib-test]$ git log
commit 6eea66b0ed58126a5ecc16c87d442399a6867b46 (HEAD -> master)
Author: raveit65 <mate>
Date:   Thu Jun 18 15:00:26 2020 +0200

    Revert "pcm: dmix: fix sw_params handling of timestamp types in direct plugins"
    
    This reverts commit d12df1dc9c095bcb52d104e5a39043b56424e9d2.

commit 20e003a63d14edabd59e40e5d0b8ed2f11f8c9b8 (origin/master, origin/HEAD)
Author: Jaroslav Kysela <perex>
Date:   Thu Jun 18 08:41:02 2020 +0200

    dlsym: fix the race when snd_libdir_origin is freed
    
    snd_dlobj_cache_cleanup() function frees snd_libdir_origin, but
    the pointer may be used again in snd_dlpath().
    
    BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1847508
    Signed-off-by: Jaroslav Kysela <perex>


I am using dmix and dsnoop in my asound.conf. Do i have to update my config (and what?) or is this commit simply buggy?

Comment 21 Jaroslav Kysela 2020-06-18 14:47:26 UTC
Could you apply (add) this code and show me the debug aplay prints?

diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c
index 66534095..ad06459e 100644
--- a/src/pcm/pcm_direct.c
+++ b/src/pcm/pcm_direct.c
@@ -997,6 +997,7 @@ int snd_pcm_direct_hw_free(snd_pcm_t *pcm ATTRIBUTE_UNUSED)
 
 int snd_pcm_direct_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t *params)
 {
+       printf("sw_params: new tstamp type %d old %d\n", params->tstamp_type, pcm->tstamp_type);
        if (params->tstamp_type != pcm->tstamp_type)
                return -EINVAL;
 
@@ -1325,6 +1326,7 @@ int snd_pcm_direct_initialize_slave(snd_pcm_direct_t *dmix, snd_pcm_t *spcm, str
                return ret;
        }
 
+       printf("init tstamp type: %d\n", dmix->tstamp_type);
        if (dmix->tstamp_type != -1) {
                ret = snd_pcm_sw_params_set_tstamp_type(spcm, &sw_params,
                                                        dmix->tstamp_type);

Comment 22 Wolfgang Ulbrich 2020-06-18 14:56:41 UTC
With (for me) non working master?

Comment 23 Jaroslav Kysela 2020-06-18 15:09:45 UTC
Yes, without the revert.

Comment 24 Wolfgang Ulbrich 2020-06-18 15:58:27 UTC
Here we go.
```
[rave@mother aplay]$ LANG=C
[rave@mother aplay]$ ./go.sh 04_Thinking_Of_You_\(Remastered\).wav
init tstamp type: -1
Playing WAVE '04_Thinking_Of_You_(Remastered).wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
sw_params: new tstamp type 1 old 1
sw_params: new tstamp type 0 old 1
aplay: set_params:1407: Unable to install hw params:

<cut>
```

Comment 25 Jaroslav Kysela 2020-06-18 16:45:54 UTC
The problem seems that you're using external upmix plugin. It defaults to GETTIMEOFDAY timestamp. You can add 'tstamp_type gettimeofday' line to your dmix config as workaround. We should fix the automatic selection.

Comment 26 Wolfgang Ulbrich 2020-06-18 17:07:53 UTC
Like this ?

pcm.dmix51 {
	type dmix
	ipc_key 1024
        tstamp_type gettimeofday
	slave {
		pcm "creative"
		channels 6
		rate 48000
		period_time 0		# Fixes audio crackling/stutter
		period_size 1024	# with libsamplerate and chromium.
		buffer_time 0		# Not all options may be
		buffer_size 4096	# absolutely necessary.
	}
}

..... i am not very good with setting up alsa. I was so happy to get my config ready for this lovely card, which is much better than every realtek onboard solution.

Comment 27 Wolfgang Ulbrich 2020-06-18 17:12:40 UTC
Thanks a lot for help.
It works :)

```
[rave@mother aplay]$ ./go.sh 04_Thinking_Of_You_\(Remastered\).wav
init tstamp type: 0
Playing WAVE '04_Thinking_Of_You_(Remastered).wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
sw_params: new tstamp type 0 old 0
sw_params: new tstamp type 0 old 0
sw_params: new tstamp type 0 old 0
sw_params: new tstamp type 0 old 0
sw_params: new tstamp type 0 old 0
```

Now , i will try it out with alsa-lib-1.2.3.8 as system config.

Comment 28 Wolfgang Ulbrich 2020-06-18 17:19:19 UTC
With this new config option i have sound with alsa-lib-1.2.3-8.fc32.x86_64 from stable repo.

Up to you if you want to close report or fixing automatic selection before.
I am happy now :)

Thanks again.

Comment 29 Jaroslav Kysela 2020-06-18 17:22:30 UTC
This one line fix should definitely resolve the problem for the default case (without the workaround in asoundrc):

  https://github.com/alsa-project/alsa-lib/commit/7cf0fb693ae016d392f0aaf36f162fd35570feec

I will release new Fedora package ASAP (keep this bug open until the fedora update system close this bug).

Thank you for your co-operation and patience when you debugged this issue with me. I very appreciate that.

Comment 30 Fedora Update System 2020-06-18 19:10:53 UTC
FEDORA-2020-f38d4b2eab has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-f38d4b2eab

Comment 31 Fedora Update System 2020-06-19 21:55:39 UTC
FEDORA-2020-f38d4b2eab has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-f38d4b2eab`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-f38d4b2eab

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 32 Fedora Update System 2020-06-22 08:10:16 UTC
FEDORA-2020-f38d4b2eab has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.