[solved] Default sound device working in KDE but not XFCE

Post here if you are a new Porteus member and you're looking for some help.
Post Reply
Nimtpy
White ninja
White ninja
Posts: 5
Joined: 16 Jul 2012, 03:34
Location: Internet

[solved] Default sound device working in KDE but not XFCE

Post#1 by Nimtpy » 16 Jul 2012, 04:27

Hi there,

I am trying the different porteus 64bit versions to see which is best for me and how to finally install.

So far I much prefer XFCE version but there is one thing that doesn't work for me as it does in KDE.

I have a latop/netbook with amd e450 apu which comes with two sound devices. Unfortunately the default is a useless hdmi audio-out and the second is the actual sound card. This is bad news for live distros becuase I have yet to be successful in manually changing the main audio device without rebooting. However, If I can specifiy the correct device in an application (such as mplayer) then sound works perfectly for that app. This is also the case with both KDE and XFCE versions of porteus.

My issue is regarding the volume buttons and system wide sounds in XFCE.

Firstly, In KDE, if i change the volume hardware device in the GUI options then suddenly, the keyboard volume button works and the sound card becomes the default for all applications. However, in XFCE if I change the retrovol hardware device it just begins to report the settings for my soundcard (with a bunch of new options such as master, mic, headphone, speaker) but apart from this, nothing system-wide is changed. This means that volume keys don't work in XFCE and if I don't specifiy the correct adapter in each program there is no sound available. Pressing mute/unmute continues to toggle the useless hdmi audio out. I have looked for a setting in the GUI options and have tried creating an asound.rc file in both /etc and /home/guest on my XFCE install but on each reboot I am plagued by the hdmi audio out. I also tried changing devices in alsamixer.

the only difference in my test was that the first trial with KDE was run live in ram on a fat partition with no persistence and the second XFCE trial was installed on ext2 partition and is with default persistence (first boot option).


thanks for any help/


PS. first impressions are good so far, the USP for me was threefold - Firstly, the Ootb support for my amd apu and broadcom 4313 wireless card and all sound/hardware buttons (in the KDE version at least, just this niggle with the sound in XFCE though). I also really like the porteus-specific settings - power options, porteus system info these were the most pleasant surprise as this is something I've found lacking in other distros(especially live and portable ones) - I think that this fills a gap and could be certainly flaunted a bit more. Finally the fact that its portable, runs in ram and can boot quickly so i can get a really fast responsive system and not infringe on my laptops default setup.

In retrospect its the specifically portable stuff that represents the best feature for me - the porteus settings and system info, the modular package manager with access to debian and other repos, the massive list of super useful bootcodes - and more ways of installing than I can currently make sense of :D
Last edited by Nimtpy on 20 Jul 2012, 04:25, edited 1 time in total.

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: Default sound device working in KDE but not XFCE

Post#2 by Ahau » 16 Jul 2012, 06:30

Welcome, Nimpty!

I'm glad to hear you like Porteus, and the Xfce edition in particular :)

Getting sound to work out of the box on all systems has been a struggle, and I'm limited in the number of hardware configurations I have available to test (all are single sound card systems).

The keybindings for the laptop volume keys are a custom script that I wrote, which pulls data from retrovol. They should work with the active channel that is selected in retrovol and the active card for alsa. What I don't know is whether or not retrovol will change the active card in alsa (it sounds like it doesn't) since I can't test this for myself.

Please log in to porteus with your default hdmi card and give me the ouput of:
'aplay -l'
'amixer'

then, switch cards in alsamixer (F6), and give me the output of the same commands with the sound card you want to use.

Also, please open the retrovol config window, select your desired sound card and channel, hit 'Apply', and then give me the contents of the file ~/.retrovolrc.

After you switch cards in alsamixer, try running 'alsactl store (assuming you are still using persistently saved changes) and see if that gets your system to use the appropriate sound card on your next reboot.

I know it's a hassle to deal with issues like this and I wish I could just log in to your computer to see what's going on directly...but if you have the patience and willingness to let me bumble through this a little, I'm fairly confident we can get this sorted out (and it will probably help out other users who are experiencing this but haven't reported it).

Thanks!
Please take a look at our online documentation, here. Suggestions are welcome!

Nimtpy
White ninja
White ninja
Posts: 5
Joined: 16 Jul 2012, 03:34
Location: Internet

Re: Default sound device working in KDE but not XFCE

Post#3 by Nimtpy » 16 Jul 2012, 16:41

thanks for your reply Ahau!

I reinstalled the usb and started fresh with persistence to try out your suggestions.

before doing anything:

