Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Bad music quality in audio players
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
mvlabat
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jan 2014
Posts: 82

PostPosted: Fri Nov 14, 2014 2:36 pm    Post subject: [SOLVED] Bad music quality in audio players Reply with quote

Greetings.

I have a bad quality of audio when listening to the music in different KDE players. I've tried JuK and Amarok. Some noise can be heard when there is some kind of high frequency sound, women voice or some specific instruments for instance. But when I listen to the music (the same music, by the way) in Google Chrome I don't have such a problem. Seems like audio players and web browsers use different plugins/drivers or something like this.

I have "HDA Intel PCH (ALC282 Analog)" audio device, my kernel is "linux-3.13.5"

Can this problem be solved and what way? Thank you


Last edited by mvlabat on Thu Nov 20, 2014 4:27 pm; edited 1 time in total
Back to top
View user's profile Send private message
atemv
n00b
n00b


Joined: 09 Aug 2014
Posts: 63

PostPosted: Fri Nov 14, 2014 7:44 pm    Post subject: Reply with quote

Hello

I also had problem with Amarok, however a bit different: .flac playings lagged. I solved it with set the

Code:
-> Device Drivers                                                                                        │ 
  │       -> Sound card support (SOUND [=y])                                                                     │ 
  │         -> Advanced Linux Sound Architecture (SND [=y])                                                      │ 
  │           -> PCI sound devices (SND_PCI [=y])
                 -> Pre-allocated buffer size for HD-audio driver


from 64 to 4096 (2048 also should be enough)

However you do not have to reconfigure and recompile your kernel to change it. It can be changed in runtime with

echo 4096 > proc/asound/card*/pcm*/sub*/prealloc

Hope it helps.
Back to top
View user's profile Send private message
mvlabat
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jan 2014
Posts: 82

PostPosted: Tue Nov 18, 2014 1:56 pm    Post subject: Reply with quote

Thank you for your guess. Unfortunately that didn't help. (

Also I have an issue that google chrome and any player can't play sound together. If a player is running then google chrome stops playing everything: music, video.. (Tested only with HTML5 players in google chrome, but flash is not actual nowadays.)
Back to top
View user's profile Send private message
Dorsai!
Apprentice
Apprentice


Joined: 27 Jul 2008
Posts: 285
Location: Bavaria

PostPosted: Tue Nov 18, 2014 3:35 pm    Post subject: Reply with quote

It seems that somehow your dmix isn't doing its job properly or you are accessing your hardware device directly.

Things you can post to help us find the problem:

if you have any of those files:
# cat /etc/asound.conf
or # cat ~/.asoundrc

#aplay -L
#aplay -l
Back to top
View user's profile Send private message
mvlabat
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jan 2014
Posts: 82

PostPosted: Tue Nov 18, 2014 4:53 pm    Post subject: Reply with quote

Code:
cat ~/.asoundrc
defaults.pcm.!card PCH
defaults.pcm.!device 0


Recently I have had my .asoundrc in /root/ directory. After moving it to my user's home directory I got a strange bug. Now sound playing starts working only when I replug my headphones. Didn't noticed it before when I contained the file in the /root/ directory. Now this strange behavior is also when I change it back. Can't detect any relation

Code:
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC282 Analog [ALC282 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0


Thank you
Back to top
View user's profile Send private message
Dorsai!
Apprentice
Apprentice


Joined: 27 Jul 2008
Posts: 285
Location: Bavaria

PostPosted: Tue Nov 18, 2014 8:39 pm    Post subject: Reply with quote

Ok, with this in ~/.asoundrc you are accessing your device directly without samplerate conversion or software mixing. I think what you need is the "plug" plugin and the "dmix" plugin.

ALSA today defaults to software mixing multiple streams/applications but you are circumventing this by setting a raw "hw" type device directly.

Also if you want a global config put it in /etc/asound.conf instead of /root/.asoundrc. The latter would only work for programs started as root. From my experience global configuration is preferable because sometimes you have daemons run as other users that want to output sound (mpd for exampe). And if you put it in /etc/asound.conf, dont forget to delete your ~/.asoundrc because local config has priority over the global config.

Now for Dmix you should ask google about all the configuration options. From what I can see your config should look something like this:

Code:

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

pcm.dmixer  {
    type dmix
    ipc_key 1024
    slave {
      pcm "hw:PCH,0"
      period_time 0
      period_size 1024
      buffer_size 4096
      rate 44100
   }
}

ctl.dmixer {
   type hw
   card 1
}

This might already work well enough. If not, for more information see the alsa documentation.
Back to top
View user's profile Send private message
mvlabat
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jan 2014
Posts: 82

PostPosted: Wed Nov 19, 2014 2:58 pm    Post subject: Reply with quote

I've installed plugins and applied your configuration... Everything stays as it was before.

Code:
USE="plug dmix" emerge alsa-plugins


There is still bad quality sound in all the players (JuK, Amarok) except Google Chrome and the sound still conflicts: all KDE applications (including system ones of its) except the browser can't live together.
Back to top
View user's profile Send private message
skunk
l33t
l33t


Joined: 28 May 2003
Posts: 646
Location: granada, spain

PostPosted: Thu Nov 20, 2014 1:04 am    Post subject: Reply with quote

are you using gstreamer as phonon backend? switch to vlc...
Back to top
View user's profile Send private message
mvlabat
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jan 2014
Posts: 82

PostPosted: Thu Nov 20, 2014 4:27 pm    Post subject: Reply with quote

Haha! :D I had VLC installed but after switching to GStreamer the sound quality became excellent )) It's something unusual...
Thank you actually that you made me to google about this thing and to learn it. Didn't have any mention what phonon is.

The problem that still remains is that Google Chrome and other players can't "sign" together. But I think it would be preferable to start a new thread.
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