mikebrady / shairport-sync

AirPlay and AirPlay 2 audio player
Other
7.28k stars 574 forks source link

Couldn't choose output device #1310

Closed KindDragon closed 2 years ago

KindDragon commented 3 years ago
❯ shairport-sync -V
4.1-dev-7-g430e3eda-AirPlay2-OpenSSL-Avahi-ALSA-soxr-metadata-dbus-sysconfdir:/etc

shairport-sync --help return:

    hardware output devices:
      "hw:C920"
      "hw:Mic"
      "hw:NVidia"
      "hw:PCH"

but when I run shairport-sync -vu --statistics -- -d "hw:NVidia" it print error

         0.000328487 "shairport.c:1805" Features: 0x1c340405fca00.
         0.000031107 "shairport.c:1834" Started in Airplay 2 mode on device "74:D0:2B:9C:B1:B1"!
         0.000008210 "shairport.c:1876" software version: "4.1-dev-7-g430e3eda-AirPlay2-OpenSSL-Avahi-ALSA-soxr-metadata-dbus-sysconfdir:/etc"
         0.000003062 "shairport.c:1882" log verbosity is 1.
         0.000004836 "audio_alsa.c:1015" alsa: alsa_maximum_stall_time of 0.200000 sec.
         0.000007985 "audio_alsa.c:1299" alsa: disable_standby_mode is "never".
         0.000011876 "audio_alsa.c:1303" alsa: disable_standby_mode_silence_threshold is 0.040000 seconds.
         0.000003283 "audio_alsa.c:1305" alsa: disable_standby_mode_silence_scan_interval is 0.004000 seconds.
         0.000004475 "audio_alsa.c:1345" alsa: output device name is "hw:NVidia".
         0.000072554 "shairport.c:1911" libsodium initialised.
         0.000006670 "shairport.c:1938" disable resend requests is off.
         0.000003700 "shairport.c:1939" diagnostic_drop_packet_fraction is 0.000000. A value of 0.0 means no packets will be dropped deliberately.
         0.000014584 "shairport.c:1943" statistics_requester status is 1.
         0.000004347 "shairport.c:1948" rtsp listening port is 7000.
         0.000003921 "shairport.c:1949" udp base port is 6001.
         0.000003945 "shairport.c:1950" udp port range is 10.
         0.000012357 "shairport.c:1951" player name is "Dragon-pc".
         0.000002342 "shairport.c:1952" backend is "alsa".
         0.000002145 "shairport.c:1953" run_this_before_play_begins action is "(null)".
         0.000002278 "shairport.c:1954" run_this_after_play_ends action is "(null)".
         0.000002582 "shairport.c:1955" wait-cmd status is 0.
         0.000002222 "shairport.c:1956" run_this_before_play_begins may return output is 0.
         0.000002245 "shairport.c:1957" run_this_if_an_unfixable_error_is_detected action is "(null)".
         0.000002274 "shairport.c:1958" run_this_before_entering_active_state action is  "(null)".
         0.000002355 "shairport.c:1959" run_this_after_exiting_active_state action is  "(null)".
         0.000002682 "shairport.c:1960" active_state_timeout is  10.000000 seconds.
         0.000004528 "shairport.c:1961" mdns backend "(null)".
         0.000002014 "shairport.c:1963" interpolation setting is "auto".
         0.000010973 "shairport.c:1966" interpolation soxr_delay_threshold is 30.
         0.000002325 "shairport.c:1967" resync time is 0.050000 seconds.
         0.000003412 "shairport.c:1968" allow a session to be interrupted: 0.
         0.000002359 "shairport.c:1969" busy timeout time is 0.
         0.000003050 "shairport.c:1970" drift tolerance is 0.001995 seconds.
         0.000003304 "shairport.c:1971" password is "(null)".
         0.000003064 "shairport.c:1972" ignore_volume_control is 0.
         0.000012552 "shairport.c:1976" volume_max_db is not set
         0.000002810 "shairport.c:1977" volume range in dB (zero means use the range specified by the mixer): 0.
         0.000003194 "shairport.c:1979" volume_range_combined_hardware_priority (1 means hardware mixer attenuation is used first) is 0.
         0.000012685 "shairport.c:1983" playback_mode is 0 (0-stereo, 1-mono, 1-reverse_stereo, 2-both_left, 3-both_right).
         0.000002402 "shairport.c:1985" disable_synchronization is 0.
         0.000002219 "shairport.c:1986" use_mmap_if_available is 1.
         0.000002563 "shairport.c:1987" output_format automatic selection is enabled.
         0.000003116 "shairport.c:1991" output_rate automatic selection is enabled.
         0.000003215 "shairport.c:1995" audio backend desired buffer length is 0.200000 seconds.
         0.000003538 "shairport.c:1997" audio_backend_buffer_interpolation_threshold_in_seconds is 0.120000 seconds.
         0.000012841 "shairport.c:1999" audio backend latency offset is 0.000000 seconds.
         0.000003606 "shairport.c:2001" audio backend silence lead-in time is "auto".
         0.000003323 "shairport.c:2005" zeroconf regtype is "_raop._tcp".
         0.000002912 "shairport.c:2006" decoders_supported field is 1.
         0.000003084 "shairport.c:2007" use_apple_decoder is 0.
         0.000002971 "shairport.c:2008" alsa_use_hardware_mute is 0.
         0.000003079 "shairport.c:2012" no special mdns service interface was requested.
         0.000007138 "shairport.c:2015" configuration file name "/etc/shairport-sync.conf" resolves to "/etc/shairport-sync.conf".
         0.000003735 "shairport.c:2022" metadata enabled is 1.
         0.000003084 "shairport.c:2023" metadata pipename is "/tmp/shairport-sync-metadata".
         0.000003189 "shairport.c:2024" metadata socket address is "(null)" port 0.
         0.000003181 "shairport.c:2026" metadata socket packet size is "500".
         0.000003337 "shairport.c:2027" get-coverart is 1.
         0.000003260 "shairport.c:2045" loudness is 0.
         0.000003161 "shairport.c:2046" loudness reference level is -20.000000
         0.000030286 "rtsp.c:3645" metadata pipe name is "/tmp/shairport-sync-metadata".
         0.001789691 "dbus-service.c:1053" *warning: could not acquire a Shairport Sync native D-Bus interface "org.gnome.ShairportSync.i152186" on the system bus.
         1.104197539 "rtsp.c:5003" Connection 1: new connection from fe80::8f8:57da:6382:784b:58608 to self at fe80::79c:3065:2526:9357:7000.
         0.394256586 "shairport.c:211" "soxr" interpolation has been chosen.
         0.481321859 "rtsp.c:2499" Connection 1: SETUP: Remote Control setup detected.
         0.000050367 "rtsp.c:2698" Connection 1: TCP Remote Control event port opened: 47641.
         3.358701560 "rtsp.c:5003" Connection 2: new connection from 192.168.1.205:58612 to self at 192.168.1.236:7000.
         0.000090366 "rtsp.c:5003" Connection 3: new connection from fe80::8f8:57da:6382:784b:58611 to self at fe80::79c:3065:2526:9357:7000.
         0.427042599 "rtsp.c:662" Connection 1: cancelled.
         0.000278857 "rtsp.c:670" Connection 1: joined.
         0.447230486 "rtsp.c:2865" SETUP on Connection 3. Buffered Audio Stream Detected.
         0.003790289 "audio_alsa.c:437" *fatal error: the alsa output_device "hw:NVidia" can not be found.
         0.000075652 "rtsp.c:662" Connection 3: cancelled.
mikebrady commented 3 years ago

Thanks for the post. Do any of the listed devices work?

KindDragon commented 3 years ago

If I start like that shairport-sync -vu --statistics it works (but it plays quietly), but if I start as service it doesn't work

shairport-sync -vu --statistics:

         1.498651303 "shairport.c:211" "soxr" interpolation has been chosen.
         5.774458418 "rtsp.c:5003" Connection 1: new connection from fe80::45a:e708:6ce4:15b:52808 to self at fe80::79c:3065:2526:9357:7000.
         1.639476192 "rtsp.c:2865" SETUP on Connection 1. Buffered Audio Stream Detected.
         0.011938445 "audio_alsa.c:528" alsa: output format chosen is "S32".
         0.000026221 "audio_alsa.c:569" alsa: output speed chosen is 44100.
         0.903781253 "rtp.c:1319" Connection 1: Clock bc9fef51df7a0008 is now the new anchor clock and master clock. History: 2076.580519 milliseconds.
         0.000036076 "rtp.c:1403" Connection 1: NQPTP new master clock bc9fef51df7a0008.
         0.000117844 "player.c:1059" Connection 1: Lead time for first frame 2734289973: 0.386812 seconds.
         2.924327392 "player.c:2436" Large positive sync error of: 3363 frames (0.076259 seconds), with frame: 2734411765.
         0.006435431 "player.c:1059" Connection 1: Lead time for first frame 2734441685: 0.819882 seconds.
         5.898636658 "player.c:2848" sync error ms, net sync ppm, all sync ppm,     packets, min DAC queue, min buffers, max buffers,  output fps
         0.000020920 "player.c:2848"          0.12,          0.0,          0.0,        1003,          6660,          84,          87,    44101.05
         8.003356508 "player.c:2848"         -0.09,          0.0,          0.0,        2006,          8493,          87,          87,    44100.05
         8.008090512 "player.c:2848"         -0.07,          0.0,          0.0,        3009,          8416,          86,          87,    44100.40
...
mikebrady commented 3 years ago

Thanks for the update. This sounds like a permissions error. Did you follow the guide, which creates a shairport-sync user and group and adds the user to the audio group to give the user access to the ALSA sound system?

KindDragon commented 3 years ago

I build using this guide https://github.com/mikebrady/shairport-sync/blob/development/BUILDFORAP2.md. Is it enough?

mikebrady commented 3 years ago

Thanks. Yes, that should work, as long as you performed the

# make install

step?

KindDragon commented 3 years ago

Yeap

github-actions[bot] commented 2 years ago

This issue has been inactive for 45 days so will be closed 7 days from now. To prevent this, please remove the "stale" label or post a comment.