Code: Select all

 guest@porteus:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: SB [HDA ATI SB], device 0: STAC92xx Analog [STAC92xx Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

guest@porteus:~$ amixer
Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [off]
  
then went into alsa mixer and changed device with f6. However the device doesn't seem to stick and is not applied system wide - the above commands return the exact same results and there is not sound from mplayer or youtube. Going back into alsamixer shows the default card is still the HMDI or 'iec958'. Hotkey act the same.

Code: Select all

guest@porteus:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: SB [HDA ATI SB], device 0: STAC92xx Analog [STAC92xx Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

guest@porteus:~$ amixer
Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [off]
then I went to retrovol config window and changeed card to hw:1

then checked out retrovol.rc which states:

Code: Select all

# Which soundcard to use
#card=hw:0
card=hw:1

now it seems that sound is working a little more. Mplayer will play a video file with audio even though it's pointing to the default sound device in its settings (the default setting). Audacious still reports a mixer error. There is no sound for youtube videos. My hotkeys still only affect the IEC958 HDMI sound device.

............................

Getting frustrated, I gave the asound.conf file another chance (http://www.alsa-project.org/main/index.php/Asoundrc). I put the file in /etc. with the default set as hw:1,0

the results from this were very strange, I now have sound in youtube and mplayer without any messing around. Audacious reports a mixer error still. Hotkey's still don't work but the popup text is now less descriptive (there is less and it appears to be non functional). Also, running 'alsamixer' in terminal fails with an invalid argument now and 'amixer' reports that "amixer: Mixer attach default error: Invalid argument"

I have to go to work now so I can't see this through any further at the moment. If there are any more suggestions though I am willing to listen/

I will probably give the kde version another test eventually (with persistence this time) but it's a pity as I much prefer XFCE and was hoping for a concrete method to get the sound working.

Thanks again!

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: Default sound device working in KDE but not XFCE

Post#4 by Ahau » 16 Jul 2012, 18:36

Thanks, Nimtpy!

Here's a couple more things to try:

From a fresh system once again, open a console and run 'alsaconf'. That should detect both sound cards and allow you to select one. Once you've finished, let me know if it has created a file at ~/.asoundrc or modified /etc/asound.conf and if so, what the contents of that file are. You may want to log out/back in to xfce to apply the settings and/or run '/etc/rc.d/rc.alsa restart' to restart alsa with the new settings. You might also need to check alsamixer to make sure your channels aren't muted.

If none of that works, try copying this to ~/.asoundrc:

defaults.pcm.card 1
defaults.pcm.device 1
defaults.ctl.card 1

then log out/back in again and run 'etc/rc.d/rc.alsa restart' just to make sure the settings get applied, and let me know if you're getting sound and what the output of 'amixer' is (remember to check alsamixer to see if it's got the right card and the channels aren't muted). I keep asking you for the output of amixer because that's where I get the data needed for the volume buttons to work.

I found some info that may prove useful here: http://slack4dummies.blogspot.com/2012/ ... sound.html but before we get into anything that complicated, hopefully one of the above approaches will work.
Please take a look at our online documentation, here. Suggestions are welcome!

Nimtpy
White ninja
White ninja
Posts: 5
Joined: 16 Jul 2012, 03:34
Location: Internet

Re: Default sound device working in KDE but not XFCE

Post#5 by Nimtpy » 17 Jul 2012, 03:12

ok it's fixed now and working just as the kde version does - I have system wide sound working with keyboard hotkeys functioning as expected.

I used a combination of my method and yours,

the solution was to find the actual name of the correct card stated in 'aplay -l' and use this in the asound.conf or asound.rc instead of the hardware number. My new asound.conf now contains:

Code: Select all

pcm.!default {
	type hw
	card SB
}

ctl.!default {
	type hw           
	card SB
}
the link you posted suggested to use the name instead of the number (the reasoning being that the name never changes but the order of the cards can get jumbled about) and that's what I think really made the difference.

I did try 'alsaconf' but that did little good (no asound.rc was created from this and the devices didn't seem to correlate with my system at all). I skipped your suggestions for what to edit the asound.rc to include after since I didn't have one created from 'alsaconf' and perusing that link made me understand alsa and asound.rc well enough to hone in on the solution myself.

'etc/rc.d/rc.alsa restart' is pretty magical so thanks for pointing to that!



So after all that, many many thanks to Ahau - for your time and patience!

I'm quite happy with porteus now and glad that I can give XFCE a go (my first time using it). It will still take me a while to figure out how I want my persistence and boot methods setup but at least I've narrowed the ISO down!


thanks again,

nimpty

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: Default sound device working in KDE but not XFCE

Post#6 by Ahau » 17 Jul 2012, 19:11

@nimpty,

excellent news! Glad you got it sorted out. What I'd like to do (eventually) is prepare a gtkdialog application that would open up a GUI with a listing of all sound cards, and the user could select their preferred card from the list, then select the channel they want to use for the master volume/volume keys, and then it would generate an asound.conf, restart alsa, and build a module to save the changes. However, I also have to sort out whether or not I'm staying with retrovol for the next version...

Anyway, thanks for your patience -- I'll keep a link to this thread as a reference.
Please take a look at our online documentation, here. Suggestions are welcome!

Nimtpy
White ninja
White ninja
Posts: 5
Joined: 16 Jul 2012, 03:34
Location: Internet

Re: [solved] Default sound device working in KDE but not XFC

Post#7 by Nimtpy » 20 Jul 2012, 04:34

that sounds really good Ahau - it's the sort of thing every linux distro should have really. To have that sort of feature makes most sense for a niche distro like porteus but eventually I don't see why other distros couldn't follow suit....

In fact, ideally there should be gui options for changing all hardware on the fly - from soundcards, to videocards to wireless cards (to non-free plugins too). If porteus could manage this (and in a live environment to boot) then it would surely become king. That sort of feature could establish a serious template for compatibility that other distros would want to follow.

If I stick around I would be happy to test that for you!

Post Reply