Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
AMD Azalia soundcard - random blocking
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Havin_it
Veteran
Veteran


Joined: 17 Jul 2005
Posts: 1170
Location: Edinburgh, UK

PostPosted: Sat Jan 11, 2014 3:42 pm    Post subject: AMD Azalia soundcard - random blocking Reply with quote

Hi,

I've had this problem since I put Gentoo on my new notebook (HP Pavilion dm1-4400sa) early last year. It has the following audio hardware:
Code:
00:01.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Wrestler HDMI Audio
        Subsystem: Hewlett-Packard Company Device 18d4
        Kernel driver in use: snd_hda_intel
        Kernel modules: snd_hda_intel
--SNIP--
00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD] FCH Azalia Controller (rev 01)
        Subsystem: Hewlett-Packard Company Device 18d4
        Kernel driver in use: snd_hda_intel
        Kernel modules: snd_hda_intel


I don't have any HDMI hardware so I just use the Azalia card to output to the builtin speakers. For ALSA to choose it as default I added this to /etc/asound.conf:
Code:
pcm.!default {
        type hw
        card Generic_1
}

ctl.!default {
        type hw
        card Generic_1
}

I think my alsa setup is otherwise totally vanilla - I'v taken no other special steps.

Some of the time this works fine, although KDE seems to still often get confused about which device it should use (think I've just about conquered that one now). However, very often the device blocks hard and deadlocks the process trying to use it, usually for about 5 minutes or more. This can happen when playing video or audio in mplayer or VLC, or just when adjusting the volume with kmix. I think starting/stopping of the alsasound initscript may have been caught by it sometimes too.

It's been a long time since I debugged soundcard problems (in fact I never really had one this severe before) and I know that a lot of the alsa documentation is a bit outdated, so I'm not even sure what other info would be useful, but I'm happy to dish it up on request.

Thanks in advance for any suggestions on how to start digging into this.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sat Jan 11, 2014 4:02 pm    Post subject: Re: AMD Azalia soundcard - random blocking Reply with quote

Havin_it wrote:
pcm.!default {
type hw

That redefines PCM "default" to use hardware, rather than go through dmix. You probably want to remove your custom ~/.asoundrc, and use another method of selecting the default card.
_________________
Improve your font rendering and ALSA sound
Back to top
View user's profile Send private message
Havin_it
Veteran
Veteran


Joined: 17 Jul 2005
Posts: 1170
Location: Edinburgh, UK

PostPosted: Sun Jan 12, 2014 11:43 am    Post subject: Reply with quote

Hi Paul, thanks for the reply.

Things must have changed at some point, because the "Generic_1" soundcard is still picked as default (aplay -l output remains the same) having commented-out my alsa.conf file.

However, audio is now exhibiting a variety of problems:

  • Using aplay or mplayer to play a short 44100Hz wav file (/usr/share/sounds/pop.wav), it loops a short chunk (sub-1sec) endlessly and doesn't exit without Ctrl+C.
  • With aplay and a 48000Hz wav file (/usr/share/sounds/alsa/Front_Right.wav), the audio loop continues after aplay exits, but playing some other audio afterwards will clear it.
  • Using mplayer to play a compressed audio (ogg) or video (mp4/wmv) file, it plays normally to the end but fails to exit; Ctrl+C x2 required.
  • While playing video files with mplayer, if the volume is changed (using kmix shortcut keys) the video pauses accompanied by the same short looped chunk of audio for a few seconds before resuming.


Here's the output of aplay on the 44100Hz wav file:
Code:
robin@happy ~ $ aplay -vv /usr/share/sounds/pop.wav
Playing WAVE '/usr/share/sounds/pop.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
Plug PCM: Rate conversion PCM (48000, sformat=S16_LE)
Converter: linear-interpolation
Protocol version: 10002
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 1
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 16
  buffer_size  : 15052
  period_size  : 940
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 940
  period_event : 0
  start_threshold  : 15052
  stop_threshold   : 15052
  silence_threshold: 0
  silence_size : 0
  boundary     : 4236761349448794112
Slave: Route conversion PCM (sformat=S32_LE)
  Transformation table:
    0 <- 0
    1 <- 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 1
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 16
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 16384
  stop_threshold   : 16384
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
Slave: Soft volume PCM
Control: PCM Playback Volume
min_dB: -51
max_dB: 0
resolution: 256
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 16384
  stop_threshold   : 16384
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
Slave: Direct Stream Mixing PCM
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 16384
  stop_threshold   : 16384
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
Hardware PCM card 0 'HD-Audio Generic' device 0 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : ENABLE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 0
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
  appl_ptr     : 0
  hw_ptr       : 5286466
###                                               +| 99%^C
Aborted by signal Interrupt...


...and for the 48000Hz file:
Code:
robin@happy ~ $ aplay -vv /usr/share/sounds/alsa/Front_Right.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Right.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
Plug PCM: Route conversion PCM (sformat=S32_LE)
  Transformation table:
    0 <- 0
    1 <- 0
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 1
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 16
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 16384
  stop_threshold   : 16384
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
Slave: Soft volume PCM
Control: PCM Playback Volume
min_dB: -51
max_dB: 0
resolution: 256
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 16384
  stop_threshold   : 16384
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
Slave: Direct Stream Mixing PCM
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 16384
  stop_threshold   : 16384
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
Hardware PCM card 0 'HD-Audio Generic' device 0 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 16384
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : ENABLE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 0
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
  appl_ptr     : 0
  hw_ptr       : 5804343
#######                   +                        | 50%^C
Aborted by signal Interrupt...
aplay: pcm_write:1939: write error: Interrupted system call
Back to top
View user's profile Send private message
Havin_it
Veteran
Veteran


Joined: 17 Jul 2005
Posts: 1170
Location: Edinburgh, UK

PostPosted: Sun Jan 12, 2014 5:41 pm    Post subject: Reply with quote

I seem to have resolved this in an unexpected manner: I looked at the module options for snd_hda_intel and tried a few tweaks in /etc/modprobe.d/alsa.conf. What works is:
Code:

#SNIPPED all the gibberish about aliases etc

#The next 2 directives were already there

# Set this to the correct number of cards.
options snd cards_limit=2

options snd_hda_intel index=1

#This is what I added
options snd_hda_intel enable_msi=1


No idea why I expected MSI to help matters -- it usually seems to be causing problems in Linux-land -- but after enabling this, there seem to be no issues with playback on the analogue soundcard.

Not sure I trust it yet :roll: but will mark SOLVED after a bit more testing.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum