Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Alsa, Dmix, Flash and keyboard volume control
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
GTXcube
n00b
n00b


Joined: 05 Apr 2012
Posts: 31

PostPosted: Thu Jan 03, 2013 3:19 pm    Post subject: [Solved] Alsa, Dmix, Flash and keyboard volume control Reply with quote

Hello everybody. I have some problems with those things. I give you an examples.
1. When I start vlc & rhythmbox and then I start firefox with flash player, I can't hear any sound from flash. Sound from rhythmbox and vlc works
2. When I start firefox with 2 flash videos and then I start rhythmbox or vlc, I can hear sound from both vids but I can't hear sound from my player
3. I have some keys to control volume on my keyboard. They works good but not for flash !

This is my /etc/asound.conf file
Code:
pcm.dmixer
{
   type dmix
   slave
   {
      pcm "hw:1,7"
   }
   bindings
   {
      0 0
      1 1
   }
}

pcm.!default
{
   type plug
   slave.pcm dmixer
}

Do you have any ideas ? What else should I post ? Thanks :)


Last edited by GTXcube on Sun Jan 13, 2013 3:51 pm; edited 1 time in total
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Thu Jan 03, 2013 3:58 pm    Post subject: Reply with quote

Hi,
I just come to make a test. I played two Flash videos from Youtube simultaneously, than start Gnome-mplayer with an other video and all of them where earable. According with
Code:
$ aplay -l
**** Liste des Périphériques Matériels PLAYBACK ****
carte 0: pcsp [pcsp], périphérique 0: pcspeaker [pcsp]
  Sous-périphériques: 1/1
  Sous-périphérique #0: subdevice #0
carte 1: HDMI [HDA ATI HDMI], périphérique 3: HDMI 0 [HDMI 0]
  Sous-périphériques: 1/1
  Sous-périphérique #0: subdevice #0
carte 2: Generic [HD-Audio Generic], périphérique 0: STAC92xx Analog [STAC92xx Analog]
  Sous-périphériques: 1/1
  Sous-périphérique #0: subdevice #0


I use card number 2. So my /etc/asound.conf is

pcm.!default {
type hw
card 2
}

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

pcm.dmixer {
type dmix
ipc_key 1024
slave {
channels 6
buffer_size 4096
buffer_time 0
pcm "hw:2,0"
period_size 1024
period_time 0
rate 48000
}
bindings {
0 0
1 1
}
}

ctl.dmixer {
type hw
card 2
}

ctl.!default {
type hw
card 2
}

The 2 in bold tell Alsa to use card number 2. You have to restart all applications after make a change to /etc/asound.conf.
_________________
Paul
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Thu Jan 03, 2013 5:06 pm    Post subject: Reply with quote

Flash does not like low values for period_size and/or buffer_size. Take a look at the sample config in my sig.
_________________
Improve your font rendering and ALSA sound
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Thu Jan 03, 2013 6:21 pm    Post subject: Reply with quote

I haven't remark any problem with my actual asound.conf. I will try to increase the values. What's the best if I am not only using Flash?
_________________
Paul
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Thu Jan 03, 2013 6:36 pm    Post subject: Reply with quote

Logicien wrote:
What's the best if I am not only using Flash?

Whatever works with reasonable latency. The important thing is to be specifying them, so the first app to open the sound device doesn't set weird parameters that the other apps are then forced to use.
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Thu Jan 03, 2013 7:38 pm    Post subject: Reply with quote

Very good. Thank you !
_________________
Paul
Back to top
View user's profile Send private message
GTXcube
n00b
n00b


Joined: 05 Apr 2012
Posts: 31

PostPosted: Fri Jan 04, 2013 1:26 pm    Post subject: Reply with quote

This is my aplay -l
Code:
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0


I use card 1, device 7 si I edited Logicien's asound.conf but always I can't hear sound from flash and some player in the same time and control volume of flash with my keyboard :/
Isn't it because I use HDMI ?
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Sat Jan 05, 2013 4:17 pm    Post subject: Reply with quote

Did youy try card 0?
_________________
Paul
Back to top
View user's profile Send private message
GTXcube
n00b
n00b


Joined: 05 Apr 2012
Posts: 31

PostPosted: Sat Jan 05, 2013 4:37 pm    Post subject: Reply with quote

Card 0 is internal intel audio card on my motherboard and I have HDMI cable to A/V receiver from my nvidia card so I use card 1. I think the problem is in asound.conf but idk where :/
Back to top
View user's profile Send private message
jiaxi
n00b
n00b


Joined: 25 Sep 2012
Posts: 30

PostPosted: Tue Jan 08, 2013 2:08 pm    Post subject: Reply with quote

You can use dmix when you use default params to open audio device. And you canot open audio device use hw:1,7 when you use default params to open audio.
Back to top
View user's profile Send private message
_______0
Guru
Guru


Joined: 15 Oct 2012
Posts: 521

PostPosted: Wed Jan 09, 2013 12:44 pm    Post subject: Reply with quote

PaulBredbury wrote:
Flash does not like low values for period_size and/or buffer_size. Take a look at the sample config in my sig.


Is it possible to find out about sound card's hardware buffer size? Then to work around those values to optimize for the card.

I ask because on another thread I was told that all hardware have buffers in them.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Wed Jan 09, 2013 1:10 pm    Post subject: Reply with quote

_______0 wrote:
optimize for the card

Gotta optimize for the software as well as the hardware, and the fussiness of the user.

So it's more a case of trial and error. I don't know a way of getting the hardware specs.
Back to top
View user's profile Send private message
GTXcube
n00b
n00b


Joined: 05 Apr 2012
Posts: 31

PostPosted: Wed Jan 09, 2013 10:23 pm    Post subject: Reply with quote

So is there any possible way to get software mixing for my hw1,7 ? I think I tried everything I found with google but nothing works

Edit: Ok finally i got it working. I don't understand how but it works. I removed /etc/asound.conf, ~/.asoundrc and then I just selected right audio device in gnome-volume-control but anyway, thanks for all your replies :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia 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