• Audio devices in wrong order -- how to change?

    From Markus Robert Kessler@2:250/1 to All on Thu Jul 2 08:36:00 2020
    Hi everybody,

    I am running twinkle for making phone calls, and in its twinkle.sys file
    the audio devices to be used as speaker, microphone and ring tone are
    defined.

    Mine looks like

    $ grep ^dev ~/.twinkle/twinkle.sys
    dev_ringtone=alsa:plughw:1,0
    dev_speaker=alsa:plughw:1,0
    dev_mic=alsa:plughw:1,0

    As you see, twinkle does not address them by name, but rather by device
    id.

    Well. In most cases this works.

    But, sometimes, after system start, there is a mismatched order of devices
    in the system. It can be verified like this:

    $ aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: Headset [Logitech USB Headset], device 0: USB Audio [USB Audio]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 1: Intel [HDA Intel], device 0: ALC262 Analog [ALC262 Analog]
    Subdevices: 1/1
    Subdevice #0: subdevice #0

    Usually 'Intel [HDA Intel]' is up as 'card 0' and Logitech headset is
    downside and everything works fine.

    But sometimes the above-shown order applies, and either the devices have
    to be switched in twinkle's sys-file, or you hear your phone call on the external speakers.

    My question now is:

    Does someon know a trick how to change the order of those devices, so that 'card 0' appears as 'card 1' and so on?

    Thanks for any idea!

    Best regards,

    Markus

    --
    Please reply to group only.
    For private email please use http://www.dipl-ing-kessler.de/email.htm

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Bit Twister@2:250/1 to All on Thu Jul 2 09:54:04 2020
    On Thu, 2 Jul 2020 07:36:00 -0000 (UTC), Markus Robert Kessler wrote:
    Hi everybody,

    Hello to you too.

    I am running twinkle for making phone calls, and in its twinkle.sys file
    the audio devices to be used as speaker, microphone and ring tone are defined.

    Mine looks like

    $ grep ^dev ~/.twinkle/twinkle.sys
    dev_ringtone=alsa:plughw:1,0
    dev_speaker=alsa:plughw:1,0
    dev_mic=alsa:plughw:1,0

    If you were to read any of the Usenet guidelines, you might find out
    that it is helpful to provide basic information about your setup.

    What you can do is create a $HOME/.signature file and configure your
    Usenet client to attach the signature file to all your posts.
    Signature file starts out with dash dash space followed
    by four lines, or less, with line length of less than 80 characters.
    Example:
    --(space here)
    kernel 5.6.14-desktop-2.mga7 OS:Mga7, greeter=lightdm, DM=lightdm, DE=Xfce Video card: PCI Cedar [Radeon HD 5450 Mem: 8g Swap: 8g

    As a result of something like the above, subject matter experts can give
    more exacting details on getting desired information for troubleshooting
    or give exact commands to solve your problem.

    Also, gives you a better chance of a response because a subject matter
    expert my not bother to reply if they have to guess OS/Display Environment.

    As you see, twinkle does not address them by name, but rather by device
    id.

    Well. In most cases this works.

    But, sometimes, after system start, there is a mismatched order of devices
    in the system. It can be verified like this:

    $ aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: Headset [Logitech USB Headset], device 0: USB Audio [USB Audio]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 1: Intel [HDA Intel], device 0: ALC262 Analog [ALC262 Analog]
    Subdevices: 1/1
    Subdevice #0: subdevice #0

    Since you posted to a Mageia Usenet group, I can tell you that Pulseaudio
    is in control of defining your audio card/input/output devices and levels.


    Usually 'Intel [HDA Intel]' is up as 'card 0' and Logitech headset is downside and everything works fine.

    But sometimes the above-shown order applies, and either the devices have
    to be switched in twinkle's sys-file, or you hear your phone call on the external speakers.

    Yup, yup, yup. Also depends if headset is plugged in during boot. :(

    My question now is:

    Does someon know a trick how to change the order of those devices, so that 'card 0' appears as 'card 1' and so on?

    Thanks for any idea!

    man -k pulse
    man -k pulse | grep cli

    My guess is that you create a pulse-client.conf with desired definitions
    and maybe a wrapper to enable/disable settings when using the headset.

    I can recommend running the following to get device information and values needed for configuration values and possible wrapper commands.

    Just after boot/login. Left click speaker icon in task bar, selecting Mixer
    and setting all desired levels and disabling undesired audio devices/cards.

    pacmd dump > $HOME/pulse_card.dump
    pacmd info > $HOME/pulse_card.info
    pactl list | grep 'Active Port:' > $HOME/pulse_card.ports

    You may need to re-run the above with different file names with
    headset plugged in and volume levels set.

    Hopefully you will not have to mess around with udev rules to prevent
    device ids from moving between card names/ids.


    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Doug Laidlaw@2:250/1 to All on Sat Jul 4 14:40:24 2020
    On 2/7/20 6:54 pm, Bit Twister wrote:
    On Thu, 2 Jul 2020 07:36:00 -0000 (UTC), Markus Robert Kessler wrote:
    Hi everybody,

    Hello to you too.

    I am running twinkle for making phone calls, and in its twinkle.sys file
    the audio devices to be used as speaker, microphone and ring tone are
    defined.

    Mine looks like

    $ grep ^dev ~/.twinkle/twinkle.sys
    dev_ringtone=alsa:plughw:1,0
    dev_speaker=alsa:plughw:1,0
    dev_mic=alsa:plughw:1,0

    If you were to read any of the Usenet guidelines, you might find out
    that it is helpful to provide basic information about your setup.

    What you can do is create a $HOME/.signature file and configure your
    Usenet client to attach the signature file to all your posts.
    Signature file starts out with dash dash space followed
    by four lines, or less, with line length of less than 80 characters.
    Example:
    --(space here)
    kernel 5.6.14-desktop-2.mga7 OS:Mga7, greeter=lightdm, DM=lightdm, DE=Xfce Video card: PCI Cedar [Radeon HD 5450 Mem: 8g Swap: 8g

    As a result of something like the above, subject matter experts can give
    more exacting details on getting desired information for troubleshooting
    or give exact commands to solve your problem.

    Also, gives you a better chance of a response because a subject matter
    expert my not bother to reply if they have to guess OS/Display Environment.

    As you see, twinkle does not address them by name, but rather by device
    id.

    Well. In most cases this works.

    But, sometimes, after system start, there is a mismatched order of devices >> in the system. It can be verified like this:

    $ aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: Headset [Logitech USB Headset], device 0: USB Audio [USB Audio]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 1: Intel [HDA Intel], device 0: ALC262 Analog [ALC262 Analog]
    Subdevices: 1/1
    Subdevice #0: subdevice #0

    Since you posted to a Mageia Usenet group, I can tell you that Pulseaudio
    is in control of defining your audio card/input/output devices and levels.


    Usually 'Intel [HDA Intel]' is up as 'card 0' and Logitech headset is
    downside and everything works fine.

    But sometimes the above-shown order applies, and either the devices have
    to be switched in twinkle's sys-file, or you hear your phone call on the
    external speakers.

    Yup, yup, yup. Also depends if headset is plugged in during boot. :(

    My question now is:

    Does someon know a trick how to change the order of those devices, so that >> 'card 0' appears as 'card 1' and so on?

    Thanks for any idea!

    man -k pulse
    man -k pulse | grep cli

    My guess is that you create a pulse-client.conf with desired definitions
    and maybe a wrapper to enable/disable settings when using the headset.

    I can recommend running the following to get device information and values needed for configuration values and possible wrapper commands.

    Just after boot/login. Left click speaker icon in task bar, selecting Mixer and setting all desired levels and disabling undesired audio devices/cards.

    pacmd dump > $HOME/pulse_card.dump
    pacmd info > $HOME/pulse_card.info
    pactl list | grep 'Active Port:' > $HOME/pulse_card.ports

    You may need to re-run the above with different file names with
    headset plugged in and volume levels set.

    Hopefully you will not have to mess around with udev rules to prevent
    device ids from moving between card names/ids.

    Do you have a $HOME/.asoundrc? I see that I have a saved "tips and
    hints" item on this issue. It is an asoundrc file for HDMI, as follows:

    pcm.dmixer {
    type dmix
    ipc_key 1024
    ipc_key_add_uid false
    ipc_perm 0660
    slave{
    pcm "hw:0,0"
    rate 48000
    channels 2
    period_time 0
    period_size 1024
    buffer_time 0
    buffer_size 4096
    }
    }
    pcm. !default {
    type plug
    slave.pcm "dmixer"
    }

    It may be obsolete.

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: Aioe.org NNTP Server (2:250/1@fidonet)
  • From Markus Robert Kessler@2:250/1 to All on Mon Jul 20 07:25:03 2020
    On Sat, 04 Jul 2020 23:40:24 +1000 Doug Laidlaw wrote:

    On 2/7/20 6:54 pm, Bit Twister wrote:
    On Thu, 2 Jul 2020 07:36:00 -0000 (UTC), Markus Robert Kessler wrote:
    Hi everybody,

    Hello to you too.

    I am running twinkle for making phone calls, and in its twinkle.sys
    file the audio devices to be used as speaker, microphone and ring tone
    are defined.

    Mine looks like

    $ grep ^dev ~/.twinkle/twinkle.sys dev_ringtone=alsa:plughw:1,0
    dev_speaker=alsa:plughw:1,0 dev_mic=alsa:plughw:1,0

    If you were to read any of the Usenet guidelines, you might find out
    that it is helpful to provide basic information about your setup.

    What you can do is create a $HOME/.signature file and configure your
    Usenet client to attach the signature file to all your posts.
    Signature file starts out with dash dash space followed by four lines,
    or less, with line length of less than 80 characters. Example:
    --(space here)
    kernel 5.6.14-desktop-2.mga7 OS:Mga7, greeter=lightdm, DM=lightdm,
    DE=Xfce Video card: PCI Cedar [Radeon HD 5450 Mem: 8g Swap: 8g

    As a result of something like the above, subject matter experts can
    give more exacting details on getting desired information for
    troubleshooting or give exact commands to solve your problem.

    Also, gives you a better chance of a response because a subject matter
    expert my not bother to reply if they have to guess OS/Display
    Environment.

    As you see, twinkle does not address them by name, but rather by
    device id.

    Well. In most cases this works.

    But, sometimes, after system start, there is a mismatched order of
    devices in the system. It can be verified like this:

    $ aplay -l **** List of PLAYBACK Hardware Devices ****
    card 0: Headset [Logitech USB Headset], device 0: USB Audio [USB
    Audio]
    Subdevices: 1/1 Subdevice #0: subdevice #0
    card 1: Intel [HDA Intel], device 0: ALC262 Analog [ALC262 Analog]
    Subdevices: 1/1 Subdevice #0: subdevice #0

    Since you posted to a Mageia Usenet group, I can tell you that
    Pulseaudio is in control of defining your audio card/input/output
    devices and levels.


    Usually 'Intel [HDA Intel]' is up as 'card 0' and Logitech headset is
    downside and everything works fine.

    But sometimes the above-shown order applies, and either the devices
    have to be switched in twinkle's sys-file, or you hear your phone call
    on the external speakers.

    Yup, yup, yup. Also depends if headset is plugged in during boot. :(

    My question now is:

    Does someon know a trick how to change the order of those devices, so
    that 'card 0' appears as 'card 1' and so on?

    Thanks for any idea!

    man -k pulse man -k pulse | grep cli

    My guess is that you create a pulse-client.conf with desired
    definitions and maybe a wrapper to enable/disable settings when using
    the headset.

    I can recommend running the following to get device information and
    values needed for configuration values and possible wrapper commands.

    Just after boot/login. Left click speaker icon in task bar, selecting
    Mixer and setting all desired levels and disabling undesired audio
    devices/cards.

    pacmd dump > $HOME/pulse_card.dump pacmd info >
    $HOME/pulse_card.info pactl list | grep 'Active Port:' >
    $HOME/pulse_card.ports

    You may need to re-run the above with different file names with headset
    plugged in and volume levels set.

    Hopefully you will not have to mess around with udev rules to prevent
    device ids from moving between card names/ids.

    Do you have a $HOME/.asoundrc? I see that I have a saved "tips and
    hints" item on this issue. It is an asoundrc file for HDMI, as follows:

    pcm.dmixer {
    type dmix ipc_key 1024 ipc_key_add_uid false ipc_perm 0660 slave{
    pcm "hw:0,0"
    rate 48000 channels 2 period_time 0 period_size 1024 buffer_time 0
    buffer_size 4096 }
    }
    pcm. !default {
    type plug slave.pcm "dmixer"
    }

    It may be obsolete.

    Hi Doug, hi Bit Twister,

    thanks a lot for your ideas, and sorry for late response.

    Last question first: I have no .asoundrc file which could affect ids- assignment in ~.

    Anyway, this task seems to be very tricky and, after all, I stopped
    tinkering around. Finally, I think solving twinkle's card-id-problem
    could be done easier by using two twinkle.sys files, which can be
    copied / symlinked, depending on what 'aplay -l' says.

    So, the order of audio devices may differ from bootup to bootup, but
    after linking the right file, twinkle uses the correct devices.

    Thanks again,
    best regards,

    Markus


    --
    Please reply to group only.
    For private email please use http://www.dipl-ing-kessler.de/email.htm

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Bit Twister@2:250/1 to All on Mon Jul 20 09:37:39 2020
    On Mon, 20 Jul 2020 06:25:03 -0000 (UTC), Markus Robert Kessler wrote:

    Last question first: I have no .asoundrc file which could affect ids- assignment in ~.

    It has been years since I setup default, skype and ekiga levels.
    I used alsactl store/restore to create/use desired files.

    asound.state_bittwister
    ekiga_asound.state_bittwister
    skype_asound.state_bittwister

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)