Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 21 Apr 2014, 07:59
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Add snd-usb-audio and snd-powermac support to sound wizard
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [10 Posts]  
Author Message
John Doe

Joined: 01 Aug 2005
Posts: 1689
Location: Michigan, US

PostPosted: Mon 05 Feb 2007, 18:27    Post subject:  Add snd-usb-audio and snd-powermac support to sound wizard  

Open /usr/sbin/alsaconf and change line 1231 to this:

Code:
devs_found=("${devs_found[@]}" "legacy" "Probe legacy ISA (non-PnP) chips" "usb-audio" "USB Sound Device" "aoa" "Apple Onboard Audio Driver")


I have tested this with USB and it works. According to the post referenced in this post, it should work with MAC too (I think that driver was in there):

http://www.murga-linux.com/puppy/viewtopic.php?p=95086#95086

*edit. I fixed the apple var for the 2.6.18 kernel or greater. If using a previous kernel version, change "aoa" to "powermac".

*edit2. (*Fixed below) The volume control gets "funky" after doing the above for USB. WHen I mouse over it errors. I'll try to work around it.

Last edited by John Doe on Tue 06 Feb 2007, 20:02; edited 1 time in total
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Tue 06 Feb 2007, 14:06    Post subject:  

John,
I have just now discovered this post and your other one about Skype.

So, that modification for alsaconf, can that be made permanently for
everyone? I mean, should I do this for the original alsaconf so it will be in the official live-CD?
Back to top
View user's profile Send private message Visit poster's website 
John Doe

Joined: 01 Aug 2005
Posts: 1689
Location: Michigan, US

PostPosted: Tue 06 Feb 2007, 19:52    Post subject:  

Yes, please consider including this. I think it will help many people.

Important /usr/sbin/mini-volume.tcl notes:

Line 41
Code:
proc setvolume { level } {
   if {[catch {exec setvol 0 $level} errmsg]} {
      exec amixer sset 'Speaker' $level
   }
}


Line 47
Code:
proc getvolume { } {
   set volcommand { setvol 0 | cut -d" " -f2 }
   set volcommand2 { amixer sget 'Speaker' | grep 'Left: Playback [0-9]'}
   if {[catch {set volValue [exec sh -c ($volcommand)]} errmsg]} {
      regexp { [0-9]+ } [exec sh -c ($volcommand2)] volValue
   set gain $volValue
   } else {
   set gain $volValue
   }
}


It appears that setvol doesn't play nice with USB sound (*see two posts down). These changes will allow the tray volume app to try and use amixer for USB sound devices.

I double checked to make sure that this would still function properly with current sound cards (my initial try didn't).

I've been flipping my default sound device back and forth between built-in and USB headphones for the past hour. It works great.

Other than gxine volume slider not working.

Last edited by John Doe on Fri 09 Feb 2007, 22:04; edited 3 times in total
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Fri 09 Feb 2007, 02:31    Post subject:  

Could you please tell rarsa about that, the mini-volume control is his baby.
Back to top
View user's profile Send private message Visit poster's website 
John Doe

Joined: 01 Aug 2005
Posts: 1689
Location: Michigan, US

PostPosted: Fri 09 Feb 2007, 03:40    Post subject:  

Will do.

Another note for the thread:

For some reason (as I've yet to determine) puppy does not remember the USB audio settings on a reboot. It goes back to the internal device. I'll keep trouble shooting on it.

(it's still nice to have the feature, none the less)
Back to top
View user's profile Send private message 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Fri 09 Feb 2007, 10:08    Post subject:  

If I understood correctly your post (and the little documentation I skimmed over), there is no way to control the volume for USB sound devices. They come with their own volume knob

Is there a way to identify that the user is using USB so I can gray out (disable) the volume instead of "failing graciously" ?

I could still show a hint telling the user that it seems that they are using a USB sound device which may have its own volume knowb.

Is there a particular module I should be looking for with lsmod? is there something to check under /proc or /dev ?

_________________
http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
Back to top
View user's profile Send private message Visit poster's website 
John Doe

Joined: 01 Aug 2005
Posts: 1689
Location: Michigan, US

PostPosted: Fri 09 Feb 2007, 19:00    Post subject:  

Hey, I went crazy all afternoon and made it work (*edited previous code) Smile

At least with my device, the regex might not work for some people (grep regex syntax limitations really annoyed me).

*edit, I beefed up the regex by using the tcl object. I think it will handle things better now. People will need to test, report and possibly post the information I did below if it isn't working for them. Fixes can be made from there.

Here is further clarification on the issue. The main problem turns out to be that the snd-usb-audio driver doesn't support the SOUND_MIXER_VOLUME (0) channel, it DOES support the SOUND_MIXER_MIC (7) channel which I thought was odd. So the code now basically tries setvol first and, if it fails because that channel isn't present, tries to use amixer instead.

This is my output for amixer with the usb device:

Code:
Simple mixer control 'Mic',0
  Capabilities: pvolume pvolume-joined cvolume pswitch pswitch-joined cswitch cswitch-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: Playback 0 - 32 Capture 0 - 16
  Mono: Playback 0 [0%] [off] Capture 0 [0%] [on]
Simple mixer control 'Auto Gain Control',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 38
  Mono:
  Front Left: Playback 10 [26%] [on]
  Front Right: Playback 10 [26%] [on]
sh-3.00#
[/b]
Back to top
View user's profile Send private message 
bobble991

Joined: 22 May 2007
Posts: 10
Location: Scotland

PostPosted: Thu 24 May 2007, 18:33    Post subject:  

ok this worked great for me, I can play music no problems BUT no system sounds. If I try to use setvol it says cant access /dev/mixer and to chmod it. It doesnt make any difference if I do. The alsa wizard doesnt see my usb card either which is odd because I use the alsa driver in gxine and that works fine. output from amixer is

Simple mixer control 'PCM',0
Capabilities pvolume pvolume-joined cvolume pswitch pswitch-joined
Playback channels: Mono
Capture channels:mono
Limits playback 0 - 100 Capture 0 - 15
Mono: Playback 100 [100%] [on] Capture 0 [0%]



Thats it. Any ideas?
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 10672
Location: Arizona USA

PostPosted: Thu 24 May 2007, 23:38    Post subject:  

bobbie, what version of Puppy are you using, and how? (Is it installed to hard drive? Full install or frugal?)
Back to top
View user's profile Send private message 
bobble991

Joined: 22 May 2007
Posts: 10
Location: Scotland

PostPosted: Fri 25 May 2007, 02:58    Post subject:  

Ive been gently upgrading and am currently on 2;15ce Its a full hard drive install with about eleven gig free. The sound card is a sound blaster live external 24 bit.

Thanks
Bob
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [10 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0714s ][ Queries: 11 (0.0167s) ][ GZIP on ]