Bug 209281 - AE-7 ALSA no 5.1 sound, 2.0 buggy
Summary: AE-7 ALSA no 5.1 sound, 2.0 buggy
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(ALSA) (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Jaroslav Kysela
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-15 18:55 UTC by bednarczyk.pawel
Modified: 2020-12-11 10:00 UTC (History)
2 users (show)

See Also:
Kernel Version: 5.9.0-rc5-next-20200915-1-next-git
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description bednarczyk.pawel 2020-09-15 18:55:48 UTC
As of a roughly two weeks ago, the linux next kernel supports the AE-7 Sound blaster PCI-E sound card: https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/log/?h=for-next
I have compiled linux-next, the card is recognized and I can even select the preferred profile for the card in KDE sound settings but sadly there is no sound playing if I select 5.1 as the output configuration. It seems to work ok-ish* if I select 2.0.


I reported this originally to PulseAudio, but the folks over there think it's an ALSA issue. 


Here is the thread: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/977


There are a lot of logs there. 


speaker-test -D plug:front:0 --channels=2 -t wav 
speaker-test -D plug:surround51:0 --channels=6 -t wav

both produce the same error:

Playback device is plug:surround51:0
Stream parameters are 48000Hz, S16_LE, 6 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 64 to 8544000
Period size range from 32 to 4272000
Using max buffer size 8544000
Periods = 4
Unable to set hw params for playback: Cannot allocate memory
Setting of hwparams failed: Cannot allocate memory



*audio randomly disappears
Comment 1 Takashi Iwai 2020-12-08 14:32:09 UTC
The speaker-test issue is because your kernel config.  Set CONFIG_SND_HDA_PREALLOC_SIZE to be non-zero, e.g. 2048.
Zero means unlimited, so speaker-test tries to allocate too much memory.
Comment 2 Connor McAdams 2020-12-08 20:41:48 UTC
Within alsamixer, do you have the `Surround Channel Config` option set to 5.1? Also, make sure the `Output Select` control is set to Speaker, and `HP/Speaker Auto-detect` is unset.
Comment 3 bednarczyk.pawel 2020-12-08 21:39:33 UTC
Hi,

Thanks for looking into this. I have since updated the config to now say CONFIG_SND_HDA_PREALLOC_SIZE=4096b.

Connor,

I have Surround Channel Config set to 5.1 indeed. Output Select is set up to speaker and HP/Speaker auto detect is set to 'MM' (off)

However, after I restart my PC the settings get reset to:

Surround Channel Config - 2.0
Output Select: Speakers
HP/Speaker auto detect (OFF)

If I select the 5.1 profile in pulse audio, the system immediately switches to another sound card completely and as a result there is no sound at all. I can only select these profiles:

Analog Stereo Output
Analog Stereo Duplex


and I do hear sound. Sometimes it abruptly stops though - no idea why - and I need to kill pulse audio or re-select the Stereo output profile. 

aplay -L does list a 5.1 profile, though!

surround51:CARD=Creative,DEV=0
    HDA Creative, CA0132 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers

I am using the latest linux-next-git on Arch linux and have a 5.1 system (logitech z906)
Comment 4 Connor McAdams 2020-12-08 22:22:33 UTC
Ignoring pulse for a moment, what happens if you kill Pulse, and do:

`speaker-test -c6 -Dsurround51:CARD=Creative,DEV=0` ?

Make sure the surround channels are unmuted in alsamixer, and that the surround config etc is set to 5.1.

Also, might help to make sure the `Enable OutFX` control is disabled as well.
Comment 5 bednarczyk.pawel 2020-12-08 23:08:49 UTC
Hi Connor,

Running this command after killing Pulse and with the alsamixer config as described, I get the following:

> $ speaker-test -c6 -Dsurround51:CARD=Creative,DEV=0                           

speaker-test 1.2.4

Playback device is surround51:CARD=Creative,DEV=0
Stream parameters are 48000Hz, S16_LE, 6 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 64 to 349504
Period size range from 32 to 174752
Using max buffer size 349504
Periods = 4
Unable to set hw params for playback: Invalid argument
Setting of hwparams failed: Invalid argument

The below produces the same error:

speaker-test -c2 -Dfront:CARD=Creative,DEV=0  

speaker-test 1.2.4

Playback device is front:CARD=Creative,DEV=0
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 64 to 1048576
Period size range from 32 to 524288
Using max buffer size 1048576
Periods = 4
Unable to set hw params for playback: Invalid argument
Setting of hwparams failed: Invalid argument




Thanks for your time.
Comment 6 bednarczyk.pawel 2020-12-09 10:10:18 UTC
Also note, using the integrated sound card, the following commands work OK (after killing pulse):

speaker-test -c2 -Dsurround51:CARD=Generic,DEV=0
speaker-test -c6 -Dsurround51:CARD=Generic,DEV=0
Comment 7 Connor McAdams 2020-12-10 03:19:44 UTC
Could you give me the output from the alsa-info script found here? https://www.alsa-project.org/wiki/Help_To_Debug_Intel_HDA

I'm not sure, but it sounds like the card doesn't support certain modes for some reason. I don't have an AE-7 on hand to test with, but the user that sent me the dumps and tested the driver had surround working seemingly without issues.

Without more info, don't really have any ideas..
Comment 8 bednarczyk.pawel 2020-12-11 10:00:39 UTC
Hi Connor,

Thanks again.

See: https://alsa-project.org/db/?f=48b5e569b260157736b6bbc877503572d51209e3

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