LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 10-30-2011, 09:31 PM   #1
aabmass
LQ Newbie
 
Registered: Oct 2011
Distribution: Debian Squeeze
Posts: 6

Rep: Reputation: Disabled
VIA VT1720/24 SPDIF output in debian not completely funtional


I've installed Debian 6.0.3 (squeeze)on my computer alongside Windows 7 and Ubuntu 11.04. My sound output through spdif works fine in Ubuntu and Windows so I was a bit surprised when it didn't work in Debian.

I did plenty of tinkering in gnome-volume-control and I couldn't get it to work until I edited my ~/.asoundrc file to:

Quote:
pcm.!default {
type plug
slave {
pcm "hw:0,1"
# pcm "spdif"
rate 48000
}
}

ctl.!default {
type hw
card 0
}
Now sound output works through spdif, but I can't control the volume level from my computer, only at my receiver. I'm guessing that I need to change/add something to /.asoundrc, but I'm not sure what!

The output of "lspci" is:
Quote:
00:00.0 Host bridge: Intel Corporation 82P965/G965 Memory Controller Hub (rev 02)
00:01.0 PCI bridge: Intel Corporation 82P965/G965 PCI Express Root Port (rev 02)
00:02.0 VGA compatible controller: Intel Corporation 82G965 Integrated Graphics Controller (rev 02)
00:02.1 Display controller: Intel Corporation 82G965 Integrated Graphics Controller (rev 02)
00:19.0 Ethernet controller: Intel Corporation 82562V 10/100 Network Connection (rev 02)
00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 (rev 02)
00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 02)
00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 02)
00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 02)
00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 02)
00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 02)
00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 02)
00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev f2)
00:1f.0 ISA bridge: Intel Corporation 82801HH (ICH8DH) LPC Interface Controller (rev 02)
00:1f.2 RAID bus controller: Intel Corporation 82801 SATA RAID Controller (rev 02)
00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 02)
03:02.0 Network controller: RaLink RT2561/RT61 802.11g PCI
03:03.0 Multimedia audio controller: VIA Technologies Inc. VT1720/24 [Envy24PT/HT] PCI Multi-Channel Audio Controller (rev 01)
and "aplay -l"
Quote:
**** List of PLAYBACK Hardware Devices ****
card 0: ICE1724 [ICEnsemble ICE1724], device 0: ICE1724 [ICE1724]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: ICE1724 [ICEnsemble ICE1724], device 1: ICE1724 IEC958 [ICE1724 IEC958]
Subdevices: 1/1
Subdevice #0: subdevice #0
And "uname -a"
Quote:
Linux aaron-debian 2.6.32-5-amd64 #1 SMP Mon Oct 3 03:59:20 UTC 2011 x86_64 GNU/Linux
Thanks for your help anyone! I really appreciate it!!

Last edited by aabmass; 10-30-2011 at 09:35 PM.
 
Old 11-02-2011, 02:52 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
/shot to nothing.

If it works in ubuntu, why not copy over /etc/alsa.conf and see if it makes a difference?
 
Old 11-02-2011, 07:44 PM   #3
aabmass
LQ Newbie
 
Registered: Oct 2011
Distribution: Debian Squeeze
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by business_kid View Post
/shot to nothing.

If it works in ubuntu, why not copy over /etc/alsa.conf and see if it makes a difference?
Nope, didn't work, thanks though.

I installed fedora 15 on another partition and the sound works fine there, but still not in debian!
 
Old 11-05-2011, 12:54 PM   #4
aabmass
LQ Newbie
 
Registered: Oct 2011
Distribution: Debian Squeeze
Posts: 6

Original Poster
Rep: Reputation: Disabled
Although it works fine in Fedora, I would still like some help, please! anyone!
 
Old 11-07-2011, 07:30 PM   #5
aabmass
LQ Newbie
 
Registered: Oct 2011
Distribution: Debian Squeeze
Posts: 6

Original Poster
Rep: Reputation: Disabled
Smile Got it working!

So I got it working! I installed libasound2 and pulseaudio packages and it worked (almost):

Code:
sudo apt-get install libasound2 pulseaudio
Also, get rid of any old .asoundrc files:
Code:
rm ~/.asoundrc
Now I could control the sound (the quality got a lot better too!), but only by dragging the volume adjustment thing.

However, my only problem was that the keyboard shortcuts that control the sound (XF86Audio*) were set to change the volume of the alsamixer. The easiest way I found to set this up so it would change pulseaudio sound was with a solution at https://bbs.archlinux.org/viewtopic.php?id=46608&p=2

First paste this into the file pulsevolbar.sh and save it in ~/.pulse

Code:
#!/bin/bash
#
# filename: pulsevolbar.sh
# Usage:
#      pulsevolbar.sh <increase/decrease/mute>
# 
#
#Customize this stuff
SECS="1"            # sleep $SECS
BG="#8E35EF"        # background colour of window
FG="#FFFF00"        # foreground colour of text/icon
BAR_FG="#F52887"    # foreground colour of volume bar
BAR_BG="#41A317"    # background colour of volume bar
HEIGHT="30"         # window height
WIDTH="250"         # window width
BAR_WIDTH="150"     # width of volume bar
ICON=~/.pulse/dzen_icons/vol-hi.xbm
FONT="-*-terminus-medium-r-*-*-14-*-*-*-*-*-*-*"
ICON_VOL=~/.icons/dzen_icons/vol-hi.xbm
ICON_VOL_MUTE=~/.icons/dzen_icons/vol-mute.xbm
ICON=$ICON_VOL
PULSE_MAX_VOL=65536

