Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

ALSA config questions

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
cncjerry
Posts: 2
Joined: 2024-04-27 19:02

ALSA config questions

#1 Post by cncjerry »

Hi, I've been pulling my hair out for a while. Seems like I am not getting to the correct alsa config file. My goal is to be able to play stereo data on both card 0 (beaglebone HDMI) and card 1, USB audio adapter, separately. if I get card 0 working, then I will pull out card 1 and use the I2S data from the HDMI to drive external DACS directly.

I have Card 0 and Card 1 as below. Both cards work with speaker test except card 0, HDMI from a beaglebone Black, will only play one channel or the other, seems to change every time I boot, but it only plays one channel during that boot. So sometimes I boot and it plays only the left channel. other times I boot and it only plays the right channel. The other card, Card 1, USB audio, plays both channels with out an issue. I think my asound.conf file is to blame, and though I've read a lot, I can't seem to see what could be causing this issue as there is very little config information in there.

the only change I made to asound.conf was to test by changing 'card 1' to 'card 0' in the first 10 lines. Prior to making this change, and again, it is almost like alsa is configuring itself at every boot, 'card 0' wasn't listed by aplay and I couldn't run speaker test. Changing '1' to '0' allowed me to run speaker-test on card 0 and card 1, but again, card 0 only wants to play the right channel now. I am monitoring the SPI lines that are currently used for HDMI audio. When the right channel is tested, I see data on the I2S data line; when the other channel is tested, I see nothing (it drops off). I've tried noise, sine waves, etc with speaker-test c2.

aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: Black [TI BeagleBone Black], device 0: davinci-mcasp.0-i2s-hifi i2s-hifi-0 [davinci-mcasp.0-i2s-hifi i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Audio [USB Audio], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

asound.conf

Code: Select all


pcm.onboard{
    type hw
    card 0
}
ctl.onboard {
    type hw
    card 0
}

### Dsnoop splited channels
pcm.onboard_capture_left {
     type dsnoop
     ipc_key 32
     slave {
         pcm "onboard"
         channels 2
         rate 48000
         format S32_LE
     }
     bindings.0  0
}

pcm.onboard_playback_left {
     type dmix
     ipc_key 33
     slave {
         pcm "onboard"
         channels 2
     }
     bindings.0  1
}


pcm.onboard_capture_right {
     type dsnoop
     ipc_key 32
     slave {
         pcm "onboard"
         channels 2
         rate 48000
         format S32_LE
     }
     bindings.0  1
}

pcm.onboard_playback_right {
     type dmix
     ipc_key 33
     slave {
         pcm "onboard"
         channels 2
     }
     bindings.1  0
}

### PLUGS ##
### used with darkice
### device = plug:plug_onboard_left
pcm.plug_onboard_capture_left{
        type plug
        slave.pcm "onboard_capture_left"
}
pcm.plug_onboard_playback_left{
        type plug
        slave.pcm "onboard_playback_left"
}
pcm.plug_onboard_capture_right{
        type plug
        slave.pcm "onboard_capture_right"
}
pcm.plug_onboard_playback_right{
        type plug
        slave.pcm "onboard_playback_right"
}

pcm.!default {
    type asym
    playback.pcm "plug_onboard_playback_left"
    capture.pcm "plug_onboard_capture_left"
    playback.pcm "plug_onboard_playback_right"
    capture.pcm "plug_onboard_capture_right"
}

thanks,

Jerry

cncjerry
Posts: 2
Joined: 2024-04-27 19:02

Re: ALSA config questions

#2 Post by cncjerry »

Go figure, but if I run:
speaker-test -Dhw:CARD=Black,DEV=0 -t sine -c2

I get sound from the HDMI channels now. I had tried every device on the list below:

Code: Select all

null
    Discard all samples (playback) or generate zero samples (capture)
onboard
onboard_playback_front
onboard_capture_left
onboard_playback_left
onboard_capture_right
onboard_playback_right
plug_onboard_capture_left
plug_onboard_playback_left
plug_onboard_capture_right
plug_onboard_playback_right
default
sysdefault:CARD=Black
    TI BeagleBone Black, davinci-mcasp.0-i2s-hifi i2s-hifi-0
    Default Audio Device
dmix:CARD=Black,DEV=0
    TI BeagleBone Black, davinci-mcasp.0-i2s-hifi i2s-hifi-0
    Direct sample mixing device
dsnoop:CARD=Black,DEV=0
    TI BeagleBone Black, davinci-mcasp.0-i2s-hifi i2s-hifi-0
    Direct sample snooping device
hw:CARD=Black,DEV=0
    TI BeagleBone Black, davinci-mcasp.0-i2s-hifi i2s-hifi-0
    Direct hardware device without any conversions
plughw:CARD=Black,DEV=0
    TI BeagleBone Black, davinci-mcasp.0-i2s-hifi i2s-hifi-0
    Hardware device with all software conversions
sysdefault:CARD=Audio
    USB Audio, USB Audio
    Default Audio Device
front:CARD=Audio,DEV=0
    USB Audio, USB Audio
    Front speakers
surround21:CARD=Audio,DEV=0
    USB Audio, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Audio,DEV=0
    USB Audio, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Audio,DEV=0
    USB Audio, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Audio,DEV=0
    USB Audio, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Audio,DEV=0
    USB Audio, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Audio,DEV=0
    USB Audio, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Audio,DEV=0
    USB Audio, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=Audio,DEV=0
    USB Audio, USB Audio
    Direct sample mixing device
dsnoop:CARD=Audio,DEV=0
    USB Audio, USB Audio
    Direct sample snooping device
hw:CARD=Audio,DEV=0
    USB Audio, USB Audio
    Direct hardware device without any conversions
plughw:CARD=Audio,DEV=0
    USB Audio, USB Audio
    Hardware device with all software conversions
Now the question is, how do I get this card to be the default? I am using pianobar on a beaglebone black, works great, nice clean sound, etc. I have to either make that device the default or direct pianobar to use it.

My intent is to take the I2S output, use a crystal CS8402a to turn it into AESUBU, and route it to several DACs that have been installed for almost 30yrs. this is an incredibly cheap way to run the Beaglebone all the time as they sip power so my wife doesn't have to boot it when she wants to listen to pandora.

Thanks,

Jerry

thanks

User avatar
NorthEast
Posts: 352
Joined: 2018-11-18 04:35
Has thanked: 12 times
Been thanked: 30 times

Re: ALSA config questions

#3 Post by NorthEast »

Are you able to select the default card in alsamixer? I start alsamixer in the terminal, hit F6, and then can select the default card.

Post Reply