# No need to customize this variable
PIPE="/tmp/pulesvolpipe"

# Lets find the appropriate positioning for the volume bar
XRES=`xdpyinfo|grep 'dimensions:'|awk '{print $2}'|cut -dx -f1`
XPOS=$[$XRES / 2 - $WIDTH / 2]          # horizontal positioning
YRES=`xdpyinfo|grep 'dimensions:'|awk '{print $2}'|cut -dx -f2`
YPOS=$[$YRES * 4 / 5]          # vertical positioning

# Sets the desired volume
function set_volume()
{
	CURVOL=$1
	pactl set-sink-volume 0 $CURVOL
}

# Gets the current volume
function get_volume()
{
    MIXER=$(pacmd list-sinks 0 | grep -i "volume: 0:")
    echo $MIXER | cut -d ' ' -f 3 | cut -d '%' -f 1
}

# Get muted ? returns yes or no
function get_muted()
{
    MUTED=$(pacmd list-sinks 0 | grep muted | cut -d ' ' -f 2)
    echo $MUTED
}

VOL=$(get_volume)
CURVOL=$[$VOL * $PULSE_MAX_VOL / 100 ]
MUTE=$(get_muted)         # Reads mute state
if [[ $MUTE == "yes" ]]	# Sets the icon to mute_icon as the increase or decrease will not make speaker speak
then
    ICON=$ICON_VOL_MUTE
fi

if [[ $1 == "increase" ]]
then
    CURVOL=$(($CURVOL + 3277))	# 3277 is 5% of the total volume, you can change this to suit your needs.
    if [[ $CURVOL -ge $PULSE_MAX_VOL ]]
    then
        CURVOL=$PULSE_MAX_VOL        
    fi
    set_volume $CURVOL
elif [[ $1 == "decrease" ]]
then
    CURVOL=$(($CURVOL - 3277))
    if [[ $CURVOL -le 0 ]]
    then
        CURVOL=0        
    fi
    set_volume $CURVOL
elif [[ $1 == "mute" ]]
then
    if [[ $MUTE == "no" ]]
    then
        pactl set-sink-mute 0 1
	ICON=$ICON_VOL_MUTE
    else
        pactl set-sink-mute 0 0
	ICON=$ICON_VOL
    fi
fi

# showing in dzen2
if [ ! -e "$PIPE" ];
# if pipe file does not exists 
then
	mkfifo "$PIPE"
	(dzen2 -tw "$WIDTH" -h "$HEIGHT" -x "$XPOS" -y "$YPOS" -fn "$FONT" -bg "$BG" -fg "$FG" < "$PIPE" 
	rm  -f "$PIPE") &
fi

# feed the pipe
(echo $[$CURVOL *  100 / $PULSE_MAX_VOL]| dzen2-gdbar -l "^i(${ICON})" -fg "$BAR_FG" -bg "$BAR_BG" -w "$BAR_WIDTH"  ; sleep "$SECS" ) > "$PIPE"

Now make it executable:
Code:
chmod +x ~/.pulse/pulsevolbar.sh
then do this to make the other files necessary:

Code:
cd ~/.pulse
echo "false" > mute
echo "36043" > volume
This solution uses dzen2 and I ended up having to install a few things:
Code:
sudo apt-get install dzen2 dbar conky-cli i3 i3status xfonts-terminus-oblique console-terminus
Now restart X11 or your computer.

Run the script once (not sure if you have to do this, actually, but it doesn't hurt!

Code:
sh ~/.pulse/pulsevolbar.sh
Now we have set the volume buttons on the keyboard to work with our new shell script!

Go to System > Preferences > Keyboard Shortcuts . Make new shorcuts (add) with whatever names you want to describe the action. I used Pulse Volume Increase, Pulse Volume Decrease, and Pulse Volume Mute. For each of those, give the respective commands for the script: /home/USER/.pulse/pulsevolbar.sh increase, /home/USER/.pulse/pulsevolbar.sh decrease, or /home/USER/.pulse/pulsevolbar.sh mute (of course, replace USER with your username).

Now test it! The volume should decrease and a box with percentages should show as it would for alsa.

You're done!!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
help regarding spdif output vikash kumar Linux - Newbie 1 11-10-2010 07:17 AM
SPDIF Output Setup slakka Linux - Hardware 5 09-27-2009 11:18 PM
No output through SPDIf, but analog works. How do I get output through SPDIF? seanwnz Linux - General 11 11-08-2007 11:24 AM
Getting SPDIF output with gstreamer in FC5 freejump06 Fedora 2 09-01-2006 11:17 PM
Complete Linux Newbie + SPDIF output = HELP ! pierrafeu Linux - Hardware 5 10-02-2003 11:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 04:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration